public override void Draw(GameTime gameTime, SpriteBatch spriteBatch) { base.Draw(gameTime, spriteBatch); if (label != null) { label.Draw(gameTime, spriteBatch); } }
public override void Draw(GameTime gameTime, Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch) { base.Draw(gameTime, spriteBatch); if (drawSaveText) { saveText.Position = new Vector2((GameEnvironment.Screen.X - saveText.Size.X) / 2, 0); saveText.Draw(gameTime, spriteBatch); } }
public override void Draw(GameTime gameTime, SpriteBatch spriteBatch) { if (!Visible) { return; } container.Draw(gameTime, spriteBatch); text.Draw(gameTime, spriteBatch); }
public override void Draw(GameTime gameTime, SpriteBatch spriteBatch) { GameEnvironment.GameStateManager.GetGameState("playingState").Draw(gameTime, spriteBatch); //Draw the black fade-out square spriteBatch.Begin(); base.Draw(gameTime, spriteBatch); spriteBatch.Draw(black.SpriteSheet.Sprite, new Rectangle(0, 0, GameEnvironment.Screen.X, GameEnvironment.Screen.Y), Color.White * fader); spriteBatch.End(); //switch to 3D drawing spriteBatch.GraphicsDevice.BlendState = BlendState.AlphaBlend; spriteBatch.GraphicsDevice.DepthStencilState = DepthStencilState.Default; fader += (float)gameTime.ElapsedGameTime.TotalSeconds; //Draw the "End." text on screen after 3 seconds if (fader > 3) { text.Position = new Vector2(GameEnvironment.Screen.X / 2 - 10, GameEnvironment.Screen.Y / 2 - 10); text.Draw(gameTime, spriteBatch); } //Play the gunshot sound after 3 seconds if (fader > 3 && !gunShotSound) { foreach (Sound sound in MusicPlayer.SoundEffect) { if (sound.Name == "GunShot") { sound.PlaySound(); //TODO: 1x afspelen } } gunShotSound = true; } //Switch to the credit state after 6 seconds if (fader > 6) { fader = 0; foreach (Sound sound in MusicPlayer.Music) { sound.PlaySound(); } GameEnvironment.GameStateManager.SwitchTo("creditState"); } }
/// <summary> /// Draws the GameObjects of the list /// </summary> /// <param name="gameTime">The object used for reacting to timechanges</param> /// <param name="spriteBatch">The SpriteBatch</param> public override void Draw(GameTime gameTime, SpriteBatch spriteBatch) { foreach (GameObject gameObject in gameObjects) { if (gameObject is Object3D) { Object3D gameObject3D = gameObject as Object3D; if (gameObject3D.Model != null) { gameObject3D.DrawCamera(player); gameObject3D.Draw(gameTime, spriteBatch); } } else if (gameObject is GameObjectGrid) { GameObjectGrid gameObjectGrid = gameObject as GameObjectGrid; foreach (GameObject obj in gameObjectGrid.Objects) { if (obj is Object3D) { Object3D gameObject3D = obj as Object3D; if (gameObject3D.Model != null) { gameObject3D.DrawCamera(player); gameObject3D.Draw(gameTime, spriteBatch); } } } } else { gameObject.Draw(gameTime, spriteBatch); } } if (isOnExit && !NoteInVicinity) { exitText.Draw(gameTime, spriteBatch); isOnExit = false; } else if (NoteInVicinity) { noteText.Draw(gameTime, spriteBatch); } }
protected override void Draw(GameTime gameTime) { base.Draw(gameTime); spriteBatch.Begin(); physicscounter.Draw(gameTime, spriteBatch); framecounter.Draw(gameTime, spriteBatch); spriteBatch.End(); frames++; if (time <= 0) { time = 1; framecounter.Text = frames.ToString(); frames = 0; } else { time -= gameTime.ElapsedGameTime.TotalSeconds; } }
public override void Draw(GameTime gameTime, SpriteBatch spriteBatch) { if (escDown) { credits.Position -= new Vector2(0, (float)gameTime.ElapsedGameTime.TotalMilliseconds / 6); } else { credits.Position -= new Vector2(0, (float)gameTime.ElapsedGameTime.TotalMilliseconds / 16); } credits.Draw(gameTime, spriteBatch); timer += (float)gameTime.ElapsedGameTime.TotalSeconds; if (credits.Position.Y < -1400) { credits.Position = new Vector2(100, GameEnvironment.Screen.Y * 2); GameEnvironment.GameStateManager.SwitchTo("titleScreenState"); } }
public override void Draw(GameTime gameTime, Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch) { text.Draw(gameTime, spriteBatch); base.Draw(gameTime, spriteBatch); }
public override void Draw(GameTime gameTime, SpriteBatch spriteBatch) { base.Draw(gameTime, spriteBatch); label.Draw(gameTime, spriteBatch); }
public override void Draw(GameTime gameTime, SpriteBatch spriteBatch) { totalBall.Draw(gameTime, spriteBatch); base.Draw(gameTime, spriteBatch); }
public override void Draw(GameTime gameTime, SpriteBatch spriteBatch) { base.Draw(gameTime, spriteBatch); box.Draw(gameTime, spriteBatch); descritption.Draw(gameTime, spriteBatch); }