x


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

more ▼

asked Aug 06 '10 at 08:52 PM

_MGB_ gravatar image

_MGB_
678 4 7 16

In the end I drew it in the GUI and used plain old DrawTexture for simplicity.

Feb 02 '11 at 11:26 AM _MGB_
(comments are locked)
10|3000 characters needed characters left

2 answers: sort voted first

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.

more ▼

answered Aug 06 '10 at 11:12 PM

Wolfram gravatar image

Wolfram
9k 8 20 52

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).

Aug 07 '10 at 12:32 AM Eric5h5
(comments are locked)
10|3000 characters needed characters left

when i was looking at the world maps and radars, photon's mmo example was quite useful to look at.

more ▼

answered Aug 06 '10 at 10:33 PM

Lastowl gravatar image

Lastowl
16

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x1036
x198
x56

asked: Aug 06 '10 at 08:52 PM

Seen: 2589 times

Last Updated: Aug 06 '10 at 08:52 PM