|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecttipgame.Sprite
tipgame.sprite.StringSprite
public class StringSprite
a simple text sprite
| Field Summary | |
|---|---|
(package private) double |
baseRotation
the original rotation of the text. |
(package private) boolean |
keepAspect
true indicates the text should retain its original width and height, false means the text should be expanded to fit a square |
| Fields inherited from class tipgame.Sprite |
|---|
color, tracker |
| Constructor Summary | |
|---|---|
StringSprite(java.lang.String text)
makes a Sprite containing a String resized to fit within a square |
|
StringSprite(java.lang.String text,
boolean aspect)
makes a Sprite containing a String |
|
StringSprite(java.lang.String text,
boolean aspect,
double baseRotate)
makes a Sprite containing a String |
|
| Method Summary | |
|---|---|
double |
getRotation()
gets the rotation of this sprite. |
void |
setHeight(double height)
makes the size of this sprite such that the height of the text is a given number of pixels |
void |
setText(java.lang.String text)
sets the text of the Sprite |
void |
setText(java.lang.String text,
boolean aspect)
sets the text of the Sprite |
void |
setWidth(double width)
makes the size of this sprite such that the width of the text is a given number of pixels |
| Methods inherited from class tipgame.Sprite |
|---|
flipAlongHorizontalAxis, flipAlongVerticalAxis, getBounds2D, getColor, getLocation, getNormalVector, getScale, getShape, getTracker, getUseBoundingBox, intersects, isDestroyed, isEnabled, isVisible, kill, normalize, paint, paintInternal, rotate, scale, setColor, setEnabled, setLocation, setLocation, setRotation, setScale, setShape, setTracker, setUseBoundingBox, setVisible, translate, update, updateInternal |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
boolean keepAspect
double baseRotation
| Constructor Detail |
|---|
public StringSprite(java.lang.String text)
text - the String for the Sprite to contain
public StringSprite(java.lang.String text,
boolean aspect)
text - the String for the Sprite to containaspect - true indicates original width and height should be retained,
false indicates the text should be resized to fit within a
square
public StringSprite(java.lang.String text,
boolean aspect,
double baseRotate)
text - the String for the Sprite to containaspect - true indicates original width and height should be retained,
false indicates the text should be resized to fit within a
squarebaseRotate - the original orientation| Method Detail |
|---|
public void setHeight(double height)
height - the pixels high of the original textpublic void setWidth(double width)
width - the pixels wide of the original text
public void setText(java.lang.String text,
boolean aspect)
text - the String for the Sprite to containaspect - true indicates original width and height should be retained,
false indicates the text should be resized to fit within a
squarepublic void setText(java.lang.String text)
text - the String for the Sprite to containpublic double getRotation()
getRotation in class SpriteSprite.getRotation()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||