[SOLVED] 2D Screen + UI elements

Hi guys, for first time im trying to play with UI in playCanvas, i have made finish level screen but im looking for addapting my GUI to any screen it is playing on. I tried to play on Laptop it works fine, either on mobile phone, but once i try to LandScape i cant see some of image elements. I would like to resize those elements dependes on screen size, is it possible in default properties somewhere or i have to code? Thanks.

Laptop finish screen:

Landscape finish screen:

As you can see on the picture, only play button is having the stick position on screen.

here are properties for my stars being covered:

Hi @smokys,

So you can use the Screen Scale Blend parameter to set the scaling behavior of your screen based on the width or the height of your reference resolution.

image

That will help you up to a point, though if you would like to perfectly accommodate different resolutions and aspect rations you may have to code some logic that changes those values depending on the screen size.

https://developer.playcanvas.com/en/api/pc.ScreenComponent.html#scaleBlend

3 Likes

Thank you i was struggling a bit cause i could not find it, but then i clicked on 2D screen :stuck_out_tongue: thank you its working as i wished.

2 Likes