com.wistrand.midlet.valentine
Class BalloonSprite
java.lang.Object
|
+--com.wistrand.midlet.sprite.Sprite
|
+--com.wistrand.midlet.valentine.BalloonSprite
- public class BalloonSprite
- extends Sprite
Sprite whhich will balloon upward on the screen while showing a
text.
Fields inherited from class com.wistrand.midlet.sprite.Sprite |
col, dx, dy, id, idCount, parent, px, py, rot, size, x, y |
Method Summary |
void |
paint(javax.microedition.lcdui.Graphics g)
Paint the sprite on a Graphics. |
void |
setColor(int col)
|
void |
setText(java.lang.String txt)
Set the text of the balloon. |
java.lang.String |
toString()
|
void |
update()
Update position by adding speed to current pos. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
BalloonSprite
public BalloonSprite(SpriteHandler handler,
java.lang.String txt,
int x,
int y)
- Creat a new text balloon.
- Parameters:
handler
- The handler's remove method will be called
when the ballon has reached the top of the screen.x
- initial x positiony
- initial y position
setColor
public void setColor(int col)
- Overrides:
setColor
in class Sprite
setText
public void setText(java.lang.String txt)
- Set the text of the balloon.
update
public void update()
- Description copied from class:
Sprite
- Update position by adding speed to current pos.
- Overrides:
update
in class Sprite
paint
public void paint(javax.microedition.lcdui.Graphics g)
- Description copied from class:
Sprite
- Paint the sprite on a Graphics. Should be overridden
by subclasses since the default method does nothing.
- Overrides:
paint
in class Sprite
toString
public java.lang.String toString()
- Overrides:
toString
in class Sprite