public override void Draw(GameTime gameTime, SpriteBatch spriteBatch) { base.Draw(gameTime, spriteBatch); titleMenuState.Draw(gameTime, spriteBatch); settings.Draw(gameTime, spriteBatch); }
public void Draw(GameTime gameTime, SpriteBatch spriteBatch) { playingState.Draw(gameTime, spriteBatch); spriteBatch.End(); spriteBatch.Begin(SpriteSortMode.Deferred, null, null, null, null, null, GameWorld.ScaleMatrix); hud.Draw(gameTime, spriteBatch); }
public override void Draw(GameTime gameTime, SpriteBatch spriteBatch) { base.Draw(gameTime, spriteBatch); items.Draw(gameTime, spriteBatch); //Draw Text spriteBatch.DrawString(spriteFont, text, this.GlobalPosition + textPosition, textColor); }
public override void Draw(GameTime time, SpriteBatch s) { ForEach(obj => (obj as Tile).DrawBackground(time, s)); ForEach(obj => (obj as Tile).DrawForeground(time, s)); // Draw the Unit target overlay, if it exists unitTargets.Draw(time, s); hitEffectList.Draw(time, s); }
protected override void Draw(GameTime gameTime) { GraphicsDevice.Clear(Color.Black); // start drawing sprites, applying the scaling matrix spriteBatch.Begin(SpriteSortMode.Deferred, null, null, null, null, null, spriteScale); // let the game world draw itself gameWorld.Draw(gameTime, spriteBatch); spriteBatch.End(); }
public override void Draw(GameTime gameTime, SpriteBatch spriteBatch) { base.Draw(gameTime, spriteBatch); foreach (Bullet bullets in Bullets.Children) { bullets.Draw(gameTime, spriteBatch); } foreach (Enemy Enemies in Enemies.Children) { Enemies.Draw(gameTime, spriteBatch); } }
public void Draw(GameTime gameTime, SpriteBatch spriteBatch) { objectList.Draw(gameTime, spriteBatch); foreach (Turret turret in turrets) { turret.Draw(gameTime, spriteBatch); } foreach (Enemy enemy1 in enemies) { enemy1.Draw(gameTime, spriteBatch); } foreach (Bullet bullet in bullets) { bullet.Draw(gameTime, spriteBatch); } player.Draw(gameTime, spriteBatch); }
public void DrawMap(SpriteBatch spriteBatch, int centerCellX, int centerCellY) { Vector2 position; for (int i = 0; i < gridSizeX; i++) { for (int j = 0; j < gridSizeY; j++) { if (tileGrid[i, j] != null) { //Tile tile = map[i, j]; int x = (i - centerCellX) * tileWidth + GameConstants.MapArea.Center.X - tileWidth / 2; int y = (j - centerCellY) * tileHeight + GameConstants.MapArea.Center.Y - tileHeight / 2; position = new Vector2(x, y); //spriteBatch.Draw(tile.texture, position, sourceRectangle: tile.sourceRectangle, color: tile.color, origin: tile.origin); tileGrid[i, j].Draw(spriteBatch, position); } } } gameObjectList.Draw(spriteBatch, new Point(centerCellX, centerCellY), tileWidth, tileHeight); }
public virtual void Draw(Graphics graphics) { gameObjects.Draw(graphics); }
public override void Draw(GameTime gameTime, SpriteBatch spriteBatch) { root.Draw(gameTime, spriteBatch); }
public override void Draw(GameTime gameTime, SpriteBatch spriteBatch) { base.Draw(gameTime, spriteBatch); buttons.Draw(gameTime, spriteBatch); }
/// <summary> /// Draws all objects in this GameState. /// </summary> /// <param name="gameTime">An object containing information about the time that has passed in the game.</param> /// <param name="spriteBatch">A sprite batch object used for drawing sprites.</param> public virtual void Draw(GameTime gameTime, SpriteBatch spriteBatch) { gameObjects.Draw(gameTime, spriteBatch); }
//This is where the objects in the game (LevelObjects) are drawn. static public void DrawGame(GameTime gameTime, SpriteBatch spriteBatch) { LevelObjects.Draw(gameTime, spriteBatch); }
public void Draw(GameTime gameTime, SpriteBatch spriteBatch) { objectList.Draw(gameTime, spriteBatch); }
public void Draw(GameTime gameTime, SpriteBatch spriteBatch, Camera camera) { gameObjects.Draw(gameTime, spriteBatch, newCamera); }
public override void Draw(GameTime gameTime, SpriteBatch spriteBatch, Camera camera) { float bmin = 0.75f; foreach (KeyValuePair <Living, float> kvp in seenBy) { if (kvp.Key is Player) { float p = kvp.Value / kvp.Key.ViewDistance; bmin = p < bmin ? p : bmin; } } bmin = 1 - bmin; DrawColor = new Color(bmin, bmin, bmin); if (type != TileType.Background) { base.Draw(gameTime, spriteBatch, camera); } if (Visible) { foreach (GameObject go in onTile.Children) { if (go is SpriteGameObject) { SpriteGameObject sgo = go as SpriteGameObject; sgo.DrawColor = DrawColor; } } onTile.Draw(gameTime, spriteBatch, camera); #region HighlightReach foreach (KeyValuePair <Living, float> kvp in seenBy) { if (kvp.Key is Player) { //highlight tiles that are whithin reach for the local player //current key is the localplayer and the tile is not a wall or the key's tile if (kvp.Key.Id == Player.LocalPlayerName && !(TileType == TileType.Wall || kvp.Key.Tile == this)) { // whithin normal attack reach of the local player if (showNormalReach && kvp.Value <= kvp.Key.Reach + 0.5f) { //draw highlight float highlightStrenght = 0.2f; Texture2D redTex = GameEnvironment.AssetManager.GetSingleColorPixel(Color.Red); Rectangle drawhBox = new Rectangle(camera.CalculateScreenPosition(this).ToPoint(), new Point(sprite.Width, sprite.Width)); Color drawRColor = new Color(Color.White, highlightStrenght); spriteBatch.Draw(redTex, null, drawhBox, sprite.SourceRectangle, origin, 0.0f, new Vector2(scale), drawRColor, SpriteEffects.None, 0.0f); } // whithin skillreach of the local player if (showSKillReach && kvp.Key.CurrentSkill != null && kvp.Value <= kvp.Key.CurrentSkill.SkillReach + 0.5f) { //draw highlight float highlightStrenght = 0.2f; Texture2D redTex = GameEnvironment.AssetManager.GetSingleColorPixel(Color.Blue); Rectangle drawhBox = new Rectangle(camera.CalculateScreenPosition(this).ToPoint(), new Point(sprite.Width, sprite.Width)); Color drawRColor = new Color(Color.White, highlightStrenght); spriteBatch.Draw(redTex, null, drawhBox, sprite.SourceRectangle, origin, 0.0f, new Vector2(scale), drawRColor, SpriteEffects.None, 0.0f); } } } } #endregion } }