The game’s content looks far too small on mobile and I don’t know why this is happening. I have the “High DPI” setting enabled in the game.project file and it seems to do nothing.
I’m also using the Orthographic Camera asset. Its projection is set to FIXED_ZOOM and set to a zoom level of 2 in all cases.
I’d like all the assets to look twice as big as they currently are. What can I do?
Hey, Sorry upfront that I do not have an answer for you. But I do have a question for you. I see your game uses slopes. Is that a custom platform engine or are you using something like platypus?
The ground collision uses a raycast to check below the player. If the raycast collides with ground, the player’s position is set to the raycast hit position (at an offset). The raycast fires down a little further than where the player’s feet are so that it works on slopes.
I used to use Platypus, but it had issues so I replaced it with this system.
This works fine for my game since there’s no jump button. But if I added jumping I’d have to modify it a bit, maybe by disabling the raycast while moving upwards.
Each pixel is 2x2 pixels wide, which is what I expect from a fixed zoom with level 2. The same is true of the desktop/HTML5 build. They both apply the correct zoom as expected. The difference is the pixel density and physical screen size. Your mobile phone probably has a much higher pixel density and it most definitely has a smaller physics screen size. This will obviously make everything look smaller.
I decided to use a naive solution for now, checking if the window height is greater than 1000. If this is true when the game starts, set zoom to 4, else set zoom to 2.
This seems to work fine on an iPhone XR and iPad Pro (2018), but it would take an extraordinary amount of time to test on all devices and I can’t guarantee that this is a universal solution. I’m open to more ideas.