2017-09-12 20:42:36 +00:00
<?xml version="1.0" encoding="UTF-8" ?>
2018-02-19 09:46:33 +00:00
<class name= "TileMap" inherits= "Node2D" category= "Core" version= "3.1-dev" >
2017-09-12 20:42:36 +00:00
<brief_description >
Node for 2D tile-based maps.
</brief_description>
<description >
Node for 2D tile-based maps. Tilemaps use a [TileSet] which contain a list of tiles (textures plus optional collision, navigation, and/or occluder shapes) which are used to create grid-based maps.
</description>
<tutorials >
2018-01-25 08:03:59 +00:00
http://docs.godotengine.org/en/3.0/tutorials/2d/using_tilemaps.html
2017-09-12 20:42:36 +00:00
</tutorials>
<demos >
</demos>
<methods >
<method name= "clear" >
<return type= "void" >
</return>
<description >
Clear all cells.
</description>
</method>
<method name= "get_cell" qualifiers= "const" >
<return type= "int" >
</return>
<argument index= "0" name= "x" type= "int" >
</argument>
<argument index= "1" name= "y" type= "int" >
</argument>
<description >
Return the tile index of the referenced cell.
</description>
</method>
<method name= "get_cellv" qualifiers= "const" >
<return type= "int" >
</return>
2017-09-10 13:37:49 +00:00
<argument index= "0" name= "position" type= "Vector2" >
2017-09-12 20:42:36 +00:00
</argument>
<description >
Return the tile index of the cell referenced by a Vector2.
</description>
</method>
<method name= "get_collision_layer_bit" qualifiers= "const" >
<return type= "bool" >
</return>
<argument index= "0" name= "bit" type= "int" >
</argument>
<description >
</description>
</method>
<method name= "get_collision_mask_bit" qualifiers= "const" >
<return type= "bool" >
</return>
<argument index= "0" name= "bit" type= "int" >
</argument>
<description >
</description>
</method>
<method name= "get_used_cells" qualifiers= "const" >
<return type= "Array" >
</return>
<description >
Return an array of all cells containing a tile from the tileset (i.e. a tile index different from -1).
</description>
</method>
<method name= "get_used_cells_by_id" qualifiers= "const" >
<return type= "Array" >
</return>
<argument index= "0" name= "id" type= "int" >
</argument>
<description >
</description>
</method>
<method name= "get_used_rect" >
<return type= "Rect2" >
</return>
<description >
</description>
</method>
<method name= "is_cell_transposed" qualifiers= "const" >
<return type= "bool" >
</return>
<argument index= "0" name= "x" type= "int" >
</argument>
<argument index= "1" name= "y" type= "int" >
</argument>
<description >
Return whether the referenced cell is transposed, i.e. the X and Y axes are swapped (mirroring with regard to the (1,1) vector).
</description>
</method>
<method name= "is_cell_x_flipped" qualifiers= "const" >
<return type= "bool" >
</return>
<argument index= "0" name= "x" type= "int" >
</argument>
<argument index= "1" name= "y" type= "int" >
</argument>
<description >
Return whether the referenced cell is flipped over the X axis.
</description>
</method>
<method name= "is_cell_y_flipped" qualifiers= "const" >
<return type= "bool" >
</return>
<argument index= "0" name= "x" type= "int" >
</argument>
<argument index= "1" name= "y" type= "int" >
</argument>
<description >
Return whether the referenced cell is flipped over the Y axis.
</description>
</method>
<method name= "map_to_world" qualifiers= "const" >
<return type= "Vector2" >
</return>
2017-09-10 13:37:49 +00:00
<argument index= "0" name= "map_position" type= "Vector2" >
2017-09-12 20:42:36 +00:00
</argument>
<argument index= "1" name= "ignore_half_ofs" type= "bool" default= "false" >
</argument>
<description >
Return the absolute world position corresponding to the tilemap (grid-based) coordinates given as an argument.
Optionally, the tilemap's potential half offset can be ignored.
</description>
</method>
<method name= "set_cell" >
<return type= "void" >
</return>
<argument index= "0" name= "x" type= "int" >
</argument>
<argument index= "1" name= "y" type= "int" >
</argument>
<argument index= "2" name= "tile" type= "int" >
</argument>
<argument index= "3" name= "flip_x" type= "bool" default= "false" >
</argument>
<argument index= "4" name= "flip_y" type= "bool" default= "false" >
</argument>
<argument index= "5" name= "transpose" type= "bool" default= "false" >
</argument>
2017-11-24 08:16:27 +00:00
<argument index= "6" name= "autotile_coord" type= "Vector2" default= "Vector2( 0, 0 )" >
</argument>
2017-09-12 20:42:36 +00:00
<description >
Set the tile index for the cell referenced by its grid-based X and Y coordinates.
A tile index of -1 clears the cell.
2017-11-24 08:16:27 +00:00
Optionally, the tile can also be flipped over the X and Y coordinates, transposed, or be given autotile coordinates.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "set_cellv" >
<return type= "void" >
</return>
2017-09-10 13:37:49 +00:00
<argument index= "0" name= "position" type= "Vector2" >
2017-09-12 20:42:36 +00:00
</argument>
<argument index= "1" name= "tile" type= "int" >
</argument>
<argument index= "2" name= "flip_x" type= "bool" default= "false" >
</argument>
<argument index= "3" name= "flip_y" type= "bool" default= "false" >
</argument>
<argument index= "4" name= "transpose" type= "bool" default= "false" >
</argument>
<description >
Set the tile index for the cell referenced by a Vector2 of grid-based coordinates.
A tile index of -1 clears the cell.
Optionally, the tile can also be flipped over the X and Y axes or transposed.
</description>
</method>
<method name= "set_collision_layer_bit" >
<return type= "void" >
</return>
<argument index= "0" name= "bit" type= "int" >
</argument>
<argument index= "1" name= "value" type= "bool" >
</argument>
<description >
</description>
</method>
<method name= "set_collision_mask_bit" >
<return type= "void" >
</return>
<argument index= "0" name= "bit" type= "int" >
</argument>
<argument index= "1" name= "value" type= "bool" >
</argument>
<description >
</description>
</method>
2017-12-16 19:34:16 +00:00
<method name= "update_bitmask_area" >
<return type= "void" >
</return>
2018-01-03 12:45:03 +00:00
<argument index= "0" name= "position" type= "Vector2" >
2017-12-16 19:34:16 +00:00
</argument>
<description >
2017-12-24 16:58:08 +00:00
Applies autotiling rules to the cell (and its adjacent cells) referenced by its grid-based X and Y coordinates.
2017-12-16 19:34:16 +00:00
</description>
</method>
<method name= "update_bitmask_region" >
<return type= "void" >
</return>
<argument index= "0" name= "start" type= "Vector2" default= "Vector2( 0, 0 )" >
</argument>
<argument index= "1" name= "end" type= "Vector2" default= "Vector2( 0, 0 )" >
</argument>
<description >
2017-12-24 16:58:08 +00:00
Applies autotiling rules to the cells in the given region (specified by grid-based X and Y coordinates).
Calling with invalid (or missing) parameters applies autotiling rules for the entire TileMap.
2017-12-16 19:34:16 +00:00
</description>
</method>
2017-09-12 20:42:36 +00:00
<method name= "world_to_map" qualifiers= "const" >
<return type= "Vector2" >
</return>
2017-09-10 13:37:49 +00:00
<argument index= "0" name= "world_position" type= "Vector2" >
2017-09-12 20:42:36 +00:00
</argument>
<description >
Return the tilemap (grid-based) coordinates corresponding to the absolute world position given as an argument.
</description>
</method>
</methods>
<members >
2017-11-13 08:24:36 +00:00
<member name= "cell_clip_uv" type= "bool" setter= "set_clip_uv" getter= "get_clip_uv" >
</member>
2017-09-13 06:49:40 +00:00
<member name= "cell_custom_transform" type= "Transform2D" setter= "set_custom_transform" getter= "get_custom_transform" >
2017-09-12 20:42:36 +00:00
The custom [Transform2D] to be applied to the TileMap's cells.
</member>
2017-09-13 06:49:40 +00:00
<member name= "cell_half_offset" type= "int" setter= "set_half_offset" getter= "get_half_offset" enum= "TileMap.HalfOffset" >
2017-09-12 20:42:36 +00:00
Amount to offset alternating tiles. Uses HALF_OFFSET_* constants. Default value: HALF_OFFSET_DISABLED.
</member>
2017-09-13 06:49:40 +00:00
<member name= "cell_quadrant_size" type= "int" setter= "set_quadrant_size" getter= "get_quadrant_size" >
2017-09-12 20:42:36 +00:00
The TileMap's quadrant size. Optimizes drawing by batching, using chunks of this size. Default value: 16.
</member>
2017-09-13 06:49:40 +00:00
<member name= "cell_size" type= "Vector2" setter= "set_cell_size" getter= "get_cell_size" >
2017-09-12 20:42:36 +00:00
The TileMap's cell size.
</member>
2017-09-13 06:49:40 +00:00
<member name= "cell_tile_origin" type= "int" setter= "set_tile_origin" getter= "get_tile_origin" enum= "TileMap.TileOrigin" >
2017-09-12 20:42:36 +00:00
Position for tile origin. Uses TILE_ORIGIN_* constants. Default value: TILE_ORIGIN_TOP_LEFT.
</member>
2017-09-13 06:49:40 +00:00
<member name= "cell_y_sort" type= "bool" setter= "set_y_sort_mode" getter= "is_y_sort_mode_enabled" >
2017-09-12 20:42:36 +00:00
If [code]true[/code] the TileMap's children will be drawn in order of their Y coordinate. Default value: [code]false[/code].
</member>
2017-09-13 06:49:40 +00:00
<member name= "collision_bounce" type= "float" setter= "set_collision_bounce" getter= "get_collision_bounce" >
2017-09-12 20:42:36 +00:00
Bounce value for static body collisions (see [code]collision_use_kinematic[/code]). Default value: 0.
</member>
2017-09-13 06:49:40 +00:00
<member name= "collision_friction" type= "float" setter= "set_collision_friction" getter= "get_collision_friction" >
2017-09-12 20:42:36 +00:00
Friction value for static body collisions (see [code]collision_use_kinematic[/code]). Default value: 1.
</member>
2017-09-13 06:49:40 +00:00
<member name= "collision_layer" type= "int" setter= "set_collision_layer" getter= "get_collision_layer" >
2017-09-12 20:42:36 +00:00
The collision layer(s) for all colliders in the TileMap.
</member>
2017-09-13 06:49:40 +00:00
<member name= "collision_mask" type= "int" setter= "set_collision_mask" getter= "get_collision_mask" >
2017-09-12 20:42:36 +00:00
The collision mask(s) for all colliders in the TileMap.
</member>
2017-09-13 06:49:40 +00:00
<member name= "collision_use_kinematic" type= "bool" setter= "set_collision_use_kinematic" getter= "get_collision_use_kinematic" >
2017-09-12 20:42:36 +00:00
If [code]true[/code] TileMap collisions will be handled as a kinematic body. If [code]false[/code] collisions will be handled as static body. Default value: [code]false[/code].
</member>
2017-09-13 06:49:40 +00:00
<member name= "mode" type= "int" setter= "set_mode" getter= "get_mode" enum= "TileMap.Mode" >
2017-09-12 20:42:36 +00:00
The TileMap orientation mode. Uses MODE_* constants. Default value: MODE_SQUARE.
</member>
2017-09-13 06:49:40 +00:00
<member name= "occluder_light_mask" type= "int" setter= "set_occluder_light_mask" getter= "get_occluder_light_mask" >
2017-09-12 20:42:36 +00:00
The light mask assigned to all light occluders in the TileMap. The TileSet's light occluders will cast shadows only from Light2D(s) that have the same light mask(s).
</member>
2017-09-13 06:49:40 +00:00
<member name= "tile_set" type= "TileSet" setter= "set_tileset" getter= "get_tileset" >
2017-09-12 20:42:36 +00:00
The assigned [TileSet].
</member>
</members>
<signals >
<signal name= "settings_changed" >
<description >
Emitted when a tilemap setting has changed.
</description>
</signal>
</signals>
<constants >
2017-11-24 22:16:30 +00:00
<constant name= "INVALID_CELL" value= "-1" >
2017-09-12 20:42:36 +00:00
Returned when a cell doesn't exist.
</constant>
2017-11-24 22:16:30 +00:00
<constant name= "MODE_SQUARE" value= "0" enum= "Mode" >
2017-09-12 20:42:36 +00:00
Orthogonal orientation mode.
</constant>
2017-11-24 22:16:30 +00:00
<constant name= "MODE_ISOMETRIC" value= "1" enum= "Mode" >
2017-09-12 20:42:36 +00:00
Isometric orientation mode.
</constant>
2017-11-24 22:16:30 +00:00
<constant name= "MODE_CUSTOM" value= "2" enum= "Mode" >
2017-09-12 20:42:36 +00:00
Custom orientation mode.
</constant>
2017-11-24 22:16:30 +00:00
<constant name= "HALF_OFFSET_X" value= "0" enum= "HalfOffset" >
2017-09-12 20:42:36 +00:00
Half offset on the X coordinate.
</constant>
2017-11-24 22:16:30 +00:00
<constant name= "HALF_OFFSET_Y" value= "1" enum= "HalfOffset" >
2017-09-12 20:42:36 +00:00
Half offset on the Y coordinate.
</constant>
2017-11-24 22:16:30 +00:00
<constant name= "HALF_OFFSET_DISABLED" value= "2" enum= "HalfOffset" >
2017-09-12 20:42:36 +00:00
Half offset disabled.
</constant>
2017-11-24 22:16:30 +00:00
<constant name= "TILE_ORIGIN_TOP_LEFT" value= "0" enum= "TileOrigin" >
2017-09-12 20:42:36 +00:00
Tile origin at its top-left corner.
</constant>
2017-11-24 22:16:30 +00:00
<constant name= "TILE_ORIGIN_CENTER" value= "1" enum= "TileOrigin" >
2017-09-12 20:42:36 +00:00
Tile origin at its center.
</constant>
2017-11-24 22:16:30 +00:00
<constant name= "TILE_ORIGIN_BOTTOM_LEFT" value= "2" enum= "TileOrigin" >
2017-09-12 20:42:36 +00:00
</constant>
</constants>
</class>