private void DrawHook(object sender, WorldState.DrawEventArgs e) { e.Batch.Rectangle(new Rectangle(0, 0, (int)e.ScreenSize.X, (int)e.ScreenSize.Y), Color.Black * _alpha * 0.3f); Vector2 uiPos = e.ScreenSize / 2 - _menu.Area.Value / 2; _menu.Draw(uiPos, e.Batch, e.ScreenSize); }
public override void Draw(SpriteBatch spriteBatch) { spriteBatch.Draw(Texture, new Rectangle(Position.ToPoint() + Camera.CamPos.ToPoint(), new Point( Helper.GraphicsDevice.Viewport.Bounds.Width, Helper.GraphicsDevice.Viewport.Bounds.Height)), Color.White); UserInterface.Draw(spriteBatch); }
public override void Draw(float deltaTime, SpriteBatch spriteBatch) { spriteBatch.Begin(); spriteBatch.DrawString(hudFont, "You Win!", new Vector2(Game1.SCREENWIDTH / 2 - 100, (Game1.SCREENHEIGHT / 2) - 400), Color.White); spriteBatch.DrawString(hudFont, "Final Score: " + finalScore.ToString(), new Vector2(Game1.SCREENWIDTH / 2 - 100, Game1.SCREENHEIGHT / 2), Color.White); menuUI.Draw(spriteBatch); spriteBatch.End(); }
public override void Draw(float deltaTime, SpriteBatch spriteBatch) { spriteBatch.Begin(); // // Draw all text, with instructions spriteBatch.DrawString(hudFont, "WASD to Move", new Vector2(Game1.SCREENWIDTH / 2 - 400, Game1.SCREENHEIGHT - 700), Color.White); spriteBatch.DrawString(hudFont, "Mouse for Aim", new Vector2(Game1.SCREENWIDTH / 2 - 400, Game1.SCREENHEIGHT - 600), Color.White); spriteBatch.DrawString(hudFont, "Left-Click to Shoot", new Vector2(Game1.SCREENWIDTH / 2 - 400, Game1.SCREENHEIGHT - 500), Color.White); spriteBatch.DrawString(hudFont, "Scroll to Swap Weapon", new Vector2(Game1.SCREENWIDTH / 2 - 400, Game1.SCREENHEIGHT - 400), Color.White); menuUI.Draw(spriteBatch); spriteBatch.End(); }
// Draw state public override void Draw(float deltaTime, SpriteBatch spriteBatch) { spriteBatch.Begin(); menuUI.Draw(spriteBatch); if (gameManager.AwardsData.scores.Count > 0) { for (int i = 0; i < 10 && i < gameManager.AwardsData.scores.Count; i++) { spriteBatch.DrawString(hudFont, gameManager.AwardsData.scores[i].ToString(), new Vector2(Game1.SCREENWIDTH / 2 - 300, 400 + (i * 40)), Color.White); } } for (int i = 0; i < 10; i++) { spriteBatch.DrawString(hudFont, string.Format("{0}. ", i + 1), new Vector2(Game1.SCREENWIDTH / 2 - 350, 400 + (i * 40)), Color.White); } spriteBatch.End(); }
// Draw state public override void Draw(float deltaTime, SpriteBatch spriteBatch) { spriteBatch.Begin(); menuUI.Draw(spriteBatch); spriteBatch.End(); }
void Update() { if (fadePushButton) { PushButton.Draw(); //ボタンを押してメニュー表示 if (!ReturnOp && KeyLoader.keyLoader.IsAnyKey()) { backcnt = 0; fadePushButton = false; gui.SetActive(true); menuUI.gameObject.SetActive(true); //再度表示する時のために初期化 PushButton.Reset(); PushButton.gameObject.SetActive(false); //決定音 SEMaster.Play(KeyInputSE.keyInoutSE.GetClip(KeyInputSE.Type.Decide)); } else { ReturnOpeningScene(); } } else { menuUI.Draw(menu); if (menuSelect && KeyLoader.keyLoader.joyStickAxis.x > 0 && !KeyLoader.keyLoader.StickWait) { menu++; if (menu > Menu.END) { menu = Menu.START; } SEMaster.Play(KeyInputSE.keyInoutSE.GetClip(KeyInputSE.Type.Move)); KeyLoader.keyLoader.SetStickWait(ResetFrame); } else if (menuSelect && KeyLoader.keyLoader.joyStickAxis.x < 0 && !KeyLoader.keyLoader.StickWait) { menu--; if (menu < Menu.START) { menu = Menu.END; } SEMaster.Play(KeyInputSE.keyInoutSE.GetClip(KeyInputSE.Type.Move)); KeyLoader.keyLoader.SetStickWait(ResetFrame); } if (menuSelect && KeyLoader.keyLoader.B) { SEMaster.Play(KeyInputSE.keyInoutSE.GetClip(KeyInputSE.Type.Cancel)); gui.SetActive(false); fadePushButton = true; PushButton.gameObject.SetActive(true); menuUI.gameObject.SetActive(false); } switch (menu) { case Menu.START: GameStart(); break; case Menu.CONFIG: GameConfig(); break; case Menu.CREDIT: GameCredit(); break; case Menu.END: GameEnd(); break; } } }