- Edited
How to change the icon to a TuochScreenButton through GDscript.Thanks Iv_Ma
How to change the icon to a TuochScreenButton through GDscript.Thanks Iv_Ma
Is the respective icon part of the buttons own texture or is it a child object?Easiest in my opinion is likely to have the icons each be individual children(of the button, children are drawn on top of the parent), and show/hide them according to the buttons state.However if you want to change the textures of the button itself, there's the set/get texture methods.[center]TouchScreenButton :: From the [url=http://docs.godotengine.org/en/latest/classes/class_touchscreenbutton.html?highlight=touchscreenbutton]Documentation[/url]:[table][tr][td]void[/td][td]set_texture ( Object texture )[/td][/tr][tr][td]Object[/td][td]get_texture ( ) const[/td][/tr][tr][td]void[/td][td]set_texture_pressed ( Object texture_pressed )[/td][/tr][tr][td]Object[/td][td]get_texture_pressed ( ) const[/td][/tr][tr][td]void[/td][td]set_bitmask ( Object bitmask )[/td][/tr][tr][td]Object[/td][td]get_bitmask ( ) const[/td][/tr][/table][/center]BTW it would be easier to give concise help if you were more specific about how you are trying to solve the problem you have, and what the problem you have exactly/explicitly is... :)
Thanks, I solved so[code]var texture=load("res://icon.png")func _ready(): # Called every time the node is added to the scene. # Initialization here get_node("TouchScreenButton").set_texture(texture)[/code]