public void Draw() { // Draw Background MyGraphics.sb.Draw(MyGraphics.GetTexture("mnu_back"), MyGraphics.screenRect, Color.White); MyGraphics.sb.Draw(MyGraphics.GetTexture("mnu_backcloud"), MyGraphics.screenRect, Color.White); switch (state) { case SurvivalState.Start: MyGraphics.sb.DrawString(MyFonts.GetFont("f_time"), "THUMBS UP TO START!", new Vector2(MyGraphics.screenRect.Center.X - 500, 50), Color.White); MyGraphics.sb.Draw(MyGraphics.GetTexture("g_up"), vGestLoc, Color.White); break; case SurvivalState.Count: MyGraphics.sb.DrawString(MyFonts.GetFont("f_countdown"), clCountDown.SecondsLeft.ToString(), new Vector2((MyGraphics.screenRect.Width / 2) - 150, MyGraphics.screenRect.Height / 4), Color.White); break; case SurvivalState.Game: DrawGame(); break; case SurvivalState.Finish: break; default: break; } }
/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(GraphicsDevice); // Buttons MyGraphics.AddTexture("btn_practice", Content.Load <Texture2D>("Images/Buttons/practice")); MyGraphics.AddTexture("btn_close", Content.Load <Texture2D>("Images/Buttons/X")); MyGraphics.AddTexture("btn_TimeAttack", Content.Load <Texture2D>("Images/Buttons/TimeAttack")); MyGraphics.AddTexture("btn_Survival", Content.Load <Texture2D>("Images/Buttons/survival")); // Images MyGraphics.AddTexture("title", Content.Load <Texture2D>("Images/title2")); MyGraphics.AddTexture("g_up", Content.Load <Texture2D>("Images/up")); MyGraphics.AddTexture("g_down", Content.Load <Texture2D>("Images/down")); MyGraphics.AddTexture("g_left", Content.Load <Texture2D>("Images/left")); MyGraphics.AddTexture("g_right", Content.Load <Texture2D>("Images/right")); MyGraphics.AddTexture("g_peace", Content.Load <Texture2D>("Images/peace")); // Backgorund MyGraphics.AddTexture("mnu_back", Content.Load <Texture2D>("Images/MenuBackground")); MyGraphics.AddTexture("mnu_backcloud", Content.Load <Texture2D>("Images/BackCloud")); // Fonts MyFonts.AddFont("test", Content.Load <SpriteFont>("Fonts/Font")); MyFonts.AddFont("f_countdown", Content.Load <SpriteFont>("Fonts/fCountdown")); MyFonts.AddFont("f_time", Content.Load <SpriteFont>("Fonts/fTime")); MyFonts.AddFont("f_opac", Content.Load <SpriteFont>("Fonts/fOpac")); }
public void DrawGame() { if (clTimer.isRunning) { MyGraphics.sb.DrawString(MyFonts.GetFont("f_time"), clTimer.SecondsLeft.ToString(), vTime, Color.White); MyGraphics.sb.DrawString(MyFonts.GetFont("f_time"), "SCORE:" + nScore.ToString(), new Vector2(10, 0), Color.White); //if (bAddSec) //{ // MyGraphics.sb.DrawString(MyFonts.GetFont("f_opac"), clTimer.SecondsLeft.ToString(), vTime, Color.White); //} switch (currGesture) { case PXCMGesture.Gesture.Label.LABEL_NAV_SWIPE_DOWN: break; case PXCMGesture.Gesture.Label.LABEL_NAV_SWIPE_LEFT: MyGraphics.sb.Draw(MyGraphics.GetTexture("g_left"), vGestLoc, Color.White); break; case PXCMGesture.Gesture.Label.LABEL_NAV_SWIPE_RIGHT: MyGraphics.sb.Draw(MyGraphics.GetTexture("g_right"), vGestLoc, Color.White); break; case PXCMGesture.Gesture.Label.LABEL_NAV_SWIPE_UP: break; case PXCMGesture.Gesture.Label.LABEL_POSE_BIG5: break; case PXCMGesture.Gesture.Label.LABEL_POSE_PEACE: MyGraphics.sb.Draw(MyGraphics.GetTexture("g_peace"), vGestLoc, Color.White); break; case PXCMGesture.Gesture.Label.LABEL_POSE_THUMB_DOWN: MyGraphics.sb.Draw(MyGraphics.GetTexture("g_down"), vGestLoc, Color.White); break; case PXCMGesture.Gesture.Label.LABEL_POSE_THUMB_UP: MyGraphics.sb.Draw(MyGraphics.GetTexture("g_up"), vGestLoc, Color.White); break; default: break; } } }