'm developing my game in Godot 4 and in my menu, I decided to add button selection using a cursor instead of clicking. After searching the entire internet, I still haven't found a way to implement my idea. I store my buttons in a "VBoxContainer". I found online only a way to create a cursor selection system for "Label" but not for "Button". Does anyone know how to implement my idea? Or is it only possible using "Label" selection?
For an example of the hierarchy in my project, I also tried adding a "Label" for the buttons and tried handling clicks from it, but it didn't work.
I would be very grateful for any help in solving my problem, including advice, tutorials, and courses! Thanks to everyone in advance!
*Note:
Screenshot, this is me trying to add a "Label" to select buttons, but it didn't work.
Link to the tutorial for creating pause buttons that I used -
Link to the tutorial for creating cursor selection like in RPGs - [upl-image-preview url=https://godotforums.org/assets/files/2024-08-15/1723705372-182821-screenshot-for-question.jpg]

  • kuligs2, Toxe, and Jesusemora replied to this.
  • Scel not looking at the videos, what you want is a thing at the side that selects an item like the skull in doom?

    a solution is to use godot's own system.

    1 - create a theme for your UI, the first Control can have this and all children will inherit from it.
    2 - create a button style, set the styleboxes to new texture style boxes or flat.
    3 - there is an option called focus, here you can create a stylebox with your cursor.

    4 - in inspector, set next and previous buttons to navigate between the buttons using the keyboard.

    Scel
    What have you tried?
    I assume nothing..
    Well, brother, let me suggest you something peculiar.
    For once you could create canvaslayer for the cursor you seek to move on about.
    Have a list of your buttons, or some way to iterate through them.
    Then you just set an action bidind for when you trigger "move_cursor" it gets the next button from the list, then it takes the position of the button and then it sets self.position to the button position with an offset you desire.
    Rinse and repeat, brother.

    Scel not looking at the videos, what you want is a thing at the side that selects an item like the skull in doom?

    a solution is to use godot's own system.

    1 - create a theme for your UI, the first Control can have this and all children will inherit from it.
    2 - create a button style, set the styleboxes to new texture style boxes or flat.
    3 - there is an option called focus, here you can create a stylebox with your cursor.

    4 - in inspector, set next and previous buttons to navigate between the buttons using the keyboard.