Hello fellow programmers! Today I’m asking how to scale properly a Rect based on Screen size as I’m getting weird artifacts with a Rect in a smaller screen size and with that Rect fixed for smaller screen sizes, I’m getting a weird artifact for bigger sizes.
Fix for smaller sizes:
Fix for smaller sizes on bigger screen:
And the same thing viceversa, so that’s why I’m wondering what’s the formula to scale a Rect based on the absolute size of screen.
Tried with this formula but didn’t work
local ViewportRatio = self.OriginalViewportSize / Value
local RatioedRect = Rect.new(
self.OriginalRectSize.Min * ViewportRatio,
self.OriginalRectSize.Max * ViewportRatio
self.Instance.SliceCenter = RatioedRect
I would recommend using this
I don’t want to constraint the size, I want the slicecenter to be re-caculated based on the screen size or image absolute size
Bumping this topic as still haven’t found a formula