|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectvooga.gameEngine.graphics.Texture
vooga.gameEngine.graphics.TextTexture
public class TextTexture
Class TextTexture
allows a string to be rendered on screen. The
given string is rendered with as large as a font as possible in the specified
dimension. If the string does not fill the entire area then it is rendered
top and left justified.
Constructor Summary | |
---|---|
TextTexture(java.lang.String text,
java.awt.Font f,
java.awt.Color c,
Dimension d,
Position p)
Creates a new TextTexture with given parameters. |
Method Summary | |
---|---|
java.lang.String |
getText()
Method for getting the text associated with this TextTexture
. |
protected java.awt.Shape |
makeShape()
Method for a Texture subclass to supply a Shape
representing their bounding box. |
void |
setColor(java.awt.Color color)
|
void |
setFont(java.awt.Font f)
|
void |
setSize(Dimension d)
Sets the specified Dimension , d, as this
Texture 's size. |
void |
setText(java.lang.String text)
Sets the text displayed by this Texture . |
Methods inherited from class vooga.gameEngine.graphics.Texture |
---|
getArea, getIndex, getPosition, getRotation, getShape, getSize, paintComponent, setImage, setIndex, setPosition, setRotation |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TextTexture(java.lang.String text, java.awt.Font f, java.awt.Color c, Dimension d, Position p)
TextTexture
with given parameters.
text
- is the String
to be displayedf
- is the Font
to be used, the fonts current size
(if applicable) will be ignored an a new font size will be
calculate that allows the String to take up the specified areac
- is the Color
that the text will be rendered ind
- is the Dimension
taken up by the text in the
game's coordinate systemp
- is the Position
of the string from the top left
corner in the game's coordinate systemMethod Detail |
---|
public void setText(java.lang.String text)
Texture
.
text
- is the String
to be displayedpublic java.lang.String getText()
TextTexture
.
String
that this representspublic void setFont(java.awt.Font f)
public void setColor(java.awt.Color color)
public void setSize(Dimension d)
Texture
Dimension
, d, as this
Texture
's size.
setSize
in class Texture
d
- is the dimension of this game object in the game coordinate
systemprotected java.awt.Shape makeShape()
Texture
Texture
subclass to supply a Shape
representing their bounding box. For efficiency, an object should cache
their Shape
if possible.
makeShape
in class Texture
Shape
representing the boundaries of the object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |