public override void Draw(Canvas canvas, GameTime gameTime) { background.Draw(canvas, 0, 0); sprite.Draw(canvas, particle_x, particle_y); animated_sprite.Draw(canvas, char_x, char_y); tweenedSprite.SetColor(Color.DodgerBlue); tweenedSprite.Draw(canvas, tweenedValue.Value, 200); _trail.Draw(canvas); _explosion.Draw(canvas); canvas.FillRect(100, 100, 100, 100, Color.DodgerBlue); canvas.DrawText(10, 10, $"Elapsed Update: {elapsed}, Elapsed Draw: {gameTime.ElapsedGameTime.Milliseconds}", Color.DodgerBlue, 0.25f); canvas.DrawText(10, 60, $"Trail Particles: {_trail.ParticlesAlive}", Color.White, 0.25f); canvas.DrawText(10, 80, $"Explosion Particles: {_explosion.ParticlesAlive}", Color.White, 0.25f); canvas.DrawText(10, 100, $"Tweener Allocations: {tweener.AllocationCount}", Color.White, 0.25f); canvas.DrawText(10, 120, $"Draw Calls: {canvas.MaxDrawCalls}", Color.White, 0.25f); }
public new void Draw() { base.Draw(); if (occupant != null) { occupant.Draw(); } }
public override void Draw(SpriteBatch spriteBatch) { for (int y = 0; y < _tileset.GetLength(1); y++) { for (int x = 0; x < _tileset.GetLength(0); x++) { _tilesetTile.SetPosition(new Vector2(x, y) * _tilesetTile.TileWidth); _tilesetTile.TileIndex = GetTilesetIndexFromPalette(_tileset[x, y]); _tilesetTile.Draw(spriteBatch); } } _cursorTile.Draw(spriteBatch); }