Class jovial.slotCar.animator.Drawable
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class jovial.slotCar.animator.Drawable

java.lang.Object
   |
   +----jovial.slotCar.animator.Drawable

public class Drawable
extends Object
Represesnts something that can be drawn by an Animator. When Animator wants to draw a scene, it sorts its Drawable's by height (to get overlapping right), and then asks each Drawable to draw itself.

Constructor Index

 o Drawable()

Method Index

 o canMove()
 o erase(Graphics)
Erase this drawable.
 o height()
 o paint(Graphics)
Paint this drawable

Constructors

 o Drawable
  public Drawable()

Methods

 o height
  public abstract int height()
Returns:
the height of this drawable. Higher drawables will be drawn first. By convention, heights <= 0 means that this Drawable is part of the "background", and won't be re-drawn with each frame.
 o paint
  public abstract void paint(Graphics g)
Paint this drawable
Parameters:
g - The grahics to be drawn to
 o erase
  public abstract void erase(Graphics g)
Erase this drawable. This only needs to do something if canMove() gives true.
Parameters:
g - The graphics on which erasing is to occur
 o canMove
  public abstract boolean canMove()
Returns:
true iff this drawable might move around the screen

All Packages  Class Hierarchy  This Package  Previous  Next  Index