Clears all cells.
Clears cells that do not exist in the tileset.
Returns the tile index of the given cell. If no tile exists in the cell, returns constant INVALID_CELL.
Returns the coordinate (subtile column and row) of the autotile variation in the tileset. Returns a zero vector if the cell doesn't have autotiling.
Returns the tile index of the cell given by a Vector2. If no tile exists in the cell, returns constant INVALID_CELL.
Returns true if the given collision layer bit is set.
Returns true if the given collision mask bit is set.
Returns a Vector2 array with the positions of all cells containing a tile from the tileset (i.e. a tile index different from -1).
Returns an array of all cells with the given tile index specified in id.
Returns a rectangle enclosing the used (non-empty) tiles of the map.
Returns true if the given cell is transposed, i.e. the X and Y axes are swapped.
Returns true if the given cell is flipped in the X axis.
Returns true if the given cell is flipped in the Y axis.
Returns the local position of the top left corner of the cell corresponding to the given tilemap (grid-based) coordinates. To get the global position, use Node2D.toGlobal:
Sets the tile index for the cell given by a Vector2. An index of -1 clears the cell. Optionally, the tile can also be flipped, transposed, or given autotile coordinates. The autotile coordinate refers to the column and row of the subtile. Note: 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 updateDirtyQuadrants. Overriding this method also overrides it internally, allowing custom logic to be implemented when tiles are placed/removed:
Sets the tile index for the given cell. An index of -1 clears the cell. Optionally, the tile can also be flipped or transposed. Note: 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 updateDirtyQuadrants.
Sets the given collision layer bit.
Sets the given collision mask bit.
Applies autotiling rules to the cell (and its adjacent cells) referenced by its grid-based X and Y coordinates.
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.
Updates the tile map's quadrants, allowing things such as navigation and collision shapes to be immediately used if modified.
Returns the tilemap (grid-based) coordinates corresponding to the given local position. To use this with a global position, first determine the local position with Node2D.toLocal:
If true, the cell's UVs will be clipped.
The custom Transform2D to be applied to the TileMap's cells.
Amount to offset alternating tiles. See halfoffset for possible values.
The TileMap's quadrant size. Optimizes drawing by batching, using chunks of this size.
The TileMap's cell size.
Position for tile origin. See tileorigin for possible values.
If true, the TileMap's direct children will be drawn in order of their Y coordinate.
If true, the textures will be centered in the middle of each tile. This is useful for certain isometric or top-down modes when textures are made larger or smaller than the tiles (e.g. to avoid flickering on tile edges). The offset is still applied, but from the center of the tile. If used, compatibilityMode is ignored. If false, the texture position start in the top-left corner unless compatibilityMode is enabled.
Bounce value for static body collisions (see collision_use_kinematic).
Friction value for static body collisions (see collision_use_kinematic).
The collision layer(s) for all colliders in the TileMap. See url=https://docs.godotengine.org/en/3.3/tutorials/physics/physics_introduction.html#collision-layers-and-masksCollision layers and masks/url in the documentation for more information.
The collision mask(s) for all colliders in the TileMap. See url=https://docs.godotengine.org/en/3.3/tutorials/physics/physics_introduction.html#collision-layers-and-masksCollision layers and masks/url in the documentation for more information.
If true, TileMap collisions will be handled as a kinematic body. If false, collisions will be handled as static body.
If true, this tilemap's collision shape will be added to the collision shape of the parent. The parent has to be a CollisionObject2D.
If true, the compatibility with the tilemaps made in Godot 3.1 or earlier is maintained (textures move when the tile origin changes and rotate if the texture size is not homogeneous). This mode presents problems when doing flip_h, flip_v and transpose tile operations on non-homogeneous isometric tiles (e.g. 2:1), in which the texture could not coincide with the collision, thus it is not recommended for isometric or non-square tiles. If false, the textures do not move when doing flip_h, flip_v operations if no offset is used, nor when changing the tile origin. The compatibility mode doesn't work with the centeredTextures option, because displacing textures with the cellTileOrigin option or in irregular tiles is not relevant when centering those textures.
The TileMap orientation mode. See mode for possible values.
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).
If true, collision shapes are visible in the editor. Doesn't affect collision shapes visibility at runtime. To show collision shapes at runtime, enable Visible Collision Shapes in the Debug menu instead.
The assigned TileSet.
Construct a new instance of TileMap. Note: use memnew!TileMap instead.
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. When doing physics queries against the tilemap, the cell coordinates are encoded as metadata for each detected collision shape returned by methods such as Physics2DDirectSpaceState.intersectShape, Physics2DDirectBodyState.getContactColliderShapeMetadata, etc.