Module flower.tiled.TileLayer
This class to display a tile layer.
Inherit from the Group class is the name of a class that layer. You can also be dynamically added to create a TileLayer.
Extends:
Info:
- Release: V3.0.0
- Author: Makoto
Functions
TileLayer:init (tileMap) | The constructor. |
TileLayer:loadData (data) | Load the layer data. |
TileLayer:saveData () | Save the layer data. |
TileLayer:createRenderer () | Create a renderer. |
TileLayer:getProperty (key) | Returns the property. |
TileLayer:getPropertyAsNumber (key) | Returns the property. |
TileLayer:getGid (x, y) | Returns the gid of the specified position. |
TileLayer:setGid (x, y, gid) | Sets gid of the specified position. |
TileLayer:checkBounds (x, y) | Tests whether the position is within the range specified. |
Functions
- TileLayer:init (tileMap)
-
The constructor.
Parameters:
- tileMap TileMap
- TileLayer:loadData (data)
-
Load the layer data.
Parameters:
- data layer data
- TileLayer:saveData ()
-
Save the layer data.
Returns:
-
layer data
- TileLayer:createRenderer ()
-
Create a renderer.
There is no need to call directly basically.
Returns:
-
layer data
- TileLayer:getProperty (key)
-
Returns the property.
Parameters:
- key key.
Returns:
-
value.
- TileLayer:getPropertyAsNumber (key)
-
Returns the property.
Parameters:
- key key.
Returns:
-
value.
- TileLayer:getGid (x, y)
-
Returns the gid of the specified position.
If is out of range, return nil.
Parameters:
- x potision of x (0 <= x && x <= mapWidth)
- y potision of y (0 <= y && y <= mapHeight)
Returns:
-
gid.
- TileLayer:setGid (x, y, gid)
-
Sets gid of the specified position.
If you set the position is out of range to error.
Parameters:
- x potision of x (0 <= x && x <= mapWidth)
- y potision of y (0 <= y && y <= mapHeight)
- gid global id.
- TileLayer:checkBounds (x, y)
-
Tests whether the position is within the range specified.
Parameters:
- x potision of x (0 <= x && x <= mapWidth)
- y potision of y (0 <= y && y <= mapHeight)
Returns:
-
True if in the range.