|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.alienfactory.javamappy.viewer.render.MIDP10Renderer
public class MIDP10Renderer
The standard Renderer
to use with MIDP v1.0 compatible devices.
Please note that the MIDP v1.0 specification does not support transparent
images. Therefore you can not render isometric maps in a fully portable
application with this renderer.
If you wish to make use of transparent areas in your map then use the
MIDP10Renderer(Map, String, boolean)
constructor. Although note that
transparency will only work on devices that actually support transparency.
Field Summary | |
---|---|
protected int |
blockHeight
|
protected int |
blockWidth
|
protected int |
halfBlockWidth
|
Fields inherited from interface com.alienfactory.javamappy.viewer.render.Renderer |
---|
DRAW_LEFT_SIDE_ONLY, DRAW_RIGHT_SIDE_ONLY, NONE |
Constructor Summary | |
---|---|
MIDP10Renderer(Map map)
Uses the raw pixel data and colour map from the given Map to
create the opaque tilemap image. |
|
MIDP10Renderer(Map map,
java.lang.String tileSheetFileName,
boolean block0included)
Initialises itself from the given tileset image. |
Method Summary | |
---|---|
void |
drawImage(java.lang.Object objGFX,
int imageIndex,
int dstPixX,
int dstPixY,
boolean transparency,
int modification)
Renders a tile image at the given coordinates. |
void |
restoreClip(java.lang.Object objGFX)
This is called after a Layer is drawn to restore the
clipping region to what it used to be. |
void |
setClip(java.lang.Object objGFX,
int x,
int y,
int width,
int height)
This is called just before a Layer is drawn to allow the
Renderer to set the desired clipping region. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final int blockWidth
protected final int blockHeight
protected final int halfBlockWidth
Constructor Detail |
---|
public MIDP10Renderer(Map map) throws java.lang.IllegalArgumentException
Map
to
create the opaque tilemap image. PixelData
and Colours
objects in the given
Map
.
map
- the Map
containing the image data to be rendered
java.lang.IllegalArgumentException
- if Map
is null
public MIDP10Renderer(Map map, java.lang.String tileSheetFileName, boolean block0included) throws java.io.IOException, java.lang.IllegalArgumentException
map
- the Map
to be renderedtileSheetFileName
- the fileName of the tileImage to load - should start with a leading '/'block0included
- set to true
if the tile image includes block 0
java.io.IOException
java.lang.IllegalArgumentException
Method Detail |
---|
public final void drawImage(java.lang.Object objGFX, int imageIndex, int dstPixX, int dstPixY, boolean transparency, int modification) throws java.lang.IllegalArgumentException
final
as a compiler optimisation.
objGFX
- an instance of javax.microedition.lcdui.Graphics
transparency
- is ignoredimageIndex
- the index of the image to draw - see Map.getImageData()
dstPixX
- the coordinate of where the image should be rendereddstPixY
- the coordinate of where the image should be renderedmodification
- any modification style should be applied to the image
java.lang.IllegalArgumentException
- if objGFX
is null
public void setClip(java.lang.Object objGFX, int x, int y, int width, int height) throws java.lang.IllegalArgumentException
Renderer
Layer
is drawn to allow the
Renderer
to set the desired clipping region.
setClip
in interface Renderer
objGFX
- the gfx object specific to the Renderer
x
- the start coordinate of the clipping regiony
- the start coordinate of the clipping regionwidth
- the width of the clipping regionheight
- the height of the clipping region
java.lang.IllegalArgumentException
- if objGFX
is null
public void restoreClip(java.lang.Object objGFX) throws java.lang.IllegalArgumentException
Renderer
Layer
is drawn to restore the
clipping region to what it used to be.
restoreClip
in interface Renderer
objGFX
- the gfx object specific to the Renderer
java.lang.IllegalArgumentException
- if objGFX
is null
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |