A Tile is a representation of a single tile within the Tilemap.
Name | Type | Description |
---|---|---|
layer | object | The layer in the Tilemap data that this tile belongs to. |
index | number | The index of this tile type in the core map data. |
x | number | The x coordinate of this tile. |
y | number | The y coordinate of this tile. |
width | number | Width of the tile. |
height | number | Height of the tile. |
The alpha value at which this tile is drawn to the canvas.
The sum of the y and height properties.
True if this tile can collide on any of its faces or has a collision callback set.
Name | Type | Description |
---|---|---|
width | number | The width of the tile in pixels. |
Name | Type | Description |
---|---|---|
height | number | The height of the tile in pixels. |
Indicating collide with any object on the bottom.
Indicating collide with any object on the left.
Indicating collide with any object on the right.
True if this tile can collide on any of its faces.
Indicating collide with any object on the top.
Tile collision callback.
The context in which the collision callback will be called.
Is the bottom of this tile an interesting edge?
Is the left of this tile an interesting edge?
Is the right of this tile an interesting edge?
Is the top of this tile an interesting edge?
Whether this tile is flipped (mirrored) or not.
The height of the tile in pixels.
The index of this tile within the map data corresponding to the tileset, or -1 if this represents a blank/null tile.
The layer in the Tilemap data that this tile belongs to.
The x value in pixels.
Tile specific properties.
The sum of the x and width properties.
The rotation angle of this tile.
Has this tile been walked / turned into a poly?
The y value.
The width of the tile in pixels.
Name | Type | Description |
---|---|---|
x | number | The x map coordinate of this tile. |
Name | Type | Description |
---|---|---|
y | number | The y map coordinate of this tile. |
The x map coordinate of this tile.
The y map coordinate of this tile.
Check if the given x and y world coordinates are within this Tile.
Name | Type | Description |
---|---|---|
x | number | The x coordinate to test. |
y | number | The y coordinate to test. |
True if the coordinates are within this Tile, otherwise false.
Copies the tile data and properties from the given tile to this tile.
Name | Type | Description |
---|---|---|
tile | Phaser.Tile | The tile to copy from. |
Clean up memory.
Check for intersection with this tile.
Name | Type | Description |
---|---|---|
x | number | The x axis in pixels. |
y | number | The y axis in pixels. |
right | number | The right point. |
bottom | number | The bottom point. |
Is this tile interesting?
Name | Type | Description |
---|---|---|
collides | boolean | If true will check any collides value. |
faces | boolean | If true will check any face value. |
True if the Tile is interesting, otherwise false.
Reset collision status flags.
Sets the collision flags for each side of this tile and updates the interesting faces list.
Name | Type | Description |
---|---|---|
left | boolean | Indicating collide with any object on the left. |
right | boolean | Indicating collide with any object on the right. |
up | boolean | Indicating collide with any object on the top. |
down | boolean | Indicating collide with any object on the bottom. |
Set a callback to be called when this tile is hit by an object.
The callback must true true for collision processing to take place.
Name | Type | Description |
---|---|---|
callback | function | Callback function. |
context | object | Callback will be called within this context. |
© 2016 Richard Davey, Photon Storm Ltd.
Licensed under the MIT License.
http://phaser.io/docs/2.6.2/Phaser.Tile.html