#Text Shifting From Edit to Play

1 messages · Page 1 of 1 (latest)

leaden crystal
#

How's it going, when ever I swap from edit to play the text shifts to the left constantly. I tried to mess with the anchor position and still is constantly moving.Some times when I press play it also doesn't shift at all.

Not sure if this is something with the scaling in the script or elsewhere

if guiObject:IsA("TextLabel") or guiObject:IsA("TextButton") then
    local parentGui = guiObject.Parent
    local xPixels = guiObject.AbsoluteSize.X
    local yPixels = guiObject.AbsoluteSize.Y
    local parentXPixels = parentGui.AbsoluteSize.X
    local parentYPixels = parentGui.AbsoluteSize.Y

    -- Scale the element size
    guiObject.Size = UDim2.new((xPixels / parentXPixels), 0, (yPixels / parentYPixels), 0)
woven phoenix
toxic leaf
#

you dont need to scale stuff in script you can just use scale instead of offset when position/sizing the ui elements

#

no scripts required at all to do that.

leaden crystal
#

Oh gotcha, I kept trying to figure out the offset/scale thing but im blind asf I couldn't find it

#

Oh yeah Im dumb, the background had an offset value, thank yall