Help with scaling SurfaceGUI relevant to an UI

In the video below, I have my drawing system replicating it to the to surfacegui board, and that is the best sizing I can try to get, I need to make it look decently accurate, how can I do this?

They’d both need to use the same aspect ratio for the best results, so the ratio between the X and Y resolution of each need to match.

The ScreenGui appears to be wider than the SurfaceGui.

GUIs are scaled using the UDim2 | Roblox Creator Documentation parameters.

You shouldn’t make extra threads. This could have been asked on your previous post.

How can I get them accurate size? Everything I do they are off

Lets say you have a surface gui with the size 800x600 (you can set this by changing the SurfaceGui’s SizingMode to FixedSize)

Your PlayerGui’s frame should also be 800x600 (0, 800, 0, 600) (or a multiple of it, just make sure to work backwards from the multiple when drawing it onto the surface gui)

So with a multiple 2, position 802, 304 on the ScreenGui would be mapped to 401, 152 on the SurfaceGui

1 Like

Incase you want the ScreenUI to scale and you need to get the size in pixels, then you would use the AbsoluteSize property, and whatever math from there to get it to your preferred size.

Oh so you mean something like this?

local function MapPositionRelatively(positionOnGui)
  local AbsSize = ScreenGui.AbsoluteSize

  local XPos = (positionOnGui.X.Offset / AbsSize.X) * AbsSize.X
  local YPos = (positionOnGui.Y.Offset / AbsSize.Y) * AbsSize.Y

  return UDim2.fromOffset(XPos, YPos)

either works /shrug

1 Like

Thank you to both @metatablecatmaid and @PuffoThePufferfish so much, thanks for explaining well, have a great night/day