Up to date

This page is up to date for Godot 4.2. If you still find outdated information, please open an issue.

TileSetScenesCollectionSource

Inherits: TileSetSource < Resource < RefCounted < Object

Exposes a set of scenes as tiles for a TileSet resource.

Description

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.

Methods

int

create_scene_tile ( PackedScene packed_scene, int id_override=-1 )

int

get_next_scene_tile_id ( ) const

bool

get_scene_tile_display_placeholder ( int id ) const

int

get_scene_tile_id ( int index )

PackedScene

get_scene_tile_scene ( int id ) const

int

get_scene_tiles_count ( )

bool

has_scene_tile_id ( int id )

void

remove_scene_tile ( int id )

void

set_scene_tile_display_placeholder ( int id, bool display_placeholder )

void

set_scene_tile_id ( int id, int new_id )

void

set_scene_tile_scene ( int id, PackedScene packed_scene )


Method Descriptions

int create_scene_tile ( PackedScene packed_scene, int id_override=-1 )

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

Returns a newly generated unique ID.