This site is currently in read-only mode during migration to a new platform.
You cannot post questions, answers or comments, as they would be lost during the migration otherwise.
0 votes

Button0.pngButton1.pngButton2.pngButton3.png
focus.gif

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

thanks!

in Engine by (1,975 points)
edited by

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

1 Answer

+1 vote

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?

by (10,634 points)

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

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 Frequently asked questions and 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 [email protected] with your username.