How to make it so that GUI objects don't scale with their parent but the screen itself

Couldn’t you just make the frame as big as the screen then?

Textlabel cutoff,

How would a text label even be cutoff? What is “cutting it off?”

ClipDescendants ,

So you mean like you want the children to size more than the parent?

Sort of, but not exactly. Read my latter posts.

Oh so you mean you like want a cut off design of a text slowly showing/extending on the left and right axis similar to a scroll but on both directions without changine the size of the text as its static and you want it to appear? You would need to script and clip descendants if that the case, use the custom shaped bar script for this.

And im pretty sure I understand your question lol, just search up custom healthbar and how they work and use anchorpoint .5 .5

Well Idk why others dont understand it well lol

Can you send a screenshot/video?

https://www.google.com/search?q=scroll+animation&tbm=isch&chips=q:scroll+animation,g_1:unrolling:mdzysHvfwPo%3D&client=ms-android-samsung-ga-rev1&prmd=ivsn&hl=en-US&sa=X&ved=2ahUKEwiEtL3SkKvrAhUB9pQKHV5lA6EQ4lYoAXoECAEQDA&biw=360&bih=572#imgrc=-sDfe7Dy3JlI0M

I think he means this but imagine theres a text on the scroll

Yes, this is exactly it. Thank you for understanding

1 Like

Can you provide me a method/script

1 Like

Look at this article its similar to what you want, just use anchorpoint .5,0, and take a look at the script indicated. Although I think your gonna have to use an Image label instead of a text.

If you directly set the size of both with Offset this problem is trivial, so I’m guessing you don’t want that.

One way to do it without scripting

  1. Set the size of the frame to whatever
  2. (edit) set ClipsDescendants on the frame to true
  3. Set the label’s AnchorPoint to 0.5, 0.5
  4. (edit) set the label’s Position to 0.5, 0.5
  5. Set the label’s SizeConstraint to RelativeYY
  6. Set the frame’s Size to whatever. Note that the X scale is going to be a percentage of the height of the parent (i.e. a child size of {4, 0}, {1, 0} means “fill the height of the container, and then four times wider than the height”
2 Likes

i don’t want to use an image label

1 Like

Is this something you want to achieve?

If it is then here is the code

Code
local player = game.Players.LocalPlayer
local playerGui = player:WaitForChild("PlayerGui")
-- screen gui
local screenGui = Instance.new("ScreenGui", playerGui)
-- frame
local frame = Instance.new("Frame", screenGui)
frame.Size = UDim2.new(0.5,0,0.2,0)
frame.Position = UDim2.new(0.25,0,0.3,0)
frame.BackgroundTransparency = 0.5
frame.ClipsDescendants = true
-- text label
local text = Instance.new("TextLabel", frame)
text.Size = UDim2.new(1,0,1,0)
text.Position = UDim2.new(0,0,0,0)
frame.BackgroundTransparency = 1
text.Text = "HELLO!"
text.TextSize = 60

-- determine scaling
local scaleUp = false

while wait(0.1) do
	if scaleUp and frame.Size.X.Scale < 0.5 then
		frame.Size = frame.Size + UDim2.new(0.02,0,0,0)
	end
	if not scaleUp and frame.Size.X.Scale > 0.02 then
		frame.Size = frame.Size - UDim2.new(0.02,0,0,0)
	end
	frame.Position = UDim2.new((1 - frame.Size.X.Scale) / 2, 0, 0.3, 0)
	text.Size = UDim2.new(0.5/frame.Size.X.Scale,0,1,0)
	text.Position = UDim2.new((0 - ((frame.Position.X.Scale * text.Size.X.Scale) - 0.25)),0,0,0)
	if frame.Size.X.Scale >= 0.5 then
		scaleUp = false
	end
	if frame.Size.X.Scale <= 0.02 then
		scaleUp = true
	end
end

I’m not sure if this is the best approach but this works. Just play around with the size to match your needs.

Hope this helps!

3 Likes

Yes ,

Make sure to mark solution if it solved your problem

Okay,

Hello! For first set Frame’s property named ClipDescenants to true.
Now i know 2 ways:

  1. (Easy way) You can just change TextLabel’s size too.

  2. (Hard way) Use scale first and then convert scale to offest, so after loading the TextLabel will increase to the desired size, and then the size of the parent will not affect it in any way.

I hope i helped you after 3 years =))))