C# 클래스 TiledLib.Map

A full map from Tiled.
파일 보기 프로젝트 열기: GarethIW/LDEngine 1 사용 예제들

공개 메소드들

메소드 설명
CheckCollision ( Vector2 position ) : bool?
CheckTileCollision ( Vector2 position ) : bool
CheckTileCollisionIntersect ( Vector2 position, Rectangle rect ) : Rectangle?
Draw ( SpriteBatch spriteBatch, Camera gameCamera ) : void

Draws all layers of the map

DrawAsMap ( SpriteBatch spriteBatch, int scale ) : void

Draws all layers of the map

DrawLayer ( SpriteBatch spriteBatch, TiledLib.Layer layer, Camera gameCamera, Vector2 offset, float alpha, Color color ) : void

Draws a single layer of the map

DrawLayer ( SpriteBatch spriteBatch, string layerName, Camera gameCamera ) : void

Draws a single layer by layer name

DrawLayer ( SpriteBatch spriteBatch, string layerName, Camera gameCamera, Color color ) : void

Draws a single layer by layer name, with a specified color

DrawLayer ( SpriteBatch spriteBatch, string layerName, Camera gameCamera, Vector2 shadowOffset, float alpha ) : void

Draws a single layer as shadows, by layer name

GetLayer ( string name ) : TiledLib.Layer

Gets a layer by name.

Map ( Microsoft.Xna.Framework.Content.ContentManager content, string mapName ) : System
UnloadContent ( ) : void

비공개 메소드들

메소드 설명
Map ( Microsoft.Xna.Framework.Content.ContentReader reader ) : System

메소드 상세

CheckCollision() 공개 메소드

public CheckCollision ( Vector2 position ) : bool?
position Vector2
리턴 bool?

CheckTileCollision() 공개 메소드

public CheckTileCollision ( Vector2 position ) : bool
position Vector2
리턴 bool

CheckTileCollisionIntersect() 공개 메소드

public CheckTileCollisionIntersect ( Vector2 position, Rectangle rect ) : Rectangle?
position Vector2
rect Microsoft.Xna.Framework.Rectangle
리턴 Rectangle?

Draw() 공개 메소드

Draws all layers of the map
public Draw ( SpriteBatch spriteBatch, Camera gameCamera ) : void
spriteBatch Microsoft.Xna.Framework.Graphics.SpriteBatch The SpriteBatch to use to render the map.
gameCamera Camera The camera to use for positioning.
리턴 void

DrawAsMap() 공개 메소드

Draws all layers of the map
public DrawAsMap ( SpriteBatch spriteBatch, int scale ) : void
spriteBatch Microsoft.Xna.Framework.Graphics.SpriteBatch The SpriteBatch to use to render the map.
scale int
리턴 void

DrawLayer() 공개 메소드

Draws a single layer of the map
public DrawLayer ( SpriteBatch spriteBatch, TiledLib.Layer layer, Camera gameCamera, Vector2 offset, float alpha, Color color ) : void
spriteBatch Microsoft.Xna.Framework.Graphics.SpriteBatch The SpriteBatch to use to render the layer.
layer TiledLib.Layer
gameCamera Camera The camera to use for positioning.
offset Vector2 A pixel amount to offset the tile positioning by
alpha float Layer opacity.
color Color The color to use when drawing.
리턴 void

DrawLayer() 공개 메소드

Draws a single layer by layer name
public DrawLayer ( SpriteBatch spriteBatch, string layerName, Camera gameCamera ) : void
spriteBatch Microsoft.Xna.Framework.Graphics.SpriteBatch The SpriteBatch to use to render the layer.
layerName string The name of the layer to draw.
gameCamera Camera The camera to use for positioning.
리턴 void

DrawLayer() 공개 메소드

Draws a single layer by layer name, with a specified color
public DrawLayer ( SpriteBatch spriteBatch, string layerName, Camera gameCamera, Color color ) : void
spriteBatch Microsoft.Xna.Framework.Graphics.SpriteBatch The SpriteBatch to use to render the layer.
layerName string The name of the layer to draw.
gameCamera Camera The camera to use for positioning.
color Color
리턴 void

DrawLayer() 공개 메소드

Draws a single layer as shadows, by layer name
public DrawLayer ( SpriteBatch spriteBatch, string layerName, Camera gameCamera, Vector2 shadowOffset, float alpha ) : void
spriteBatch Microsoft.Xna.Framework.Graphics.SpriteBatch The SpriteBatch to use to render the layer.
layerName string The name of the layer to draw.
gameCamera Camera The camera to use for positioning.
shadowOffset Vector2 Pixel amount to offset the shadowing by.
alpha float Shadow opacity
리턴 void

GetLayer() 공개 메소드

Gets a layer by name.
public GetLayer ( string name ) : TiledLib.Layer
name string The name of the layer to retrieve.
리턴 TiledLib.Layer

Map() 공개 메소드

public Map ( Microsoft.Xna.Framework.Content.ContentManager content, string mapName ) : System
content Microsoft.Xna.Framework.Content.ContentManager
mapName string
리턴 System

UnloadContent() 공개 메소드

public UnloadContent ( ) : void
리턴 void