Multi resolution support


This is regarding the UI system in playcanvas. How can we make our game UI responsive i.e. set our UI according to an aspect ratio so that it can adjust according to the screen size and orientation. Is there a way to do this without using css?

If CSS is not your option (although it provides all the functionality to do exactly what you are asking), then you could make UI using 3D objects.
There is 2D API in development right now, we do not have ETA on it, but it is actively developed. It will allow to make true 3D UI.

Eagerly waiting for that solution to come up. Playcanvas really needs one!

I have been facing an issue with the ‘sprite’ script as well. It is the same script that you guys have used in your swoop project. My sprites dont look crisp and clear with this script. Moreover , I see artifacts in the rectangle edges of the texture. I am attaching a few screenshots.

And Please check in this screenshot of a texture settings in swoop, you guys have a ‘Compression’ settings applied to every texture but I fail to see any such setting in my project’s textures. Can this be the reason behind this alpha problem in my project?


That looks like a texture clamping/wrapping issue. On the Texture settings, change ‘Repeat’ to ‘Clamp’

1 Like

Yeah that did the trick! Thanks!
I still face the issue of my graphics not looking very crisp on mobile devices. They look fine on the PC but looks really pixelated on mobile. Any idea ?

Can you provide a screenshot on mobile and PC please?

My guess is that the sprite is quite low resolution compared to the resolution of the phone. You can try switching the filtering on the texture to be ‘point’ and see if that is better for you? You may see pixelation instead though.

You could also try enabling Device Pixel Ratio in the Scene Settings.

1 Like

Thanks guys, I see a lot better visuals now. But still in desperate need of a well defined UI system. Cannot do sooo many things at the moment.

1 Like

I know it’s been a long wait @reaper235 - we’ve been trying to get our initial UI solution out for quite some time now. We are just going through a final polish and review phase which should take a couple of weeks. Please bear with us - you don’t have to much longer to wait.

Im sure it will be worth the wait! :smiley:
Btw @will , please look into this concern as well, it is really urgent at the moment :

The spites library does a pretty good job of most basic UI needs such as anchoring to a corner/center and buttons:

yeah thats the issue , its basic. It cannot be easily tweened, cant be rotated, no event listeners as such, not a proper way of scaling,depth is just for visibility , the buttons behind a UI element can also be clicked. Id say most of the basic things are missing. Currently it is only for rendering purposes. However I have made my own version of generic classes for tweening, buttons, progress bar a few more. Will upload them soon for public use.