public override void Draw(SpriteBatch sb) { if (MenuButton == null) { return; } int buttonLock = ButtonLock; // we only want to get this once bool foundHighlight = false; Vector2 mouse = new Vector2(Main.mouseX, Main.mouseY); Update(); int count = 0; MenuButton.whoAmi = count++; MenuButton.Update(); if (foundHighlight) { MenuButton.Draw(sb, false); } else { if (MenuButton.canMouseOver && !MenuButton.disabled && (buttonLock == -1 || buttonLock == MenuButton.whoAmi)) { foundHighlight = MenuButton.MouseOver(mouse); } if (MenuButton.whoAmi == buttonLock) { foundHighlight = true; } MenuButton.Draw(sb, foundHighlight); if (foundHighlight && Main.mouseLeft) { if (MenuButton.buttonLock) { ButtonLock = MenuButton.whoAmi; } if (Main.mouseLeftRelease) { MenuButton.framesHeld = 0; MenuButton.Click(); } else { MenuButton.framesHeld++; MenuButton.ClickHold(); } } } base.Draw(sb); }
public void Draw(SpriteBatch sb, GraphicsDevice gd) { gd.Clear(Color.MidnightBlue); bttnLogin.Draw(sb); bttnRegister.Draw(sb); bttnPlay.Draw(sb); }
void OnGUI() { foreach (var button in _buttons) { button.Draw(); } _backButton.Draw(); }
public override void Draw(GameTime gameTime) { _spriteBatch.Draw(backgroundTexture, backgroundRectangle, Color.White); _startButton.Draw(_spriteBatch); _exitButton.Draw(_spriteBatch); base.Draw(gameTime); }
public void Draw(SpriteBatch spriteBatch) { spriteBatch.Begin(SpriteSortMode.Deferred, null, SamplerState.PointClamp, null, null, null, null); spriteBatch.Draw(mBackground, new Rectangle(0, 0, mScreenWidth, mScreenHeight), Color.Azure); mStartNewGame.Draw(spriteBatch); mLoadGame.Draw(spriteBatch); mTechDemo.Draw(spriteBatch); spriteBatch.End(); }
public void Draw(SpriteBatch spriteBatch) { spriteBatch.Begin(SpriteSortMode.Deferred, null, SamplerState.PointClamp, null, null, null, null); spriteBatch.Draw(mBackground, new Rectangle(0, 0, mScreenWidth, mScreenHeight), Color.Azure); mStart.Draw(spriteBatch); mOptions.Draw(spriteBatch); mStatistics.Draw(spriteBatch); mAchievements.Draw(spriteBatch); mExit.Draw(spriteBatch); spriteBatch.End(); }
public override void Draw(GameTime gameTime) { spriteBatch.Begin(); logo.Draw(spriteBatch); newGameButton.Draw(spriteBatch); settingsButton.Draw(spriteBatch); exitButton.Draw(spriteBatch); spriteBatch.End(); base.Draw(gameTime); }
public void Draw(SpriteBatch spriteBatch) { spriteBatch.Begin(); spriteBatch.Draw(mBackground, new Rectangle(0, 0, mScreenWidth, mScreenHeight), Color.Azure); spriteBatch.DrawString(mSpriteFont, "Ton : ", new Vector2(50, 120), Color.Black); spriteBatch.DrawString(mSpriteFont, "Musik : ", new Vector2(50, 220), Color.Black); mMusic.Draw(spriteBatch); mVolume.Draw(spriteBatch); mVolumeSlider.Draw(spriteBatch); mResolution.Draw(spriteBatch); spriteBatch.End(); }
public void Draw(SpriteBatch spriteBatch) { spriteBatch.Begin(SpriteSortMode.Deferred, null, SamplerState.PointClamp, null, null, null, null); spriteBatch.Draw(mBackground, new Rectangle(0, 0, mScreenWidth, mScreenHeight), Color.Azure); spriteBatch.DrawString(mSpriteFont, "Bitte Spielstand auswählen", new Vector2(mScreenWidth / 2f - 150, 30), Color.Blue); foreach (var btn in mListButtons) { btn.Draw(spriteBatch); } mRefresh.Draw(spriteBatch); spriteBatch.End(); }
public override void Draw(Renderer renderer) { renderer.Draw(GraphicsEngine.pixel, new Rectangle(0, 0, Main.WindowWidth, Main.WindowHeight), Shortcuts.BG_COLOR * bgopacity); RenderHelper.SmartDrawRectangle(GraphicsEngine.bg, 5, (int)position.X - 2, (int)position.Y - 2, (int)size.X + 4, (int)size.Y + 4, Color.White, renderer); text.Draw(renderer); yes.Draw(renderer); no.Draw(renderer); renderer.Draw(GraphicsEngine.pixel, new Rectangle((int)no.position.X, (int)no.position.Y, (int)size.X, 1), Color.White); renderer.Draw(GraphicsEngine.pixel, new Rectangle((int)yes.position.X, (int)yes.position.Y, 1, 23), Color.White); }
public void Draw(SpriteBatch spriteBatch) { spriteBatch.Begin(); MenuButton.Draw(spriteBatch); spriteBatch.DrawString(header, "High Scores", new Microsoft.Xna.Framework.Vector2(100, 50), Color.White); int i = 0; while (i < 5 && i < scores.Count) { string txt = String.Format("Score {0} - {1}", i + 1, scores[i]); spriteBatch.DrawString(scoreText, txt, new Microsoft.Xna.Framework.Vector2(100, 150 + (50 * i)), Color.White); ++i; } spriteBatch.End(); }
public void Draw(SpriteBatch spriteBatch, SpriteFont font, Texture2D playerSprite, User cu, int ammoCount, GraphicsDevice gd) //Can't display current player's info due to various errors in construction //Health isn't done, so that won't be displayed either { gd.Clear(Color.MidnightBlue); bttnContinue.Draw(spriteBatch); spriteBatch.Draw(playerSprite, new Vector2(50, 50), Color.White); string info = cu.Name; info += "\nAmmo remaining: "; spriteBatch.DrawString(font, Convert.ToString(info + ammoCount), new Vector2(270, 50), Color.PaleGoldenrod); spriteBatch.DrawString(font, "1: " + proxy.Invoke <int>("Request Scoreboard", cu.Name), new Vector2(600, 250), Color.PaleGoldenrod); }
/// <summary> /// All objects are drawn here /// </summary> /// <param name="gameTime">Provides a snapshot of timing values</param> /// <param name="spriteBatch">Helper class for drawing strings and sprites</param> public override void Draw(GameTime gameTime, SpriteBatch spriteBatch) { _graphicsDevice.Clear(Color.Black); DKTitle.Draw(spriteBatch); playButton.Draw(spriteBatch); infoButton.Draw(spriteBatch); exitButton.Draw(spriteBatch); _mario.Draw(spriteBatch); foreach (var sprite in _menuBarrels) { sprite.Draw(spriteBatch); } _menuKong.Draw(spriteBatch); }
/// <summary> /// All objects are drawn here /// </summary> /// <param name="gameTime">Provides a snapshot of timing values</param> /// <param name="spriteBatch">Helper class for drawing strings and sprites</param> public override void Draw(GameTime gameTime, SpriteBatch spriteBatch) { spriteBatch.DrawString(arcadeClassic, "Original game by nintendo", new Vector2(_graphicsDevice.Viewport.Width * 0.05f, _graphicsDevice.Viewport.Height * 0.7f), Color.White); spriteBatch.DrawString(arcadeClassic, "Recreated by Tiago Gama", new Vector2(_graphicsDevice.Viewport.Width * 0.05f, _graphicsDevice.Viewport.Height * 0.7f + arcadeClassic.MeasureString("Original game by nintendo").Y), Color.White); _graphicsDevice.Clear(Color.Black); DKTitle.Draw(spriteBatch); joystickRightLeft.Draw(spriteBatch); marioWalking.Draw(spriteBatch); marioClimbing.Draw(spriteBatch); joystickUpDown.Draw(spriteBatch); arcadeButtons.Draw(spriteBatch); marioJumping.Draw(spriteBatch); goBackButton.Draw(spriteBatch); _mario.Draw(spriteBatch); }
public void Draw() { spriteBatch.Draw(Background, new Vector2(0, 0), null, Color.White, 0, new Vector2(0, 0), 1f, SpriteEffects.None, 0); WordBox.Draw(); for (int ii = 0; ii < PlayFieldWidth; ii++) { for (int jj = 0; jj < PlayFieldHeight; jj++) { CurrentLetter2DArray[ii, jj].Draw(); } } HomeButton.Draw(); Drawable.Draw(); if (Won) { spriteBatch.Draw(WinnerSplash, new Vector2(256, 144), null, Color.White, 0, new Vector2(0, 0), 1f, SpriteEffects.None, 0); NewButton = new MenuButton(new Vector2(480, 448), "NewButton", gameContent.arrorRight, spriteBatch, gameContent); NewButton.Draw(); } }
public override void Draw(GameTime gameTime) { _spriteBatch.Draw(backgroundTexture, backgroundRectangle, Color.White); // Draw scores table StringBuilder showTotalScoreLabel = new StringBuilder("TOTAL SCORE"); StringBuilder showTotalScoreValue = new StringBuilder(ShooterTutorialGame.GamePlayer.Score.TotalScore.ToString()); Vector2 showTotalScorePosition = new Vector2(_device.Viewport.Width / 2 / 2, 220); Vector2 showTotalScoreValuePosition = new Vector2((int)(_device.Viewport.Width * 0.75f), 220); StringBuilder showTotalEnemiesKilledLabel = new StringBuilder("TOTAL ENEMIES KILLED"); StringBuilder showTotalEnemiesKilledValue = new StringBuilder(ShooterTutorialGame.GamePlayer.Score.TotalEnemiesKilled.ToString()); Vector2 showTotalEnemiesKilledPosition = new Vector2(_device.Viewport.Width / 2 / 2, showTotalScorePosition.Y + 40); Vector2 showTotalEnemiesKilledValuePosition = new Vector2((int)(_device.Viewport.Width * 0.75f), showTotalScorePosition.Y + 40); _spriteBatch.DrawString(_spriteFont, showTotalScoreLabel, showTotalScorePosition, Color.White); _spriteBatch.DrawString(_spriteFont, showTotalScoreValue, showTotalScoreValuePosition, Color.White); _spriteBatch.DrawString(_spriteFont, showTotalEnemiesKilledLabel, showTotalEnemiesKilledPosition, Color.White); _spriteBatch.DrawString(_spriteFont, showTotalEnemiesKilledValue, showTotalEnemiesKilledValuePosition, Color.White); _menuButton.Draw(_spriteBatch); base.Draw(gameTime); }
public override void Draw(float deltaTime) { Sprite.DrawFrame(new Vector2(), "Default"); MenuButton.Draw(SelectedIndex); TextBlock.Draw(); }
public override void Draw(SpriteBatch spriteBatch) { MapManager.Instance.Draw(spriteBatch); LevelManager.Instance.Draw(spriteBatch); Actor.Instance.Draw(spriteBatch); // Affichage des boutons design_button.Draw(spriteBatch); fire_button.Draw(spriteBatch); water_button.Draw(spriteBatch); next_button.Draw(spriteBatch); previous_button.Draw(spriteBatch); refresh_button.Draw(spriteBatch); sound_button.Draw(spriteBatch); music_button.Draw(spriteBatch); menu_button.Draw(spriteBatch); // Affichage du score int current_moves = LevelManager.Instance.currentLevel.moves; int min_moves = LevelManager.Instance.currentLevel.min_moves; spriteBatch.DrawString(ScreenManager.Instance.sprite_font, string.Format("{0} ({1})", current_moves, min_moves), position_texte_score, Color.Black, 0, Vector2.Zero, 1.5f, SpriteEffects.None, 0); // info-bulles sur le score MouseState current_state = Mouse.GetState(); Rectangle mouse_rect = new Rectangle(current_state.X, current_state.Y, 1, 1); Rectangle score_rect = new Rectangle(0, 0, 64, 32); if (info_bulle.Length > 0 && mouse_rect.Intersects(score_rect)) { spriteBatch.DrawString(ScreenManager.Instance.sprite_font, info_bulle, new Vector2(0, 1.3f * 32), Color.White); } // Affichage de l'information du niveau (sur le coté) string level = string.Format("LEVEL {0}", LevelManager.Instance.levelIndex + 1); int position_y = 2 * Tile.Height; foreach (char c in level) { float scale = 1; Color color = Color.LightGray; if (System.Char.IsDigit(c)) { scale = 2; if (MenuScreen.levels.difficulty[LevelManager.Instance.levelIndex] == 0) { color = Color.LightGreen; } else if (MenuScreen.levels.difficulty[LevelManager.Instance.levelIndex] == 1) { color = Color.Orange; } else if (MenuScreen.levels.difficulty[LevelManager.Instance.levelIndex] == 2) { color = Color.Red; } else if (MenuScreen.levels.difficulty[LevelManager.Instance.levelIndex] == 3) { color = Color.Violet; } else if (MenuScreen.levels.difficulty[LevelManager.Instance.levelIndex] == 4) { color = Color.Aqua; } else { color = Color.White; } } position_title = new Vector2(ScreenManager.Instance.Dimension.X - 20, position_y); spriteBatch.DrawString(ScreenManager.Instance.sprite_font, c.ToString(), position_title, color, 0, Vector2.Zero, scale, SpriteEffects.None, 0); position_y += Tile.Height; } base.Draw(spriteBatch); }
protected override void Draw(GameTime gameTime) { GraphicsDevice.Clear(Color.CornflowerBlue); _spriteBatch.Begin(); if (gameManager.currentState == GameManager.GameState.MainMenu) { var kstate = Keyboard.GetState(); var newInput = roomInput.HandleInput(kstate); var currentInput = roomInput.userInput; roomInput.userInput = anyKeyManager.TryUpdateInputText(currentInput, newInput, 10, roomInput); _spriteBatch.Draw(Content.Load <Texture2D>("MainMenu"), new Rectangle(0, 0, graphics.PreferredBackBufferWidth, graphics.PreferredBackBufferHeight), Color.White); playButton.Draw(_spriteBatch); roomInput.Draw(_spriteBatch); _spriteBatch.DrawString(inputFont, roomInput.userInput, new Vector2(360, 410), Color.Black); _spriteBatch.End(); } else if (gameManager.currentState == GameManager.GameState.Options) { } else if (gameManager.currentState == GameManager.GameState.Playing) { _spriteBatch.DrawString( scoreFont, gameManager.scores[GameManager.Teams.Left].ToString(), new Vector2(200, graphics.PreferredBackBufferHeight / 2 - 160), Color.LightGray); _spriteBatch.DrawString( scoreFont, gameManager.scores[GameManager.Teams.Right].ToString(), new Vector2(432, graphics.PreferredBackBufferHeight / 2 - 160), Color.LightGray); _spriteBatch.Draw( gatesTexture, new Vector2(0, graphics.PreferredBackBufferHeight / 2), null, Color.Red, 0f, new Vector2(gatesTexture.Width / 2, gatesTexture.Height / 2), Vector2.One, SpriteEffects.None, 0f); _spriteBatch.Draw( gatesTexture, new Vector2(graphics.PreferredBackBufferWidth, graphics.PreferredBackBufferHeight / 2), null, Color.Blue, 0f, new Vector2(gatesTexture.Width / 2, gatesTexture.Height / 2), Vector2.One, SpriteEffects.None, 0f); _spriteBatch.Draw( ballTexture, playerOne.position, null, Color.Red, 0f, new Vector2(ballTexture.Width / 2, ballTexture.Height / 2), Vector2.One, SpriteEffects.None, 0f); _spriteBatch.Draw( ballTexture, playerTwo.position, null, Color.Blue, 0f, new Vector2(ballTexture.Width / 2, ballTexture.Height / 2), Vector2.One, SpriteEffects.None, 0f); _spriteBatch.Draw( ballTexture, puck.position, null, Color.Black, 0f, new Vector2(ballTexture.Width / 2, ballTexture.Height / 2), Vector2.One, SpriteEffects.None, 0f); _spriteBatch.End(); } base.Draw(gameTime); }