Sorry for late response
This simpler way
First Step:
Install Plugin
Trust me it saves a day and its free
Insert new frame into your frame with blackbackground
Set its:
Anchor Point to 0.5,0
Set Positon 0.5,0
BackgroundTransparency to 1
Size make to fit all elements – size must be in scale
Note: don’t do step down below to your frame with black background
Using plugin set all sizes and position of other UI Elements to Offset ,then move all to Created Frame,using plugin again sets back size and position to Scale
After you done set your Position on Frame with Black Background again to 0.5,0
Second Step:
use Add Constraint into Created Frame
Third Step:
Tag with “PxScale” those instance that don’t have TextScaled in your example should be Buttons with Text Easy,Normal,Hard
Then Insert Local Script into created frame:
task.wait(2) -- Adjust as you need
local CollectionService = game:GetService("CollectionService")
local PXScale = CollectionService:GetTagged("PxScale")
local frame = script.Parent
local Elements = {
TextBox = true,
TextLabel = true,
TextButton = true,
}
local function updateTextSizes(Table)
local textLabels = {} -- Store all text labels
local minSize = math.huge -- Start with a large value to find the smallest max text size
for _, child in ipairs(Table) do
if child:IsA("TextLabel") then
table.insert(textLabels, child)
end
end
for _, label in ipairs(textLabels) do
local size = 100 -- Start with a large size and decrease if needed
repeat
label.TextSize = size
size = size - 1
until label.TextFits or size <= 1
minSize = math.min(minSize, label.TextSize)
end
-- Apply the smallest max size to all labels to balance them
for _, label in ipairs(textLabels) do
label.TextSize = minSize
end
end
local SelectedGuiElements = {}
for _,Element in pairs(PXScale) do
if Elements[Element.ClassName] and Element:IsDescendantOf(frame) then
table.insert(SelectedGuiElements,Element)
end
end
updateTextSizes(SelectedGuiElements)
Simply what my script does is gets and applys smallest possible size that text fits of all Ui elements inside of frame with tag PxScale
i haven’t tested script yet but it should work
Text Size Changes will apply during the game not directly on studio
Adjust local size = 100
as you need!
Edit i tested script:
My PC screen:
-
Setup:
-
Studio:
-
In Game:
Xbox console emulator:
-
In game:
-
Studio: