- Home /
Best way to draw interactive 2d map
Hi all,
I want to show a 2d map (i.e. world map) which the user can scroll around and interact with the mouse. I'm quite new to Unity so wondering how to do this best?
Cheers, Martin
In the end I drew it in the GUI and used plain old DrawTexture for simplicity.
Answer by Wolfram · Aug 06, 2010 at 11:12 PM
If you restrain yourself from wanting to zoom in too far, you can simply apply the map as a texture (up to 4096x4096 if you increase the setting in the texture import settings) to a Unity Plane. Make that Plane face the Camera (you can use an orthographic camera if you don't use any "real" 3D objects). Then all you need is a script to navigate that map via click&drag, and maybe zoom in with right-click or similar.
If you want to zoom in more than what a 4k-texture can handle, you need to do something more complex and sophisticated, either by tiling several 4k-textures next to each other, or using a more intelligent LOD-approach, similar to Google Earth/Maps - I bet something like this already exists for Unity somewhere.
A significant number of GPUs in use won't go higher than 2048, so it's unlikely you want to use 4096 unless you're targeting specific hardware (namely, discrete graphics cards made within the last several years or so).
Answer by Lastowl · Aug 06, 2010 at 10:33 PM
when i was looking at the world maps and radars, photon's mmo example was quite useful to look at.
Your answer
Follow this Question
Related Questions
Unity 2D scrolling camera constantly 1 Answer
Assigning UV Map to model at runtime 0 Answers
Block based map generator 5 Answers