C# Class TileGenerator.TileRectangleDrawer

Draws tile rectangles
Afficher le fichier Open project: Jewelots/Spelunky-Tiles Class Usage Examples

Méthodes publiques

Méthode Description
Draw ( SpriteBatch spriteBatch ) : void

Draw the tile rectangles

SetTexture ( Microsoft.Xna.Framework.Graphics.Texture2D texture ) : void

Sets the texture to draw the decal with

SetTileRectangles ( List newTiles ) : void

Set the TileRectangles to draw

TileRectangleDrawer ( int tileSize ) : System

Initialises a new TileRectangle drawer

Private Methods

Méthode Description
Get1x1SourceRect ( Random rand ) : Rectangle

Pick a random source rectangle for a 1x1 tile

Get1x2SourceRect ( Random rand ) : Rectangle

Pick a random source rectangle for a 1x2 tile

Get2x1SourceRect ( Random rand ) : Rectangle

Pick a random source rectangle for a 2x1 tile

Get2x2SourceRect ( Random rand ) : Rectangle

Pick a random source rectangle for a 2x2 tile

Method Details

Draw() public méthode

Draw the tile rectangles
public Draw ( SpriteBatch spriteBatch ) : void
spriteBatch Microsoft.Xna.Framework.Graphics.SpriteBatch Spritebatch to draw on
Résultat void

SetTexture() public méthode

Sets the texture to draw the decal with
public SetTexture ( Microsoft.Xna.Framework.Graphics.Texture2D texture ) : void
texture Microsoft.Xna.Framework.Graphics.Texture2D Texture to use
Résultat void

SetTileRectangles() public méthode

Set the TileRectangles to draw
public SetTileRectangles ( List newTiles ) : void
newTiles List A list of TileRectangles to draw
Résultat void

TileRectangleDrawer() public méthode

Initialises a new TileRectangle drawer
public TileRectangleDrawer ( int tileSize ) : System
tileSize int
Résultat System