(API) JujuMapper

  • plamzi
  • plamzi's Avatar Topic Author
  • Offline
  • Administrator
01 Dec 2013 20:21 - 20 Feb 2014 15:03 #1 by plamzi
(API) JujuMapper was created by plamzi
JujuMapper is a powerful visualization and navigation plugin for room-based worlds. Its vector graphics ensure that the map is sharp at any resolution and zoom level. Juju has a built-in editor with batch data upload support, as well as built-in path-finding & click-to-move.

EXAMPLE USE (minimal):
new JujuMapper();

If you have a relatively straightforward Euclidean world whose room data you can export, you can jump-start things by clicking "Edit" in the toolbar, then selecting "Upload":

Juju also supports incremental mapping via GMCP sent in the Aardwolf room.info format. This is also how it expects to get the current location from the server:
{"num":3001,"name":"The Temple Of Garathorm","zone":"Garathorm Inner City","terrain":"City","exits" {"n":3059,"e":3054,"s":3005,"w":3000}}

At this time, only cardinal and diagonal exits (ne, sw, etc.) are supported. Limited custom exit support may be added in the future, if there is any demand.

Unique room numbers are required at this time. You don't have to send the "actual" room number, but it needs to be unique in the grand scheme of things. It does not have to be a number--a unique string passed in the "num" parameter should work fine.

To add new rooms to the map, and to update existing, the edit mode has to be on.

If you don't want certain rooms to be mappable, you can send them without any exit info.

Setting terrain = "Inside" for a given room makes Juju generate shorter room links.

In edit mode, click on individual rooms to select them, or Ctrl+Click to select all visible rooms belonging to the same zone.

Players can tweak the map and save it to their own copy, leaving your official map intact.

With edit mode off, a click on any room to which there is a path should take the player there.

scale: 1.6
Defaut scale / zoom factor. If not set, the scale is 1.6.
width: 2000
Initial width of the world map coordinate system in (vector) pixels. Default value is 2000. The actual pixel width of the map will be width * scale, and the scale changes when users change the zoom factor. Also, note that the map canvas will auto-stretch based on computed coordinates for rooms.
height: 2000
Initial height of the world map coordinate system in (vector) pixels.
viewport: { css properties }
A set of default CSS properties, such as width and height, to be applied to the mapper window. The default value sets the width and height of the viewport window to 400x400.
process: function() { /* your custom data processing code */ }
If supplied, this will be the function used to intercept incoming location data from the server. The default processing function is a GMCP parser for the Aardwolf-style location object room.info.
listen: 'event name'
If supplied, this will be the event for which the processing function will listen. Default is 'gmcp'.
Last edit: 20 Feb 2014 15:03 by plamzi.
The topic has been locked.