|
||||||||||
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 cantained 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 |
---|
cullHint, frustrumIntersects, geometricalControllers, isCollidable, 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)
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)
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 comparision 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 Geometry
r
- 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)
Spatial
findCollisions
in class Spatial
scene
- the scene to test against.results
- the results of the collisions.public boolean hasCollision(Spatial scene, boolean checkTriangles)
Spatial
hasCollision
in class Spatial
scene
- the scene to test against.checkTriangles
- check for collisions on triangle accuracy level
public float getWidth()
public float getHeight()
public static Text createDefaultTextLabel(java.lang.String name)
name
- name of the spatial
DEFAULT_FONT
and correct blend statepublic 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)
Geometry
applyRenderState
determines if a particular render state
is set for this Geometry. If not, the default state will be used.
applyRenderState
in class Geometry
states
- 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 Savable
write
in class Geometry
java.io.IOException
public void read(JMEImporter e) throws java.io.IOException
read
in interface Savable
read
in class Geometry
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |