Table of Contents

Class TileSetScenesCollectionSource

Namespace
Godot
Assembly
GodotSharp.dll

When placed on a TileMap, tiles from TileSetScenesCollectionSource will automatically instantiate an associated scene at the cell's position in the TileMap.

Scenes are instantiated as children of the TileMap when it enters the tree. If you add/remove a scene tile in the TileMap that is already inside the tree, the TileMap will automatically instantiate/free the scene accordingly.

public class TileSetScenesCollectionSource : TileSetSource, IDisposable
Inheritance
TileSetScenesCollectionSource
Implements
Inherited Members

Constructors

TileSetScenesCollectionSource()

public TileSetScenesCollectionSource()

Methods

CreateSceneTile(PackedScene, int)

Creates a scene-based tile out of the given scene.

Returns a newly generated unique ID.

public int CreateSceneTile(PackedScene packedScene, int idOverride = -1)

Parameters

packedScene PackedScene
idOverride int

Returns

int

GetNextSceneTileId()

Returns the scene ID a following call to CreateSceneTile(PackedScene, int) would return.

public int GetNextSceneTileId()

Returns

int

GetSceneTileDisplayPlaceholder(int)

Returns whether the scene tile with id displays a placeholder in the editor.

public bool GetSceneTileDisplayPlaceholder(int id)

Parameters

id int

Returns

bool

GetSceneTileId(int)

Returns the scene tile ID of the scene tile at index.

public int GetSceneTileId(int index)

Parameters

index int

Returns

int

GetSceneTileScene(int)

Returns the PackedScene resource of scene tile with id.

public PackedScene GetSceneTileScene(int id)

Parameters

id int

Returns

PackedScene

GetSceneTilesCount()

Returns the number or scene tiles this TileSet source has.

public int GetSceneTilesCount()

Returns

int

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

HasSceneTileId(int)

Returns whether this TileSet source has a scene tile with id.

public bool HasSceneTileId(int id)

Parameters

id int

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

RemoveSceneTile(int)

Remove the scene tile with id.

public void RemoveSceneTile(int id)

Parameters

id int

SetSceneTileDisplayPlaceholder(int, bool)

Sets whether or not the scene tile with id should display a placeholder in the editor. This might be useful for scenes that are not visible.

public void SetSceneTileDisplayPlaceholder(int id, bool displayPlaceholder)

Parameters

id int
displayPlaceholder bool

SetSceneTileId(int, int)

Changes a scene tile's ID from id to newId. This will fail if there is already a tile with an ID equal to newId.

public void SetSceneTileId(int id, int newId)

Parameters

id int
newId int

SetSceneTileScene(int, PackedScene)

Assigns a PackedScene resource to the scene tile with id. This will fail if the scene does not extend CanvasItem, as positioning properties are needed to place the scene on the TileMap.

public void SetSceneTileScene(int id, PackedScene packedScene)

Parameters

id int
packedScene PackedScene