de.yaina.trackrenderer
Class DrawCanvas

java.lang.Object
  extended by de.yaina.trackrenderer.TileCollection
      extended by de.yaina.trackrenderer.TileCanvas
          extended by de.yaina.trackrenderer.DrawCanvas
Direct Known Subclasses:
MapCanvas

public class DrawCanvas
extends TileCanvas

A tiled canvas with some supposedly higher-level drawing functions.


Constructor Summary
DrawCanvas(int tileDimX, int tileDimY)
          Create a new canvas to draw on.
 
Method Summary
 void drawLine(TileCoordinates p1, TileCoordinates p2, byte colour, int pixmap)
          Draws a line on the canvas
 void setPoint(TileCoordinates p, byte colour, int pixmap)
          Sets a point on the canvas.
 
Methods inherited from class de.yaina.trackrenderer.TileCanvas
getPoint, setPoint
 
Methods inherited from class de.yaina.trackrenderer.TileCollection
getCollection, getDimensionX, getDimensionY, getImage, getTile
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DrawCanvas

public DrawCanvas(int tileDimX,
                  int tileDimY)
Create a new canvas to draw on.

Parameters:
tileDimX - horizontal size of the tiles
tileDimY - vertical size of the tiles
Method Detail

setPoint

public void setPoint(TileCoordinates p,
                     byte colour,
                     int pixmap)
Sets a point on the canvas.

Parameters:
p - the coordinates of the point
colour - the index of the colour
pixmap - the index of the thickness/bitmap of the point

drawLine

public void drawLine(TileCoordinates p1,
                     TileCoordinates p2,
                     byte colour,
                     int pixmap)
Draws a line on the canvas

Parameters:
p1 - starting point of the line
p2 - ending point of the line
colour - colour index for the line
pixmap - index of the thickness/bitmap for each point