|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.jme.scene.Spatial
com.jme.scene.Geometry
com.jme.scene.Text
public class Text
Text allows text to be displayed on the screen. The
renderstate of this Geometry must be a valid font texture.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class com.jme.scene.Spatial |
|---|
Spatial.CullHint, Spatial.LightCombineMode, Spatial.NormalsMode, Spatial.TextureCombineMode |
| Field Summary | |
|---|---|
static java.lang.String |
DEFAULT_FONT
A default font contained in the jME library. |
| Fields inherited from class com.jme.scene.Geometry |
|---|
binormalBuf, bound, castsShadows, colorBuf, compVect, defaultColor, displayListID, enabled, fogBuf, hasDirtyVertices, normBuf, states, tangentBuf, texBuf, vboInfo, vertBuf, vertQuantity |
| Fields inherited from class com.jme.scene.Spatial |
|---|
collisionBits, cullHint, frustrumIntersects, geometricalControllers, lightCombineMode, localRotation, localScale, localTranslation, LOCKED_BOUNDS, LOCKED_BRANCH, LOCKED_MESH_DATA, LOCKED_NONE, LOCKED_SHADOWS, LOCKED_TRANSFORMS, lockedMode, name, normalsMode, parent, queueDistance, renderQueueMode, renderStateList, textureCombineMode, worldBound, worldRotation, worldScale, worldTranslation, zOrder |
| Constructor Summary | |
|---|---|
Text()
|
|
Text(java.lang.String name,
java.lang.String text)
Creates a texture object that starts with the given text. |
|
| Method Summary | |
|---|---|
protected void |
applyRenderState(java.util.Stack<? extends RenderState>[] states)
applyRenderState determines if a particular render state
is set for this Geometry. |
static Text |
createDefaultTextLabel(java.lang.String name)
|
static Text |
createDefaultTextLabel(java.lang.String name,
java.lang.String initialText)
|
void |
draw(Renderer r)
draw calls super to set the render state then calls the
renderer to display the text string. |
void |
findCollisions(Spatial scene,
CollisionResults results,
int requiredOnBits)
checks this spatial against a second spatial, any collisions are stored in the results object. |
static TextureState |
getDefaultFontTextureState()
Creates the texture state if not created before. |
static BlendState |
getFontBlend()
|
float |
getHeight()
|
java.lang.StringBuffer |
getText()
getText retrieves the text string of this
Text object. |
ColorRGBA |
getTextColor()
Returns the current text color. |
float |
getWidth()
|
boolean |
hasCollision(Spatial scene,
boolean checkTriangles,
int requiredOnBits)
Checks this spatial against a second spatial for collisions. |
void |
print(java.lang.String text)
print sets the text to be rendered on the next render
pass. |
void |
print(java.lang.StringBuffer text)
Sets the text to be rendered on the next render. |
void |
read(JMEImporter e)
|
static void |
resetDefaultFontTextureState()
Cleans up the default font texture and state for the Text class. |
static void |
resetFontTexture()
|
void |
setTextColor(ColorRGBA color)
Sets the color of the text. |
void |
write(JMEExporter e)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.jme.util.export.Savable |
|---|
getClassTag |
| Field Detail |
|---|
public static final java.lang.String DEFAULT_FONT
| Constructor Detail |
|---|
public Text()
public Text(java.lang.String name,
java.lang.String text)
name - the name of the scene element. This is required for
identification and comparison purposes.text - The text to show.TextureManager| Method Detail |
|---|
public void print(java.lang.String text)
print sets the text to be rendered on the next render
pass.
text - the text to display.public void print(java.lang.StringBuffer text)
text - The text to display.public java.lang.StringBuffer getText()
getText retrieves the text string of this
Text object.
public void draw(Renderer r)
draw calls super to set the render state then calls the
renderer to display the text string.
draw in class Geometryr - the renderer used to display the text.Spatial.draw(com.jme.renderer.Renderer)public void setTextColor(ColorRGBA color)
color - Color to set.public ColorRGBA getTextColor()
public void findCollisions(Spatial scene,
CollisionResults results,
int requiredOnBits)
Spatial
findCollisions in class Spatialscene - the scene to test against.results - the results of the collisions.requiredOnBits - considered a collision only if these bits are 'on'
in both 'this' and the 'scene' spatial.
public boolean hasCollision(Spatial scene,
boolean checkTriangles,
int requiredOnBits)
Spatial
hasCollision in class Spatialscene - the scene to test against.checkTriangles - check for collisions on triangle accuracy levelrequiredOnBits - considered a collision only if these bits are 'on'
in both 'this' and the 'scene' spatial.
public float getWidth()
public float getHeight()
public static Text createDefaultTextLabel(java.lang.String name)
name - name of the spatial
DEFAULT_FONT and correct blend state
public static Text createDefaultTextLabel(java.lang.String name,
java.lang.String initialText)
name - name of the spatial
DEFAULT_FONT and correct blend statepublic static BlendState getFontBlend()
public static void resetFontTexture()
protected void applyRenderState(java.util.Stack<? extends RenderState>[] states)
GeometryapplyRenderState determines if a particular render state
is set for this Geometry. If not, the default state will be used.
applyRenderState in class Geometrystates - An array of stacks for each state.public static TextureState getDefaultFontTextureState()
public static void resetDefaultFontTextureState()
public void write(JMEExporter e)
throws java.io.IOException
write in interface Savablewrite in class Geometryjava.io.IOException
public void read(JMEImporter e)
throws java.io.IOException
read in interface Savableread in class Geometryjava.io.IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||