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
virtual Point coorInBlocks- coorInPixels
virtual Point coorInPixels := Point.defVal- draw
abstract Void draw(Obj gfx, BlockLayer[] blockLayers := ...)Draws Mappy data into the viewing area. gfx is object specific to the Renderer
- drawPartial
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
new make(MapHeader mapHeader, Renderer renderer, Rect viewBounds)Creates a
Viewer.- mapHeader
MapHeader mapHeader { private set }- pillarRiserMode
virtual Bool pillarRiserMode := false- renderer
Renderer renderer { private set }- translateBlocks
virtual Void translateBlocks(Int x, Int y)add call backs for clipping
- translatePixels
virtual Void translatePixels(Int x, Int y)add call backs for clipping
- viewBounds
const Rect viewBounds