Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | gladion136 |
Hey i want to add the Tile Symbol to a TextureButton.
Is it possible to get the Symbol from a TileSet?
Here is my current implementation (currently I use the normal map option to store a alternativ symbol, but I want to change this way…)
var new_btn = TextureButton.new()
var txr = tileset.tile_get_texture(cell)
var atlas_txr = AtlasTexture.new()
atlas_txr.atlas = txr
if tileset.tile_get_tile_mode(cell) == tileset.SINGLE_TILE:
atlas_txr.region = tileset.tile_get_region(cell)
new_btn.texture_normal = atlas_txr
else:
# I want to change this line:
new_btn.texture_normal = tileset.tile_get_normal_map(cell)
new_btn.connect("pressed", self, "select_tile", [cell])
tile_container.add_child(new_btn)