Calculate 9-Slice corner size

I’m making an ui for my game, and it has some other elements that need to be positioned to fit correctly. It works fine, by setting a pixel offset based on the screen size. The problem I’m having is, on smaller screen sizes, the 9-slice corners shrink, messing the offset up. How would I calculate the pixel size (or maybe scale, would also help) of the 9-slice corner?

1 Like

If the Ui shrink when you make the screen size smaller it could be because you set the size of the Ui based on the screens % Aka Udim2.new([X, 0], [Y, 0]). where X and Y are the size that you made them as. If you do not want the size of the Ui to shrink then just resize the Ui with the offset in the Udim

That’s not what I want to do. I want to calculate the size of the slices when they shrink due to the screen being too small to properly fit them.