Hi! New to Defold and having a bit of a hard time understanding how the camera works. I’m making a game that’s 320x180 and then scaled up 4x to support 1280x720 resolution. I was able to set up my orthographic camera to scale the content at 4x zoom but it seems to have no effect on the GUI.
Here’s a screenshot of my camera at 1x and you’ll notice that the GUI isn’t affected at all.
Hi @britzl ! My camera works great now and I can easily scale at 4x including the gui, thank you so much!
I have one other problem though, there’s an offset in my gui (as seen in the screenshot) and it’s not anchored correctly. Is there an easy way to adjust the gui’s position/anchor points? Below is how my gui is laid out btw.
Ah, yes, I overlooked picking. There are two options: 1) Translate the mouse/touch positions based on camera matrix or 2) Change to applying the camera zoom as scale on a root node of the gui
Number 2 is much simpler. I’ve attached an updated example showing this method:
Thank you so much @britzl ! I got everything to work now.
One last question btw, I had to reposition my GUI and use 0, 0 as center in order for it to align with the world view. Is there anyway to set the GUI’s anchor to 0, 0 instead of having to use -160 and 90 (my game’s 320x180 btw)? Please see the screenshot below.
So I tried building an early HTML5 version and I noticed that if I upload to itch.io and set the resolution to 1280x720, my game gets cropped at the sides. I had to set it at 1320x760 to show the entire game screen. Is this really the case for HTML5 builds on Defold?