I have a question about the camera projections and game screen size. I am using defold orthographic camera asset and have set my game window as 720 x 1280 in the game.project display settings.
To visualize this size in the editor, I always add a gui_node so that I can see the boundaries of my screen. I then placed 2 tiles at the top left and at the bottom right like so:
I am using FIXED_ZOOM projection with a zoom of 1.
I expect the game to open and play in a 720 x 1280 window and see my objects placed exactly where I placed them in the editor, but that does not appear to be the case
if I use FIXED_AUTO projection, the window looks like this:
the tiles are still not in the right positions and the blue tower should not be visible
The camera gameobject position is at the centre of the screen i.e. 360 x 640
Understanding this will really help me in my level design as I design a map in Tiled according to my display resolution but when I import it into Defold, the map does not look like it does in Tiled due to the above reasons.
It doesn’t look like the aspect ratio of the window is correct. In the screenshot it looks like the window is much wider. Does the window fill the entire screen or do you have room below the window?
Ok, so your screen is unable to show a 1280 pixel high window, but it can fit 720 horizontally. This means that you will have a different aspect ratio, which explains why you are seeing more content to the left and right.
With this resolution, I have lots of space on my screen and it still comes out like this.
Would appreciate some help in understanding this .
With these changes, I expect the game to open and play in a 360x 640 window and see my objects placed exactly where I placed them in the editor, but that does not appear to be the case
Not exactly, but you have moved your camera to the wrong position. Your camera game object is positioned at x: 159, y: 260, which is not the center of the GUI (360x640).
If you set the position to the center(180x320), it will look correct.
thanks for this, as this got me to test my project on another machine.
So, whats strange is that when I open this project on my msi laptop, screen resolution: 1920 x 1080, then this look normal and as expected, and moving the camera to the correct position gives me the game window as your screenshot.
but when I open the same project on my surface pro, screen resolution: 2736 x 1824, then the game window looks like the very zoomed out version from my earlier screenshots.
this was driving me nuts and was very near to giving up on defold and move back to unity for my side project.
is this an engine bug? should I report it on github? what other info would be required for the report in addition to my game project?
and how do I fix the view on my surface pro to look normal and not super zoomed out?
My guess is that your surface pro has something similar to the Apple retina screen where a pixel actual consist of four smaller pixels. When you say “super zoomed out” I assume you see exactly twice as much content. Is my assumption correct?
Ok, thanks. Defold-Orthographic should try to figure this out and handle it correctly. Could you please create a bug report in the repository and I’ll make sure to look into it this weekend?