Game's screen size set to Tilemap

Hey there,

First time using Defold. The idea is that the game will be played in portrait mode and that the screen’s width matches the tilemap’s width and that the height is navigable by the user scrolling up and down.
Is there a way to accomplish this?

Thank you

Yes, sure. First you need to decide on a reasonable size in game.project. Perhaps 640x1136. This will give you an aspect ratio similar to that of an iPhone. Next create a tilemap that covers this area. This will be enough to achieve what you want, but if you launch the game on a screen with a different aspect ratio you’ll notice some stretching of the graphics. This might be ok, but I’m guessing you wish to maintain the original aspect ratio. To accomplish this I’d recommend that you use a camera extension such as Defold-Orthographic or RenderCam. With these extension you’ll be able to set a fixed aspect ratio and also allow easy panning up and down your level.

4 Likes

Sorry for the late response and thank you!
It worked wonders.

1 Like