I’m working my way through trying to create a menu with Keyboard/Gamepad navigation.
One of the important items is highlighting the currently selected menu option.
This seems like it would be easy, so I tested this with a single text object first.
- Create an event “When Selector is in collision with Start Text” "Change Color to “255;0;0”
- Create an event “(Inverted) When Selector is in collision with Start Text” "Change Color to “255;255;255”
- Add “Trigger Once” to both events.
The above works just fine for the first option.
(Start Text selected)
(Start Text not selected)
(Going back to Start Text again highlights it)
However, when I target the group of objects (MenuGroup) that contains both “Start Text” and “Options”, the above does not work after changing all instances of “Start Text” to “MenuGroup”
After making the above tweaks, upon initial load the “Start Text” object will be highlighted. Switching options will set start text back to white, but will not make “Options Text” object red. Additionally, going back to “Start Text” object does not make it turn red again.
If I remove the “Trigger Once” it works, but then every single menu option is being checked every single time, which seems like it reduces any effeciencies gained.
Additionally, this isn’t just collision detection related. I can use “If X/Y position is in MenuGroup.X()/Y()” with the same results if I use Trigger once. Even using variables doesn’t seem to work unless I remove Trigger Once. I tried making it so the collision/position events just set an object variable to 1/0, and then change the color of all group members based on whether that object variable was 1 or 0, but it has the same behavior.
I’ve also tried a “For Each”, but that also doesn’t work unless I remove all trigger once.
Is something broken about Groups? Am I misunderstanding and they aren’t intended for any collision based events?