abstract classafFantomMappy::Viewer

sys::Obj
  afFantomMappy::Viewer

@Js

Renders a MappyMap or a Layer (dependent on the implementation) to the screen. By default the map is rendered to the top left hand corner of the screen as shown below:

+------------------+---------+
|                  |         |
| Fan Mappy Viewer |         |
|                  |         |
|                  |         |
+------------------+         |
|                            |
| Screen                     |
|                            |
+----------------------------+ 

(A Viewer with a width and height smaller than the screen)

However, you can move the viewing area around the screen by specifying an X and Y view offset as shown below:

+----------------------------+
| Screen                     |
|    +------------------+    |
|    |                  |    |
|    | Fan Mappy Viewer |    |
|    |                  |    |
|    |                  |    |
|    +------------------+    |
|                            |
+----------------------------+ 

(The same Viewer with an X and Y view offset)

coorInBlocks

Source

virtual Point coorInBlocks

coorInPixels

Source

virtual Point coorInPixels := Point.defVal

draw

Source

abstract Void draw(Obj gfx, BlockLayer[] blockLayers := ...)

Draws Mappy data into the viewing area. gfx is object specific to the Renderer

drawPartial

Source

abstract Void drawPartial(Obj gfx, Rect dirty, BlockLayer[] blockLayers := ...)

Draws but just a section of the viewing area. To be used when you do not need to render the whole screen, but just part of it.

make

Source

new make(MapHeader mapHeader, Renderer renderer, Rect viewBounds)

Creates a Viewer.

mapHeader

Source

MapHeader mapHeader { private set }

pillarRiserMode

Source

virtual Bool pillarRiserMode := false

renderer

Source

Renderer renderer { private set }

translateBlocks

Source

virtual Void translateBlocks(Int x, Int y)

add call backs for clipping

translatePixels

Source

virtual Void translatePixels(Int x, Int y)

add call backs for clipping

viewBounds

Source

const Rect viewBounds