C# Class Nez.TiledMapComponent

Inheritance: RenderableComponent, IUpdatable
Afficher le fichier Open project: prime31/Nez

Méthodes publiques

Свойство Type Description
collisionLayer Nez.Tiled.TiledTileLayer
layerIndicesToRender int[]
physicsLayer int
tiledMap TiledMap

Méthodes publiques

Méthode 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 méthode

public IUpdatable ( ) : void
Résultat void

TiledMapComponent() public méthode

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

addColliders() public méthode

public addColliders ( ) : void
Résultat void

debugRender() public méthode

public debugRender ( Graphics graphics ) : void
graphics Graphics
Résultat void

getColumnAtWorldPosition() public méthode

public getColumnAtWorldPosition ( float xPos ) : int
xPos float
Résultat int

getRowAtWorldPosition() public méthode

public getRowAtWorldPosition ( float yPos ) : int
yPos float
Résultat int

getTileAtWorldPosition() public méthode

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

getTilesIntersectingBounds() public méthode

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.
Résultat List

onAddedToEntity() public méthode

public onAddedToEntity ( ) : void
Résultat void

onEntityTransformChanged() public méthode

public onEntityTransformChanged ( Transform comp ) : void
comp Transform
Résultat void

onRemovedFromEntity() public méthode

public onRemovedFromEntity ( ) : void
Résultat void

removeColliders() public méthode

public removeColliders ( ) : void
Résultat void

render() public méthode

public render ( Graphics graphics, Camera camera ) : void
graphics Graphics
camera Camera
Résultat void

renderObjectGroup() public méthode

public renderObjectGroup ( TiledObjectGroup group, Graphics graphics ) : void
group Nez.Tiled.TiledObjectGroup
graphics Graphics
Résultat void

setLayerToRender() public méthode

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

setLayersToRender() public méthode

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

Property Details

collisionLayer public_oe property

public TiledTileLayer,Nez.Tiled collisionLayer
Résultat Nez.Tiled.TiledTileLayer

layerIndicesToRender public_oe property

if null, all layers will be rendered
public int[] layerIndicesToRender
Résultat int[]

physicsLayer public_oe property

public int physicsLayer
Résultat int

tiledMap public_oe property

public TiledMap tiledMap
Résultat TiledMap