I’m trying to do some math to position elements and taking into account instances AbsolutePosition/Size to do so. However, these properties somehow get decimals. Unsure how you can have 0.325 of a pixel? I would have thought that sizing something based on the rounded number, however that isn’t the case either.
so does it just math.ceil the AbsoluteSize? How am I supposed to accurately size UI based on something else’s AbsoluteSize? Especially when if math.ceil can’t be used on all cases, as 184.041 is 184 pixels… what’s the cut off to round up or down on this?
If I were you, I wouldn’t worry about decimals. Whether it’s 1 pixel more or 1 pixel less, at this point, I don’t think people will notice the difference unless you’re creating a spritesheet. The interface shouldn’t appear distorted for less than one pixel, and if you’re a perfectionist, consider working with offsets and manually calculating resizing based on the player’s screen size instead. This way, having an AbsoluteSize with decimals will be impossible.
Using offset is your only solution, if you create your system accordingly it won’t be that much of a job. I do it for almost absolutely all my interfaces.
Read this answer, the second explanation may inspire you:
I wish you the best for your interface and your upcoming game!