examples
Class StdScoring

java.lang.Object
  extended byjgame.JGObject
      extended byexamples.StdScoring

public class StdScoring
extends JGObject

A class for displaying an animated piece of text. The text is displayed in the supplied font and can be made to colour-cycle.


Field Summary
 
Fields inherited from class jgame.JGObject
colid, eng, expiry, x, xdir, xspeed, y, ydir, yspeed
 
Constructor Summary
StdScoring(java.lang.String name, double x, double y, double xspeed, double yspeed, int expiry, java.lang.String message, java.awt.Font font, java.awt.Color[] colors, int cyclespeed)
          Create animated piece of text.
 
Method Summary
 void paint()
          Paints the message.
 
Methods inherited from class jgame.JGObject
and, clearAnim, clearBBox, clearTileBBox, dbgPrint, getAnimId, getBBox, getCenterTile, getCenterTiles, getImage, getImageBBox, getLastBBox, getLastCenterTiles, getLastTileBBox, getLastTiles, getLastX, getLastY, getName, getTileBBox, getTiles, getTopLeftTile, hit_bg, hit_bg, hit_bg, hit, isAlive, isBottomAligned, isLeftAligned, isOnScreen, isRightAligned, isTopAligned, isXAligned, isXAligned, isYAligned, isYAligned, move, remove, resetAnim, resetAnim, setAnim, setAnimPingpong, setAnimSpeed, setBBox, setDir, setDirSpeed, setDirSpeed, setGraphic, setImage, setPos, setSpeed, setSpeed, setSpeedAbs, setTileBBox, snapBBoxToGrid, snapToGrid, snapToGrid, startAnim, stopAnim
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StdScoring

public StdScoring(java.lang.String name,
                  double x,
                  double y,
                  double xspeed,
                  double yspeed,
                  int expiry,
                  java.lang.String message,
                  java.awt.Font font,
                  java.awt.Color[] colors,
                  int cyclespeed)
Create animated piece of text.

Parameters:
name - name prefix (unique id is always added)
x - center of text (text is centered)
y - top of text
expiry - the expiry value: # ticks, -1=never, or -2=die offscreen
colors - colors through which to cycle
cyclespeed - number of ticks before next colour in the colour cycle
Method Detail

paint

public void paint()
Paints the message.

Overrides:
paint in class JGObject