Texture Button: Draw focus StyleBoxTexture beneath others?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By rakkarage

how to make the focus draw below the button?
or how can i make a focus for this theme?
it must draw around both up and down buttons
in my case my up button has a different shape then the down button?
so the focus passes through the top and shadow on sides
is there some way to make it draw the focus below? or


anyone got some example textures? what is the normal workflow focus is supposed to be a transparent overlay image or what? thanks

rakkarage | 2020-04-01 18:18

:bust_in_silhouette: Reply From: njamster

You could add a script like this to your TextureButton:

extends TextureButton

func _on_TextureButton_button_down():
	texture_focused = load("<Path1>")

func _on_TextureButton_button_up():
	texture_focused = load("<Path2>")

Connect the callbacks to the button_down- and button_up-signals of the button and create one focus-image for the down-state (located under <Path1>) and another one for the up-state (located under <Path2>) . Problem solved?

I don’t think you can add custom scripts to a theme right?

rakkarage | 2020-04-02 16:44