How to get y or x offset or scale?

i just need it so i can add everything up

1 Like

Can you tell us what are you trying to get X or Y offset for?

so i can add 5 or subtract 5 to the ui’s position

For the ScreenGUIs or other GUI objects under the ScreenGUI?

an image label to add or subtract its y or x offset or scale

You can get the size of the ImageLabel with ImageLabel.Size and position of it with ImageLabel.Position. Both of these return an UDim2 value so in order to change them you have to either use UDim2.new(XScale,XOffset,YScale,YOffset) constructor or you can directly edit the scale and offset of each axis by ImageLabel.Position.X(or .Y depending on which one you trying to edit) followed by = UDim.new(Scale,Offset).

2 Likes

so Button.Position.Y.Offset ?

1 Like

Yes, in that case you can just put a number there instead of dealing with UDim.

adding the size in scale doesnt seem to work

should i divide it or multiply

or how do i stop the bar from escaping its parent

What do you mean exactly by “bar escaping its parent”?

for example bar is larger than its parent by width

I need to know what are you trying to do here by scaling and moving the ImageLabel because I actually have no idea if you’re trying to put this in a script or you’re trying to scale it on studio by playing around the properties of the label without using the 3D Viewport to scale it.

I believe this should go in #help-and-feedback:art-design-support, if not you need to give us more information on what you need help with.

for example, an ImageLabel
local yScale = ImageLabel.Position.Y.Scale
or
local yScale = ImageLabel.Size.Y.Scale
its the same for offset probably

4 Likes