UI elements change their position when resizing window

Hi,
does anybody know why my buttons are not fixed and are changing postition when I shrink the window?

I want this :

Instead I have this when I shrink :

This is because when the screen is resized, the UI system places the graphics relative to their anchor and pivot in screen space. It can be a bit complicated to wrap your head around it when you first start working with them, but it is very useful once you do. Check out this portion of the User Manual for help with dynamically sizes UI elements:

https://developer.playcanvas.com/en/user-manual/user-interface/elements/

You will have to fiddle with them quite a bit at first, but eventually it will come naturally to set anchors and pivots where you need them.

1 Like

Hi eproasim,
It seems that just changing element’s preset to center anchor & pivot will do the thing this time… :slight_smile: (and then figure out right position naturally) thanks for reply.

You can also check the settings of your screen component.

image

https://developer.playcanvas.com/en/user-manual/user-interface/screens/