Zoom / automatic sizing of world map

Hi,

I’m new to Defold but I would like to develop a game using this game engine.
I tried to find some information how works the view resizing / zoom inside Defold. Let me explain my goal.

When game is launched I have a simple colored background view with the game splash screen/image displayed and a loading bar (for loading additional assets and network things…later on).
Once done, I should arrive at my MAIN map view where the game take place.
However the world map can be larger than the default viewport /default profile (2048*1024) on mobile.

How can I start the game with a default scale factor (e.g. 1) but allow the user to zoom in/out using 2 fingers until zoom in / out reachs the max or min or the world map ?

Is there any documentation / tutorial about this topic ?
thx

I would suggest you look at some modules that should make your life much easier.

For the camera (zoom in/out):

For the input:

This is also a small goldmine of examples:

https://britzl.github.io/publicexamples/

1 Like