More control over GuiService.SelectedObject customization

Hi guys,

So for my menu I want to make my gui expand its icons when they become selected, instead of adding a selection box overlay.

At the moment, I don’t think this is possible on controllers, but I wanted to ask the community first and if nobody has anything I’ll make a feature request.

Here’s an exaple of what I’d like my gui to sort of resemble:

https://gyazo.com/efde43fed90b3a38b543d42e8d09e254.gif

https://gyazo.com/c0a3e34c7b0d27a58a8143fa0617e3de.gif

Here is my actual gui working as intended with a mouse cursor:
https://gyazo.com/a30360c54c5bd224a5691bd6ecb28da2.gif

Obviously you wouldn’t usually see that selection box right there but I was in a testing server and didn’t feel like taking it out.

I would just bind each button to a guiService event that fires whenever the SelectedObject changes, but unfortunately there is no such event, so the only way I could think to do it now would be using a costly while loop.

If anyone knows of any clever ways of making XBOX guis better, let me know, I’m all ears :slight_smile:

Thanks,
-big

2 Likes

Perhaps just do what you are doing now but change the z-index so the selected item is on top of the rest.
Nice UI btw.

Have you tried GetPropertyChangedSignal(“SelectedObject”)?

Moreover, this might be more appropriate:
https://developer.roblox.com/api-reference/event/GuiObject/SelectionGained
https://developer.roblox.com/api-reference/event/GuiObject/SelectionLost

5 Likes

Like buildthomas pointed out, you are suppose to use SelectionGained and SelectionLost for game pads. Likewise, use SelectionImage to replace bounding boxes on UI elements.

I’m not sure why I didn’t think of this haha, I use it all the time for frames and their visibility property. SelectionGained and SelectionLost seem to have done the trick, thanks!