Hello!
My name is Caelm, and I am going to teach you how you can scale
UIStrokesin these three easy steps! By using this tutorial, you can turn unintentional largeUIStrokeson smaller devices intoUIStrokesthat look exactly the same on different screens!
Step One
Open Explorer, and find
StarterGui. Add aScreenGuiintoStarterGui. You can name thisScreenGuiwhatever you want, but I’m going to name mineUIStrokeScaler.
Step Two
Inside your
ScreenGui, you want to add aLocalScript. You can name thisLocalScriptwhatever you want as well, but I am going to name mineMain.
Step Three
Open your
LocalScript, and replace any code that has already been written with the following code:
-- Made by @ItsCaelmYt
for i, v in pairs(script.Parent.Parent:GetDescendants()) do
if v:IsA("UIStroke") then
local BASE_SIZE = 1200
local uiStroke = v
local initialStrokeThickness = uiStroke.Thickness
local camera = game:GetService("Workspace").CurrentCamera
local function updateStrokeThickness()
uiStroke.Thickness = initialStrokeThickness * camera.ViewportSize.X / BASE_SIZE
end
camera:GetPropertyChangedSignal("ViewportSize"):Connect(updateStrokeThickness)
updateStrokeThickness()
end
end
This code will get the current device’s screen resolution, and re-calculate the any
UIStrokeinStarterGui, so that the UIStroke looks the same across all devices.
Additional Information
This will not scale
UIStrokeswhen not playing your experience in Studio. However, if you play your experience in Studio while emulating your device, theUIStrokeswill scale.
Sometimes, the
UIStrokesmay not be perfect, but improved.
If you have any questions, reply below! Thanks!

