C# Class TileGenerator.TileRectangleDrawer

Draws tile rectangles
Exibir arquivo Open project: Jewelots/Spelunky-Tiles Class Usage Examples

Public Methods

Method 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

Method 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 method

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

SetTexture() public method

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
return void

SetTileRectangles() public method

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

TileRectangleDrawer() public method

Initialises a new TileRectangle drawer
public TileRectangleDrawer ( int tileSize ) : System
tileSize int
return System