C# Class Nez.TiledMapComponent

Inheritance: RenderableComponent, IUpdatable
ファイルを表示 Open project: prime31/Nez

Public Properties

Property Type Description
collisionLayer Nez.Tiled.TiledTileLayer
layerIndicesToRender int[]
physicsLayer int
tiledMap TiledMap

Public Methods

Method Description
IUpdatable ( ) : void
TiledMapComponent ( TiledMap tiledMap, string collisionLayerName = null, bool shouldCreateColliders = true ) : System
addColliders ( ) : void
debugRender ( Graphics graphics ) : void
getColumnAtWorldPosition ( float xPos ) : int
getRowAtWorldPosition ( float yPos ) : int
getTileAtWorldPosition ( Vector2 worldPos ) : TiledTile

this method requires that you are using a collision layer setup in the constructor.

getTilesIntersectingBounds ( Rectangle bounds ) : List

gets all the non-empty tiles that intersect the passed in bounds for the collision layer. The returned List can be put back in the pool via ListPool.free.

onAddedToEntity ( ) : void
onEntityTransformChanged ( Transform comp ) : void
onRemovedFromEntity ( ) : void
removeColliders ( ) : void
render ( Graphics graphics, Camera camera ) : void
renderObjectGroup ( TiledObjectGroup group, Graphics graphics ) : void
setLayerToRender ( string layerName ) : void

sets this component to only render a single layer

setLayersToRender ( ) : void

sets which layers should be rendered by this component by name. If you know the indices you can set layerIndicesToRender directly.

Method Details

IUpdatable() public method

public IUpdatable ( ) : void
return void

TiledMapComponent() public method

public TiledMapComponent ( TiledMap tiledMap, string collisionLayerName = null, bool shouldCreateColliders = true ) : System
tiledMap TiledMap
collisionLayerName string
shouldCreateColliders bool
return System

addColliders() public method

public addColliders ( ) : void
return void

debugRender() public method

public debugRender ( Graphics graphics ) : void
graphics Graphics
return void

getColumnAtWorldPosition() public method

public getColumnAtWorldPosition ( float xPos ) : int
xPos float
return int

getRowAtWorldPosition() public method

public getRowAtWorldPosition ( float yPos ) : int
yPos float
return int

getTileAtWorldPosition() public method

this method requires that you are using a collision layer setup in the constructor.
public getTileAtWorldPosition ( Vector2 worldPos ) : TiledTile
worldPos Vector2 World position.
return Nez.Tiled.TiledTile

getTilesIntersectingBounds() public method

gets all the non-empty tiles that intersect the passed in bounds for the collision layer. The returned List can be put back in the pool via ListPool.free.
public getTilesIntersectingBounds ( Rectangle bounds ) : List
bounds Microsoft.Xna.Framework.Rectangle Bounds.
return List

onAddedToEntity() public method

public onAddedToEntity ( ) : void
return void

onEntityTransformChanged() public method

public onEntityTransformChanged ( Transform comp ) : void
comp Transform
return void

onRemovedFromEntity() public method

public onRemovedFromEntity ( ) : void
return void

removeColliders() public method

public removeColliders ( ) : void
return void

render() public method

public render ( Graphics graphics, Camera camera ) : void
graphics Graphics
camera Camera
return void

renderObjectGroup() public method

public renderObjectGroup ( TiledObjectGroup group, Graphics graphics ) : void
group Nez.Tiled.TiledObjectGroup
graphics Graphics
return void

setLayerToRender() public method

sets this component to only render a single layer
public setLayerToRender ( string layerName ) : void
layerName string Layer name.
return void

setLayersToRender() public method

sets which layers should be rendered by this component by name. If you know the indices you can set layerIndicesToRender directly.
public setLayersToRender ( ) : void
return void

Property Details

collisionLayer public_oe property

public TiledTileLayer,Nez.Tiled collisionLayer
return Nez.Tiled.TiledTileLayer

layerIndicesToRender public_oe property

if null, all layers will be rendered
public int[] layerIndicesToRender
return int[]

physicsLayer public_oe property

public int physicsLayer
return int

tiledMap public_oe property

public TiledMap tiledMap
return TiledMap