As a Roblox developer, creating and scripting good UIs is often made much longer and harder by the fact that we can’t offset our text properly.
Currently there are three text alignment options (for the X axis): left, center and right.
However, these options are limited on their own - left and right both are at the exact edge of the element. This means the background part of elements don’t have any padding, ruining the look.
To solve this currently, the text needs to be in a separate object and sized to {1,-paddingX},{,1,0}
and positioned to {0,paddingX},{0,0}
to get decent padding whilst retaining a good looking background.
This means not only does it use up time that could be used elsewhere, it also makes the job longer and more tedious for the programmer too.
The corresponding items are vertically opposite
To make left-oriented buttons, two objects must be created instead of the expected one.
Imagine this as a scripter:
local ShopButton = Gui:WaitForChild("Shop")
local ShopButtonLabel = ShopButton:WaitForChild("Text")
local InventoryButton = Gui:WaitForChild("Inventory")
local InventoryButtonLabel = InventoryButton:WaitForChild("Text")
local SpectateButton = Gui:WaitForChild("Spectate")
local SpectateButtonLabel = SpectateButton:WaitForChild("Text")
local SettingsButton = Gui:WaitForChild("Settings")
local SettingsButtonLabel = SettingsButton:WaitForChild("Text")
where it could be:
local ShopButton = Gui:WaitForChild("Shop")
local InventoryButton = Gui:WaitForChild("Inventory")
local SpectateButton = Gui:WaitForChild("Spectate")
local ShopButton = Gui:WaitForChild("Shop")
A better option in my opinion is, instead of creating a whole new frame, resizing, positioning, styling, and doing the same to all its new children, you could just set the offset of the text.