2d map for pre8

All and any discussion and development of the Mudlet Mapper.
Post Reply
User avatar
Omit
Posts: 190
Joined: Sun Aug 01, 2010 10:54 pm
Location: Middle Earth
Contact:

2d map for pre8

Post by Omit »

Ok... I think I have done it...
done what? you say...
I have created a 2d map with labels (yeah I know you may have seen it but it's a lot more useful now)
It is generic enough to work with any mudlet map. (still untested by others... let me know)
The posted script only does the embedded 2d map.
The posted script only does the embedded 2d map.
If you would like to try it (and I would love it if you would).
2dmap.zip
extract, Import the xml and when it asks... point it to the gfx folder.
(25.05 KiB) Downloaded 609 times
IMPORTANT:
There a just a few functions you need to know.
Code: [show] | [select all] lua
--this creates/recreates/resizes the 2d map and returns the width and height of it
w,h =OcreateMap(maxWIDE,maxHIGH,cgrid)
--where maxWIDE is the maximum # of rooms that will display horizontal 
--where maxHIGH is the maximum # of rooms that will display vertically
--where cgrid is the size of each room in pixels

--this places the map and adjusts it
OmoveMap(x,y)
--where x,y is the distance from upper left hand corner of mudlets main window to the upper left hand corner of the map measured in pixels 

--in case you want to hide the map entirely
OhideMap()

--to display the map
OshowMap(RoomID)
You will need to call the OcreateMap and OmoveMap functions at least once before the map will display correctly (they can be called as many times as you like and they will resize the map however you specify)

Use the OshowMap function just as you would the centerview function.

User avatar
Vadi
Posts: 5035
Joined: Sat Mar 14, 2009 3:13 pm

Re: 2d map for pre8

Post by Vadi »

Damn, very well done. This could serve for easy prototyping of ideas for the 3D mapper as well.

User avatar
Heiko
Site Admin
Posts: 1548
Joined: Wed Mar 11, 2009 6:26 pm

Re: 2d map for pre8

Post by Heiko »

Very nice. Going to use this for my 2D mapper testing. The 2D widget is in the works, but not done yet.

Post Reply