danger.ui
Class BitmapSprite

java.lang.Object
  extended by danger.ui.Sprite
      extended by danger.ui.BitmapSprite


public class BitmapSprite
extends Sprite

A BitmapSprite manages a moving Bitmap. You can use it for certain forms of animation. It keeps track of the location of the sprite.


Constructor Summary
BitmapSprite()
          Construct an instance of BitmapSprite.
BitmapSprite(Bitmap inBitmap)
          Construct an instance of BitmapSprite with the specified Bitmap.
 
Method Summary
 void paint(Pen inPen)
          Paint the sprite at the current location.
 void setBitmap(Bitmap inBitmap)
          Set the bitmap for the sprite.
 
Methods inherited from class danger.ui.Sprite
advance, getPosition, getPosition, setHotSpot, setHotSpot, setPosition, setPosition, setVelocity, setVelocity
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BitmapSprite

public BitmapSprite()
Construct an instance of BitmapSprite. You will need to call setBitmap(danger.ui.Bitmap) to set the Bitmap for the sprite.


BitmapSprite

public BitmapSprite(Bitmap inBitmap)
Construct an instance of BitmapSprite with the specified Bitmap.

Method Detail

setBitmap

public void setBitmap(Bitmap inBitmap)
Set the bitmap for the sprite. By default, the sprite's hotspot is the center of the bitmap image.

See Also:
Sprite.setHotSpot(danger.ui.Point)

paint

public void paint(Pen inPen)
Description copied from class: Sprite
Paint the sprite at the current location.

Specified by:
paint in class Sprite