lab1
Class RectangularTile
java.lang.Object
lab1.GameTile
lab1.RectangularTile
public class RectangularTile
- extends GameTile
A rectangular tile manages painting of a
filled rectangle in a specified area of the screen.
Whenever the object should paint itself,
it is told what size and position that
should be used to paint it.
Constructor Summary |
RectangularTile(java.awt.Color color)
Creates a rectangular game tile. |
Method Summary |
void |
draw(java.awt.Graphics g,
int x,
int y,
java.awt.Dimension d)
Draws itself in a given graphics context, position and size. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RectangularTile
public RectangularTile(java.awt.Color color)
- Creates a rectangular game tile.
- Parameters:
color
- the color of the rectangle.
draw
public void draw(java.awt.Graphics g,
int x,
int y,
java.awt.Dimension d)
- Draws itself in a given graphics context, position and size.
- Overrides:
draw
in class GameTile
- Parameters:
g
- graphics context to draw on.x
- pixel x coordinate of the tile to be drawn.y
- pixel y coordinate of the tile to be drawn.d
- size of this object in pixels.