# Scenes > World

## Gravity

### Get Value of Gravity

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``````

### Set Gravity

Sets the world's gravity.

``setGravity([NUMBER], [NUMBER]);``

## Properties

### Scene Width / Height

Returns the current scene's [width/height] in [pixels/tiles].

``````getSceneWidth()
getSceneHeight()
Std.int(getSceneWidth()/getTileWidth())
Std.int(getSceneHeight()/getTileHeight())``````

### Scene Name

Returns the current scene's name.

``getCurrentSceneName()``

## Tile API

### Tile Width / Height

Returns the current scene's tile width/height.

``````getTileWidth()
getTileHeight()``````

### Convert to Tile Coordinates

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``````

### Set a Tile

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]);``````

### Does a Tile exist at location?

Returns `true` if any tile exists at the given position and layer.

``````tileExistsAt([INT], [INT], engine.getLayerById([INT]))
tileExistsAt([INT], [INT], engine.getLayerByName([TEXT]))``````

### Get ID for Tile at location

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]))``````

### Does a solid tile exist at location?

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]))``````

### Get Collision ID for tile at location

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]))``````

### Get Tileset ID for tile at location

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 tile at location

Remove the tile at this position.

``````removeTileAt([INT], [INT], engine.getLayerById([INT]));
removeTileAt([INT], [INT], engine.getLayerByName([TEXT]));``````

### Get Metadata for tile at location

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]))``````