Detecting user device for topbar issue

Fisrt, you should check this out

제목 없음
PC - Distance between topbar icons : 12

mobile
Mobile - Distance between topbar icons : 4 (actually, 6)

xbox
Console - NO TOPBAR ICONS OMG

Well, as seen above, due to the problem of different topbar icons depending on the user’s device, a different UI must be shown depending on the user’s device.

The setting button on the right is a button I created.
Check ‘UserInputDevice.TouchEnabled’ and if it’s true i change it’s position to 6 pixel

However, there may be users who use PCs with touch-capable monitors, and above all, a different UI must be shown to console users. I can’t ignore a Bluetooth keyboard and mouse connected to the console, and I can’t ignore a gamepad connected to a PC either.

Instead of checking TouchEnabled and GamepadEnabled, I need another way to check the user’s device.

1 Like

GuiService.TopbarInset might be of interest to you. It returns a rect that includes the entire topbar.

GuiService = game:GetService("GuiService")
GuiService.TopbarInset.Height -- Returns the height of the topbar
1 Like

Thank you very much! This answer was very helpful.
I even completly forgot about the GuiService.

anyway the ‘GuiService.TopbarInset’ needs ‘wait’ or ‘GetPropertyChangedSignal’ to use.

Even while studying this I discovered the ‘:IsTenFootInterface()’ function, which is the most reliable way to check if the player is on the console.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.