2023-11-25 23:16:46 +00:00
|
|
|
tool
|
|
|
|
extends Node
|
|
|
|
class_name TK_TileMapTileDescriptor
|
|
|
|
|
|
|
|
export var texture: Texture setget _set_texture
|
|
|
|
|
|
|
|
# todo: More layer customizeability.
|
|
|
|
export var is_solid: bool
|
|
|
|
|
2023-12-25 12:29:53 +00:00
|
|
|
# todo: Update TileMapObject in editor when it's changed.
|
|
|
|
export var id: String = ""
|
|
|
|
|
|
|
|
# todo: Should work for non-grid objects.
|
2023-11-26 00:17:35 +00:00
|
|
|
func is_traversible_for(_p_game_object: Node2D) -> bool:
|
|
|
|
return not is_solid
|
|
|
|
|
2023-11-25 23:16:46 +00:00
|
|
|
func _set_texture(p_texture: Texture) -> void:
|
|
|
|
texture = p_texture
|
|
|
|
if is_inside_tree():
|
|
|
|
get_parent().change_tile_texture(name, p_texture)
|