Table of Contents

Class TileMapPattern

Namespace
Godot
Assembly
GodotSharp.dll

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.

public class TileMapPattern : Resource, IDisposable
Inheritance
TileMapPattern
Implements
Inherited Members

Constructors

TileMapPattern()

public TileMapPattern()

Methods

GetCellAlternativeTile(Vector2I)

Returns the tile alternative ID of the cell at coords.

public int GetCellAlternativeTile(Vector2I coords)

Parameters

coords Vector2I

Returns

int

GetCellAtlasCoords(Vector2I)

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

public Vector2I GetCellAtlasCoords(Vector2I coords)

Parameters

coords Vector2I

Returns

Vector2I

GetCellSourceId(Vector2I)

Returns the tile source ID of the cell at coords.

public int GetCellSourceId(Vector2I coords)

Parameters

coords Vector2I

Returns

int

GetSize()

Returns the size, in cells, of the pattern.

public Vector2I GetSize()

Returns

Vector2I

GetUsedCells()

Returns the list of used cell coordinates in the pattern.

public Array<Vector2I> GetUsedCells()

Returns

Array<Vector2I>

HasCell(Vector2I)

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

public bool HasCell(Vector2I coords)

Parameters

coords Vector2I

Returns

bool

HasGodotClassMethod(in godot_string_name)

Check if the type contains a method with the given name. This method is used by Godot to check if a method exists before invoking it. Do not call or override this method.

protected override bool HasGodotClassMethod(in godot_string_name method)

Parameters

method godot_string_name

Name of the method to check for.

Returns

bool

HasGodotClassSignal(in godot_string_name)

Check if the type contains a signal with the given name. This method is used by Godot to check if a signal exists before raising it. Do not call or override this method.

protected override bool HasGodotClassSignal(in godot_string_name signal)

Parameters

signal godot_string_name

Name of the signal to check for.

Returns

bool

InvokeGodotClassMethod(in godot_string_name, NativeVariantPtrArgs, out godot_variant)

Invokes the method with the given name, using the given arguments. This method is used by Godot to invoke methods from the engine side. Do not call or override this method.

protected override bool InvokeGodotClassMethod(in godot_string_name method, NativeVariantPtrArgs args, out godot_variant ret)

Parameters

method godot_string_name

Name of the method to invoke.

args NativeVariantPtrArgs

Arguments to use with the invoked method.

ret godot_variant

Value returned by the invoked method.

Returns

bool

IsEmpty()

Returns whether the pattern is empty or not.

public bool IsEmpty()

Returns

bool

RemoveCell(Vector2I, bool)

Remove the cell at the given coordinates.

public void RemoveCell(Vector2I coords, bool updateSize)

Parameters

coords Vector2I
updateSize bool

SetCell(Vector2I, int, Vector2I?, int)

Sets the tile identifiers for the cell at coordinates coords. See SetCell(int, Vector2I, int, Vector2I?, int).

public void SetCell(Vector2I coords, int sourceId = -1, Vector2I? atlasCoords = null, int alternativeTile = -1)

Parameters

coords Vector2I
sourceId int
atlasCoords Vector2I?

If the parameter is null, then the default value is new Vector2I(-1, -1).

alternativeTile int

SetSize(Vector2I)

Sets the size of the pattern.

public void SetSize(Vector2I size)

Parameters

size Vector2I