Table of Contents

Class TileMapPattern

Holds a pattern to be copied from or pasted into TileMaps.

Inheritance
TileMapPattern

Remarks

This resource holds a set of cells to help bulk manipulations of TileMap.

A pattern always start at the (0,0) coordinates and cannot have cells with negative coordinates.

Methods

get_cell_alternative_tile(Vector2i)

Qualifiers: const

Returns the tile alternative ID of the cell at coords.

int get_cell_alternative_tile(Vector2i coords)

Parameters

coords Vector2i

get_cell_atlas_coords(Vector2i)

Qualifiers: const

Returns the tile atlas coordinates ID of the cell at coords.

Vector2i get_cell_atlas_coords(Vector2i coords)

Parameters

coords Vector2i

get_cell_source_id(Vector2i)

Qualifiers: const

Returns the tile source ID of the cell at coords.

int get_cell_source_id(Vector2i coords)

Parameters

coords Vector2i

get_size

Qualifiers: const

Returns the size, in cells, of the pattern.

Vector2i get_size

get_used_cells

Qualifiers: const

Returns the list of used cell coordinates in the pattern.

Vector2i[] get_used_cells

has_cell(Vector2i)

Qualifiers: const

Returns whether the pattern has a tile at the given coordinates.

bool has_cell(Vector2i coords)

Parameters

coords Vector2i

is_empty

Qualifiers: const

Returns whether the pattern is empty or not.

bool is_empty

remove_cell(Vector2i, bool)

Remove the cell at the given coordinates.

void remove_cell(Vector2i coords, bool update_size)

Parameters

coords Vector2i
update_size bool

set_cell(Vector2i, int, Vector2i, int)

Sets the tile identifiers for the cell at coordinates coords. See TileMap.set_cell.

void set_cell(Vector2i coords, int source_id, Vector2i atlas_coords, int alternative_tile)

Parameters

coords Vector2i
source_id int
atlas_coords Vector2i
alternative_tile int

set_size(Vector2i)

Sets the size of the pattern.

void set_size(Vector2i size)

Parameters

size Vector2i