As a developer, it’s annoying to read and to write simple, frequently-used UDim and UDim2 structures. I want constants to represent these common structures.
UDim2 UDim2.zero --- UDim2.new(0, 0, 0, 0)
UDim2 UDim2.one --- UDim2.new(1, 0, 1, 0)
UDim2 UDim2.x --- UDim2.new(1, 0, 0, 0)
UDim2 UDim2.y --- UDim2.new(0, 0, 1, 0)
UDim UDim.zero --- UDim.new(0, 0)
UDim UDim.one --- UDim.new(1, 0)
But Sharksie, won’t it be confusing that the “one” value has offset 0?
No, because zero/one constants are useful for scalar properties. They aren’t useful for nominal properties like offset. No one will write UDim2.one expecting to get 1, 1, 1, 1
because that would be useless.