com.alienfactory.javamappy.viewer
Class TiledLayerWrapper

java.lang.Object
  extended by com.alienfactory.javamappy.viewer.TiledLayerWrapper

public class TiledLayerWrapper
extends java.lang.Object

This class creates and wraps a J2ME MIDP 2.0 TiledLayer representing a given Layer. This class effectively bridges the gap between the MIDP 2.0 and JavaMappy APIs.

Author:
Steve Eynon

Constructor Summary
TiledLayerWrapper(Layer layer, int imageLayer, javax.microedition.lcdui.Image tileSheetImage, boolean block0included)
          Creates a TiledLayer to display the given Layer
 
Method Summary
 void animateLayer()
          Applies the current state of the AnimBlocks to the TiledLayer.
 Layer getLayer()
          Returns the Layer associated with this Viewer.
 javax.microedition.lcdui.game.TiledLayer getTiledLayer()
          Returns the TiledLayer the class wraps.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TiledLayerWrapper

public TiledLayerWrapper(Layer layer,
                         int imageLayer,
                         javax.microedition.lcdui.Image tileSheetImage,
                         boolean block0included)
Creates a TiledLayer to display the given Layer

Parameters:
layer - the JavaMappy Layer the TiledLayer will display
imageLayer - the imageLayer of the Layer to display - see Block.getImageIndex(int)
tileSheetImage - the tile sheet image to create the TiledLayer with
block0included - set to true if the tile sheet image includes the blank block 0
Method Detail

getLayer

public Layer getLayer()
Returns the Layer associated with this Viewer.

Returns:
the Layer associated with this Viewer

getTiledLayer

public javax.microedition.lcdui.game.TiledLayer getTiledLayer()
Returns the TiledLayer the class wraps.

Returns:
the wrapped TiledLayer

animateLayer

public void animateLayer()

Applies the current state of the AnimBlocks to the TiledLayer. Typically this would be called after updating the AnimBlocks. For example:

 mapViewer.updateAnimBlocks();
 tiledLayerWrapper.animateLayer();
 

See Also:
MapViewer.updateAnimBlocks()


Copyright © 2001-2009 Alien-Factory Ltd. All Rights Reserved.