How can i create a map like in the Royal Adventure game. Where i can move the map also zoomin,zoomout, And add some buildings and they’re upgradable also. Can anyone help me to fix the issue ?
This looks like Sprites (pngs) in Sprite Renderers.
There’s probably one background sprite (the grass and pavement)
Then more Sprite Renderers are added on top for the trees and buildings.
Start off simple
Only try to recreate the scene with your own sprites arranged in the scene. Don’t worry about buttons or adding new sprites. Once you’ve accomplished a decent looking scene, report back.
For sprites it could be fastest to use a free pack from the asset store.
Zooming
The camera is an orthographic camera, not a Perspective one.
The zooming is accomplished using the orthographicSize property on the camera.
Not sure, unless these are animated independently, I’d say it’s just a single background image. It seems like it’s been modeled in 3d, individual 3d parts plus 2d sprites put together in 3d as well, and then rendered to an image from a fixed angle.
The zooming can also be done by scaling the image. In that case, the unlock labels are child objects of that image so that they reposition with the image scale. But to avoid them becoming larger as well, the parent’s scale inverse is applied to each child. Eg if the parent scale is 2x then each child would be scaled 1/parentscale = 0.5
so that their relative size remains the same during zoom in/out.
Why would we rather zoom the image? Not sure, I think both ways seem fine and it may depend on details such as whichever solution provides a better scale animation with less aliasing or UI problems and such.
I found a way to pan and zoom the images using lean touch. And i use UI image component instead of sprite renderer, Its useful for an extend like pinch zoom and it scales the images and the buildings also. But the problem is i use the lean touch for image pan also. Now i had some issues like i can’t set a boundary for the image that i can able to scroll. Now i can drag and can go beyond the image. Is there any way to fix this ?