public override void Draw(GameScreen screen, int x, int y, Main main) { int offset = (int)Math.Floor(timer); Vector2 pos = Room.TileToWorldPos(x, y); Vector2 offsetPos = new Vector2(0f, offset); Rectangle source = new Rectangle(offset, 0, Tile.tileSize - offset, Tile.tileSize - offset); main.spriteBatch.Draw(texture, screen.DrawPos(main, pos + offsetPos), source, Color.White); offsetPos = new Vector2(0f, 0f); source = new Rectangle(offset, Tile.tileSize - offset, Tile.tileSize - offset, offset); main.spriteBatch.Draw(texture, screen.DrawPos(main, pos + offsetPos), source, Color.White); offsetPos = new Vector2(Tile.tileSize - offset, offset); source = new Rectangle(0, 0, offset, Tile.tileSize - offset); main.spriteBatch.Draw(texture, screen.DrawPos(main, pos + offsetPos), source, Color.White); offsetPos = new Vector2(Tile.tileSize - offset, 0f); source = new Rectangle(0, Tile.tileSize - offset, offset, offset); main.spriteBatch.Draw(texture, screen.DrawPos(main, pos + offsetPos), source, Color.White); }
public override void Draw(GameScreen screen, int x, int y, Main main) { Texture2D texture; if (!textures.TryGetValue(direction, out texture)) { texture = textures[Direction.Left]; } main.spriteBatch.Draw(texture, screen.DrawPos(main, Room.TileToWorldPos(x, y)), null, Color.White); }
public override void Draw(GameScreen screen, Main main) { Color color = Color.White; if (IsHurt) { color *= 0.75f; } main.spriteBatch.Draw(texture, screen.DrawPos(main, position), null, color, texture.Center()); }
public override void Draw(GameScreen screen, Main main) { for (int k = 0; k < numBullets; k++) { float angle = rotation + 2f * k / numBullets * (float)Math.PI; Vector2 pos = center + radius * Helper.AngleToVector2(angle); main.spriteBatch.Draw(texture, screen.DrawPos(main, pos), null, color, texture.Center()); } }
public override void Draw(GameScreen screen, int x, int y, Main main) { Texture2D texture = closedTexture; if (open) { texture = vertical ? openVerticalTexture : openHorizontalTexture; } main.spriteBatch.Draw(texture, screen.DrawPos(main, Room.TileToWorldPos(x, y)), null, Color.White); }
public override void Draw(GameScreen screen, int x, int y, Main main) { Vector2 drawPos = screen.DrawPos(main, Room.TileToWorldPos(x, y)); Rectangle frame = new Rectangle(0, 0, Tile.tileSize, Tile.tileSize); if (right) { frame.X = Tile.tileSize; } if (bottom) { frame.Y = Tile.tileSize; } main.spriteBatch.Draw(texture, drawPos, frame, Color.White, Vector2.Zero); }
public override void Draw(GameScreen screen, Main main) { main.spriteBatch.Draw(texture, screen.DrawPos(main, position), null, Color.White, texture.Center()); }
public override void Draw(GameScreen screen, int x, int y, Main main) { Texture2D texture = light ? onTexture : offTexture; main.spriteBatch.Draw(texture, screen.DrawPos(main, Room.TileToWorldPos(x, y)), null, Color.White); }
public override void Draw(GameScreen screen, Main main) { Texture2D texture = timeLeft > 0 ? warningTexture : pillarTexture; Vector2 drawPos = screen.DrawPos(main, Room.TileToWorldPos(x, y)); main.spriteBatch.Draw(texture, drawPos, Color.White); }
public override void Draw(GameScreen screen, int x, int y, Main main) { main.spriteBatch.Draw(texture, screen.DrawPos(main, Room.TileToWorldPos(new Vector2(x + 0.5f, y + 0.5f))), null, Color.White, texture.Center()); }
public override void Draw(GameScreen screen, Main main) { main.spriteBatch.Draw(texture, screen.DrawPos(main, position), null, Color.White, Helper.Vector2ToAngle(velocity), texture.Center(), 1f, SpriteEffects.None, 1f); }
public override void Draw(GameScreen screen, int x, int y, Main main) { Texture2D text = pressed ? texturePressed : texture; main.spriteBatch.Draw(text, screen.DrawPos(main, Room.TileToWorldPos(x, y) + new Vector2(10f)), null, Color.White); }
public override void Draw(GameScreen screen, Main main) { main.spriteBatch.Draw(texture, screen.DrawPos(main, position), null, color, rotation, texture.Center(), scale, SpriteEffects.None, 0f); }