diff options
Diffstat (limited to 'doc/classes/TileMap.xml')
-rw-r--r-- | doc/classes/TileMap.xml | 35 |
1 files changed, 29 insertions, 6 deletions
diff --git a/doc/classes/TileMap.xml b/doc/classes/TileMap.xml index 7034d75473..54d9e05180 100644 --- a/doc/classes/TileMap.xml +++ b/doc/classes/TileMap.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="TileMap" inherits="Node2D" category="Core" version="3.1"> +<class name="TileMap" inherits="Node2D" category="Core" version="3.2"> <brief_description> Node for 2D tile-based maps. </brief_description> @@ -34,7 +34,17 @@ <argument index="1" name="y" type="int"> </argument> <description> - Returns the tile index of the given cell. + Returns the tile index of the given cell. If no tile exists in the cell, returns [constant INVALID_CELL]. + </description> + </method> + <method name="get_cell_autotile_coord" qualifiers="const"> + <return type="Vector2"> + </return> + <argument index="0" name="x" type="int"> + </argument> + <argument index="1" name="y" type="int"> + </argument> + <description> </description> </method> <method name="get_cellv" qualifiers="const"> @@ -43,7 +53,7 @@ <argument index="0" name="position" type="Vector2"> </argument> <description> - Returns the tile index of the cell given by a Vector2. + Returns the tile index of the cell given by a Vector2. If no tile exists in the cell, returns [constant INVALID_CELL]. </description> </method> <method name="get_collision_layer_bit" qualifiers="const"> @@ -155,6 +165,13 @@ Optionally, the tile can also be flipped, transposed, or given autotile coordinates. Note that data such as navigation polygons and collision shapes are not immediately updated for performance reasons. If you need these to be immediately updated, you can call [method update_dirty_quadrants]. + Overriding this method also overrides it internally, allowing custom logic to be implemented when tiles are placed/removed: + [codeblock] + func set_cell(x, y, tile, flip_x, flip_y, transpose, autotile_coord) + # Write your custom logic here. + # To call the default method: + .set_cell(x, y, tile, flip_x, flip_y, transpose, autotile_coord) + [/codeblock] </description> </method> <method name="set_cellv"> @@ -234,7 +251,7 @@ <argument index="0" name="world_position" type="Vector2"> </argument> <description> - Returns the tilemap (grid-based) coordinatescorresponding to the given global position. + Returns the tilemap (grid-based) coordinates corresponding to the given local position. </description> </method> </methods> @@ -257,7 +274,7 @@ Position for tile origin. Uses TILE_ORIGIN_* constants. Default value: TILE_ORIGIN_TOP_LEFT. </member> <member name="cell_y_sort" type="bool" setter="set_y_sort_mode" getter="is_y_sort_mode_enabled"> - If [code]true[/code] the TileMap's children will be drawn in order of their Y coordinate. Default value: [code]false[/code]. + If [code]true[/code], the TileMap's children will be drawn in order of their Y coordinate. Default value: [code]false[/code]. </member> <member name="collision_bounce" type="float" setter="set_collision_bounce" getter="get_collision_bounce"> Bounce value for static body collisions (see [code]collision_use_kinematic[/code]). Default value: 0. @@ -272,7 +289,7 @@ The collision mask(s) for all colliders in the TileMap. </member> <member name="collision_use_kinematic" type="bool" setter="set_collision_use_kinematic" getter="get_collision_use_kinematic"> - 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]. + 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> <member name="mode" type="int" setter="set_mode" getter="get_mode" enum="TileMap.Mode"> The TileMap orientation mode. Uses MODE_* constants. Default value: MODE_SQUARE. @@ -313,6 +330,12 @@ <constant name="HALF_OFFSET_DISABLED" value="2" enum="HalfOffset"> Half offset disabled. </constant> + <constant name="HALF_OFFSET_NEGATIVE_X" value="3" enum="HalfOffset"> + Half offset on the X coordinate (negative). + </constant> + <constant name="HALF_OFFSET_NEGATIVE_Y" value="4" enum="HalfOffset"> + Half offset on the Y coordinate (negative). + </constant> <constant name="TILE_ORIGIN_TOP_LEFT" value="0" enum="TileOrigin"> Tile origin at its top-left corner. </constant> |