0 votes

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)
Godot version 3.3.2
in Engine by (12 points)

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.