|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.deken.game.sprites.Sprite
org.deken.game.component.GComponent
org.deken.game.component.GScrollingLabel
public class GScrollingLabel
Title: GScrollingLabel
Description: TODO
Copyright: Copyright (c) Mar 24, 2013
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.deken.game.component.GComponent |
---|
GComponent.Alignment, GComponent.MouseActions |
Field Summary | |
---|---|
protected int |
startIndex
|
protected double |
startSize
|
protected double |
xTextOffset
|
Fields inherited from class org.deken.game.component.GComponent |
---|
horizontalAlignment, id, invalid, keyPolling, mouseActions, parent, requestKeyPolling, screenHeight, screenWidth, verticalAlignment, xOffSet, yOffSet |
Fields inherited from class org.deken.game.sprites.Sprite |
---|
boundingBox, collisionMap, location, size |
Constructor Summary | |
---|---|
GScrollingLabel(java.lang.String text,
int width,
double speed)
|
|
GScrollingLabel(java.lang.String text,
int width,
double speed,
java.awt.Font font,
java.awt.Color fontColor)
|
Method Summary | |
---|---|
GScrollingLabel |
copy()
|
void |
draw(java.awt.Graphics2D graphics,
int xOffset,
int yOffset)
Draws the sprite with the current offset. |
java.awt.Color |
getBackgroundColor()
|
java.awt.Font |
getFont()
|
java.awt.Color |
getFontColor()
|
java.lang.String |
getText()
|
boolean |
isInvalid()
|
void |
notifyListener(InputMouseAction inputMouseAction)
notifyListener |
void |
setBackgroundColor(java.awt.Color backgroundColor)
|
void |
setFont(java.awt.Font font)
|
void |
setFontColor(java.awt.Color fontColor)
|
void |
setInvalid(boolean invalid)
|
void |
setMonitored(boolean active)
|
void |
setText(java.lang.String text)
|
void |
setWidth(int width)
|
protected void |
spriteCollison(Sprite collideSprite)
Handle the collision with another sprite. |
java.lang.String |
toString()
|
void |
update(long elapseTime)
update |
void |
validate(java.awt.Graphics2D graphics)
Uses the current graphics object to get FontMetrics and the size of the text. |
Methods inherited from class org.deken.game.component.GComponent |
---|
addMouseAction, copyBase, getHorizontalAlignment, getMouseActions, getParent, getVerticalAlignment, getXLocation, getYLocation, isEnabled, positionHorizontalAlignment, positionVerticalAlignment, requestKeyPolling, setEnabled, setHorizontalAlignment, setInvalid, setKeyPolling, setParent, setVerticalAlignment |
Methods inherited from class org.deken.game.sprites.Sprite |
---|
getBounds, getDepth, getHeight, getLocation, getName, getSize, getWidth, removeFromMap, setBoundingBox, setBoundingBox, setCollisionMap, setLocation, setName, setSize, updateLocation |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected int startIndex
protected double startSize
protected double xTextOffset
Constructor Detail |
---|
public GScrollingLabel(java.lang.String text, int width, double speed)
text
- width
- speed
- public GScrollingLabel(java.lang.String text, int width, double speed, java.awt.Font font, java.awt.Color fontColor)
text
- width
- speed
- font
- fontColor
- Method Detail |
---|
public GScrollingLabel copy()
copy
in class GComponent
public void draw(java.awt.Graphics2D graphics, int xOffset, int yOffset)
GComponent
draw
in class GComponent
graphics
- xOffset
- yOffset
- public java.awt.Font getFont()
public java.awt.Color getFontColor()
public java.awt.Color getBackgroundColor()
public java.lang.String getText()
public boolean isInvalid()
public void notifyListener(InputMouseAction inputMouseAction)
InputMouseListener
This method is called when any Mouse Motion event occurs.
inputMouseAction
- InputMouseActionpublic void setBackgroundColor(java.awt.Color backgroundColor)
public void setFont(java.awt.Font font)
public void setFontColor(java.awt.Color fontColor)
public void setMonitored(boolean active)
setMonitored
in class GComponent
public void setText(java.lang.String text)
public void setInvalid(boolean invalid)
public void setWidth(int width)
public java.lang.String toString()
toString
in class Sprite
public void update(long elapseTime)
GComponent
This method takes the elapse time, and calculates the new current frame of the animation.
update
in interface Updateable
update
in class GComponent
elapseTime
- public void validate(java.awt.Graphics2D graphics)
validate
in class GComponent
graphics
- protected void spriteCollison(Sprite collideSprite)
Sprite
spriteCollison
in class Sprite
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |