make each tile have custom data when placing them #11779
FowluhhDev
started this conversation in
2D
Replies: 1 comment
-
You could accomplish something similar with a Dictionary that maps between Vector2i and something else: var tile_data: Dictionary[Vector3i, String]
func place_tile(layer: int, coords: Vector2i, source_id: int, atlas_coords: Vector2i, custom_data: String) -> void:
set_cell(layer, coords, source_id, atlas_coords)
tile_data[Vector3i(atlas_coords.x, atlas_coords.y, layer)] = custom_data
func get_tile_data(layer: int, coords: Vector2i) -> String:
return tile_data[Vector3i(atlas_coords.x, atlas_coords.y, layer)] |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
basically just add the ability for unique custom data when placing a tile, not in the tileset but have multiple data values of the same tile, like say for example change the color of a specific tile through code with a new function that has a format of something like
TileMapLayer.set_cell_data(layer: int, tile_location: Vector2i, target_data: StringName, value: Variant)
Beta Was this translation helpful? Give feedback.
All reactions