Mapper Zoom Level

Post Reply
Drevarr
Posts: 43
Joined: Tue Aug 06, 2013 12:07 am
Location: GA, USA

Mapper Zoom Level

Post by Drevarr »

Is there a way to capture the current zoom level of the mapper? I'd like to capture a selection of zoom levels and then use them in preset zoom buttons for my radar map thing.

Image



Drevarr

User avatar
SlySven
Posts: 1023
Joined: Mon Mar 04, 2013 3:40 pm
Location: Deepest Wiltshire, UK
Discord: SlySven#2703

Re: Mapper Zoom Level

Post by SlySven »

No, there are two lua commands related to this:
  • setMapperView((float)x, (float)y, (float)z, (float)zoom) - which is NOT implemented internally {developer note: TMap::setView(x, y, z, zoom) is a dummy, it was nuked by Heiko in "git update to Mudlet-1.2.0-pre4" on 24 Aug 2010}
  • setMapZoom((int) zoom) - which sets the zoom of the 2D mapper only
There is currently NO getter to obtain the zoom level.

I did code a prototype for this sort of thing recently and tried to implement:
  • getCurrentPlayerRoomId() - returns Mudlet's idea of where the player currently is (the "Red" room!)
  • setCurrentPlayerRoomId((int) roomId) - unlike centerview() does NOT scroll the map to the given room
  • getViewCenterCoordinates() - returns 5 values:
    • 2 0r 3 - whether the map is currently showing the 2 or 3D map
    • x
    • y
    • z coordinates at the CENTER of the map (for the 3D map the centre of what the camera is AIMED at, not where the camera is!)
    • areaId - which area is being displayed - without which the coordinates aren't much use!
  • setViewCenterCoordinates((int)x,(int)y,(int)z) - moves the centre of the map to the given coordinates.
  • getGridMode((int)areaId) - already noted as being missing, simple returns true or false for the given area.
Would any of these be useful to you?

I came to a bit of a stop on this though, because I tried to rationalise the 3D mapper controls which though having four sliders labelled as a scale and three rotations are not... However, I think that I might be able to salvage most of the working stuff from that - add the zoom getting command you want and roll something out - but there are a few other things on my To-Do list that have a urgent against them. :(

tl;dr;

No - not yet! :oops:

Drevarr
Posts: 43
Joined: Tue Aug 06, 2013 12:07 am
Location: GA, USA

Re: Mapper Zoom Level

Post by Drevarr »

I like to prototype functions. Look forward to seeing those rollout.

Post Reply