C# Class manlyMiniGames.Map

Afficher le fichier Open project: degrand1/Manly-Mini-Games Class Usage Examples

Méthodes publiques

Свойство Type Description
center Vector2

Méthodes publiques

Méthode Description
Draw ( SpriteBatch batch ) : void
LoadContent ( Microsoft.Xna.Framework.Content.ContentManager content ) : void

Loading the textures

Map ( ) : System
drawOnMap ( SpriteBatch batch, Microsoft.Xna.Framework.Graphics.Texture2D tex, Vector2 pos ) : void

Renders a texture onto the map using the given spritebatch and map position

screenToWorld ( Vector2 pos ) : Vector2

Returns the world position relative to the screen position given

setViewPos ( Vector2 pos ) : void

Center the screen on the given world coordinate

worldToScreen ( Vector2 pos ) : Vector2

Returns the screen position matching the given world position

Private Methods

Méthode Description
Grid ( int x, int y ) : UInt16

Returns the grid at the relative position with bounds checking

Method Details

Draw() public méthode

public Draw ( SpriteBatch batch ) : void
batch Microsoft.Xna.Framework.Graphics.SpriteBatch
Résultat void

LoadContent() public méthode

Loading the textures
public LoadContent ( Microsoft.Xna.Framework.Content.ContentManager content ) : void
content Microsoft.Xna.Framework.Content.ContentManager The manager handling the textures
Résultat void

Map() public méthode

public Map ( ) : System
Résultat System

drawOnMap() public méthode

Renders a texture onto the map using the given spritebatch and map position
public drawOnMap ( SpriteBatch batch, Microsoft.Xna.Framework.Graphics.Texture2D tex, Vector2 pos ) : void
batch Microsoft.Xna.Framework.Graphics.SpriteBatch Spritebatch to render the texture
tex Microsoft.Xna.Framework.Graphics.Texture2D Texture we want to render
pos Vector2
Résultat void

screenToWorld() public méthode

Returns the world position relative to the screen position given
public screenToWorld ( Vector2 pos ) : Vector2
pos Vector2 The screen position
Résultat Vector2

setViewPos() public méthode

Center the screen on the given world coordinate
public setViewPos ( Vector2 pos ) : void
pos Vector2 World Coordinate
Résultat void

worldToScreen() public méthode

Returns the screen position matching the given world position
public worldToScreen ( Vector2 pos ) : Vector2
pos Vector2 world position
Résultat Vector2

Property Details

center public_oe property

public Vector2 center
Résultat Vector2