|
||||||||||
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.GScrollingParagraph
public class GScrollingParagraph
Title: GScrollingParagraph
Description: This container scrolls the large amount of text up the screen.
Copyright: Copyright (c) Mar 23, 2013
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.deken.game.component.GComponent |
---|
GComponent.Alignment, GComponent.MouseActions |
Field Summary | |
---|---|
protected java.lang.String |
indentString
|
protected int |
startIndex
|
protected double |
startSize
|
protected java.util.List<java.lang.String> |
textList
|
protected double |
yTextOffset
|
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 | |
---|---|
GScrollingParagraph(java.lang.String text,
int width,
int height,
double speed)
|
|
GScrollingParagraph(java.lang.String text,
int width,
int height,
double speed,
java.awt.Font font,
java.awt.Color fontColor)
|
Method Summary | |
---|---|
void |
addBlankLine()
Adds a Blank line, with no text. |
void |
addTextToSection(java.lang.String textOnNewLine)
Adds text as a new section. |
GScrollingParagraph |
copy()
|
void |
draw(java.awt.Graphics2D graphics,
int xOffset,
int yOffset)
Draws the sprite with the current offset. |
void |
notifyListener(InputMouseAction inputMouseAction)
notifyListener |
void |
setBackgroundColor(java.awt.Color backgroundColor)
|
void |
setIndentNewSection(boolean indent,
int spaces)
Sets if new sections should be indented, and by how many spaces. |
void |
setLineSpacing(int lineSpacing)
Sets the number of pixels to put between lines of text. |
void |
setMonitored(boolean active)
|
void |
setText(java.lang.String text)
Set the text value to be display in the paragraph. |
protected void |
spriteCollison(Sprite collideSprite)
Handle the collision with another sprite. |
void |
update(long elapseTime)
update |
void |
validate(java.awt.Graphics2D graphics)
|
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, toString, updateLocation |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected java.util.List<java.lang.String> textList
protected java.lang.String indentString
protected int startIndex
protected double startSize
protected double yTextOffset
Constructor Detail |
---|
public GScrollingParagraph(java.lang.String text, int width, int height, double speed)
public GScrollingParagraph(java.lang.String text, int width, int height, double speed, java.awt.Font font, java.awt.Color fontColor)
Method Detail |
---|
public void addBlankLine()
public void addTextToSection(java.lang.String textOnNewLine)
textOnNewLine
- public GScrollingParagraph 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 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 setIndentNewSection(boolean indent, int spaces)
indent
- spaces
- public void setLineSpacing(int lineSpacing)
lineSpacing
- public void setMonitored(boolean active)
setMonitored
in class GComponent
public void setText(java.lang.String text)
text
- 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
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 |