Returns the value of the Horizontal (X) or Vertical (Y) components of gravity. Gravity is a force that is applied to all actors (that are affected by it).
getGravity().x
getGravity().y
Sets the world's gravity.
setGravity([NUMBER], [NUMBER]);
Returns the current scene's [width/height] in [pixels/tiles].
getSceneWidth()
getSceneHeight()
Std.int(getSceneWidth()/getTileWidth())
Std.int(getSceneHeight()/getTileHeight())
Returns the current scene's name.
getCurrentSceneName()
Returns the current scene's tile width/height.
getTileWidth()
getTileHeight()
Converts a coordinate from pixels (real location) to tiles. In other words, divides the coordinate by the tile width or height respectively.
getTilePosition(0, [NUMBER]) //x coordinate
getTilePosition(1, [NUMBER]) //y coordinate
Sets a tile at the given position and layer.
setTileAt([INT], [INT], engine.getLayerById([INT]), [INT], [INT]);
setTileAt([INT], [INT], engine.getLayerByName([TEXT]), [INT], [INT]);
Returns true
if any tile exists at the given position and layer.
tileExistsAt([INT], [INT], engine.getLayerById([INT]))
tileExistsAt([INT], [INT], engine.getLayerByName([TEXT]))
Returns the ID of the tile at the given position and layer, or -1 if no tile found.
getTileIDAt([INT], [INT], engine.getLayerById([INT]))
getTileIDAt([INT], [INT], engine.getLayerByName([TEXT]))
Returns true
if ANY collision shape exists. If layer ID is -1, loops through all layers.
tileCollisionAt([INT], [INT], engine.getLayerById([INT]))
tileCollisionAt([INT], [INT], engine.getLayerByName([TEXT]))
Returns the ID of the collision shape for the tile at this position and layer, or -1 if no tile found.
getTileColIDAt([INT], [INT], engine.getLayerById([INT]))
getTileColIDAt([INT], [INT], engine.getLayerByName([TEXT]))
Returns the ID of the tileset for the tile at this position and layer, or -1 if no tile found.
getTilesetIDAt([INT], [INT], engine.getLayerById([INT]))
getTilesetIDAt([INT], [INT], engine.getLayerByName([TEXT]))
Remove the tile at this position.
removeTileAt([INT], [INT], engine.getLayerById([INT]));
removeTileAt([INT], [INT], engine.getLayerByName([TEXT]));
Get the tile data for the tile at this position. Returns empty text if no tile found.
getTileDataAt([INT], [INT], engine.getLayerById([INT]))
getTileDataAt([INT], [INT], engine.getLayerByName([TEXT]))