How do you set component position (X and Y) such as buttons, slider, textbox, etc?


As you can see here, on my phone the GUI looks fine. However on my tablet, the textbox is heavily offsetted,

image
What I tried to do is to set the X and Y image using screen height/width divided by a specific number. But even that, it doesn't work

Also, horizontal and vertical alignment aren't a solution (technically they are, but that means I have to change all sprite's Y location to another number, and I have like 10 of them), because my canvas size is 100% on both height, and width.

You do not say where these visual elements are. Are they all in a canvas, so you are using imagesprties to contain all the "button" images and controls ?

What do you expect with your tablet, will it be held/set in portrait mode, or do you also want a landscape view ?

Perhaps provide an example aia with the view and components shown above?

the image sprites work fine (I used screen height/width divided by specific number) and it works like a charm. However when I tried that on the other component, it doesn't work (component's parent is screen)

TEST.aia (2.3 KB)

Here the very basics of aligning a button:

image

Place button in an arrangement, then add two labels, one either side. Set the widths of one or both of the labels (perhaps with percentages) to position your button. You can base the positioning on the screen width / height as required for different screen sizes.

In the image above I have a vertical arrangement (blue) that then contains a horizontal arrangement (orange), which in turn contains two labels (green) and a button. Both labels are set to fill parent, which centres the button.

Ensure your project sizing is set to Responsive, unless you really need to use Fixed for some other purpose.

Thanks!