Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | GiantIsopod | |
Old Version | Published before Godot 3 was released. |
I’ve created a menu for my game and I’m using TextureButtons for the different choices. I want the player to be able to select the button either by clicking on the buttons with their mouse or by using the arrow keys, and therefore would like the buttons to show a different sprite when being selected. So the button on the left would have the “selected” texture when the left arrow key was pressed, and the right button would have the texture when the right arrow key is pressed. I’ve tried using get_focused_texture, but either it doesn’t do what I want it to do or I just don’t understand how it works (either is possible).
A sample of my code from the Yes Button on the left:
if popupvisible == "true":
if event.is_action_pressed("move_left"):
yeshover = "true"
nohover = "false"
if yeshover == "true":
get_focused_texture()
Thank you ahead of time for any help.