C# Class Azmyth.XNA.TerrainManager

Inheritance: Microsoft.Xna.Framework.GameComponent
Afficher le fichier Open project: GalacticSoft/Azmyth Class Usage Examples

Private Properties

Свойство Type Description
DrawBorder void

Méthodes publiques

Méthode Description
CenterTile ( float tileX, float tileY ) : void

Will center terrain at specified coordinates. (in tiles)

Draw ( GameTime gameTime ) : void

Draws the loaded chunks visible in the viewport

GetChunkCount ( ) : int
GetNodeCount ( ) : int
Initialize ( ) : void

Allows the game to perform any initialization it needs to before starting to run. This is where it can query for any required services and load any non-graphic related content. Calling base.Initialize will enumerate through any components and initialize them as well.

LoadChunk ( float chunkX, float chunkY ) : void

Load a chunk at specified x and y position (in chunks)

LoadContent ( ) : void

Loads terrain tiles

ScreenToTile ( Rectangle screenRect ) : System.Drawing.RectangleF

Converts screen rectangle into tiles

ScreenToTileF ( System screenRect ) : System.Drawing.RectangleF

Converts screen rectangle into tiles

TerrainManager ( AzmythGame game ) : System
TileToScreen ( System tileRect ) : Rectangle

Converts tile rectangle into screen position.

TileToScreenF ( System tileRect ) : System.Drawing.RectangleF

Converts tile rectangle into screen position.

Update ( GameTime gameTime ) : void

Updates chunk states.

UpdateChunks ( Vector2 position ) : void

Private Methods

Méthode Description
DrawBorder ( Rectangle rectangleToDraw, int thicknessOfBorder, Color borderColor ) : void

Will draw a border (hollow rectangle) of the given 'thicknessOfBorder' (in pixels) of the specified color. By Sean Colombo, from http://bluelinegamestudios.com/blog

Method Details

CenterTile() public méthode

Will center terrain at specified coordinates. (in tiles)
public CenterTile ( float tileX, float tileY ) : void
tileX float
tileY float
Résultat void

Draw() public méthode

Draws the loaded chunks visible in the viewport
public Draw ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime
Résultat void

GetChunkCount() public méthode

public GetChunkCount ( ) : int
Résultat int

GetNodeCount() public méthode

public GetNodeCount ( ) : int
Résultat int

Initialize() public méthode

Allows the game to perform any initialization it needs to before starting to run. This is where it can query for any required services and load any non-graphic related content. Calling base.Initialize will enumerate through any components and initialize them as well.
public Initialize ( ) : void
Résultat void

LoadChunk() public méthode

Load a chunk at specified x and y position (in chunks)
public LoadChunk ( float chunkX, float chunkY ) : void
chunkX float
chunkY float
Résultat void

LoadContent() public méthode

Loads terrain tiles
public LoadContent ( ) : void
Résultat void

ScreenToTile() public méthode

Converts screen rectangle into tiles
public ScreenToTile ( Rectangle screenRect ) : System.Drawing.RectangleF
screenRect Microsoft.Xna.Framework.Rectangle
Résultat System.Drawing.RectangleF

ScreenToTileF() public méthode

Converts screen rectangle into tiles
public ScreenToTileF ( System screenRect ) : System.Drawing.RectangleF
screenRect System
Résultat System.Drawing.RectangleF

TerrainManager() public méthode

public TerrainManager ( AzmythGame game ) : System
game AzmythGame
Résultat System

TileToScreen() public méthode

Converts tile rectangle into screen position.
public TileToScreen ( System tileRect ) : Rectangle
tileRect System
Résultat Microsoft.Xna.Framework.Rectangle

TileToScreenF() public méthode

Converts tile rectangle into screen position.
public TileToScreenF ( System tileRect ) : System.Drawing.RectangleF
tileRect System
Résultat System.Drawing.RectangleF

Update() public méthode

Updates chunk states.
public Update ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime
Résultat void

UpdateChunks() public méthode

public UpdateChunks ( Vector2 position ) : void
position Vector2
Résultat void