com.jme.scene
Class Text

java.lang.Object
  extended bycom.jme.scene.Spatial
      extended bycom.jme.scene.Geometry
          extended bycom.jme.scene.Text
All Implemented Interfaces:
java.io.Serializable

public class Text
extends Geometry

Text allows text to be displayed on the screen. The renderstate of this Geometry must be a valid font texture.

Version:
$Id: Text.java,v 1.18 2005/03/01 00:22:02 renanse Exp $
Author:
Mark Powell
See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.jme.scene.Geometry
bound, color, colorBuf, normal, normBuf, texBuf, texture, vertBuf, vertex, vertQuantity
 
Fields inherited from class com.jme.scene.Spatial
currentStates, defaultStateList, forceCull, forceView, frustrumIntersects, geometricalControllers, lightCombineMode, localRotation, localScale, localTranslation, name, parent, queueDistance, renderQueueMode, renderStateList, textureCombineMode, worldBound, worldRotation, worldScale, worldTranslation, zOrder
 
Constructor Summary
Text(java.lang.String name, java.lang.String text)
          Creates a texture object that starts with the given text.
 
Method Summary
 void draw(Renderer r)
          draw calls super to set the render state then calls the renderer to display the text string.
 void drawBounds(Renderer r)
          drawBounds calls super to set the render state then passes itself to the renderer.
 void findCollisions(Spatial scene, CollisionResults results)
          checks this spatial against a second spatial, any collisions are stored in the results object.
 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)
           
 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 setTextColor(ColorRGBA color)
          Sets the color of the text.
 
Methods inherited from class com.jme.scene.Geometry
applyRenderState, applyStates, clearBuffers, copyTextureCoords, findPick, getAllTextures, getCloneID, getColorAsFloatBuffer, getColors, getModelBound, getNormalAsFloatBuffer, getNormals, getNumberOfUnits, getTextureAsFloatBuffer, getTextureAsFloatBuffer, getTextures, getTextures, getVBOColorID, getVBONormalID, getVBOTextureID, getVBOVertexID, getVerticeAsFloatBuffer, getVertices, getVertQuantity, isVBOColorEnabled, isVBONormalEnabled, isVBOTextureEnabled, isVBOVertexEnabled, putClone, randomVertice, reconstruct, setAllTextures, setColor, setColors, setFloatBuffer, setForceView, setModelBound, setNormal, setNormalBuffer, setNormals, setRandomColors, setSolidColor, setTexture, setTexture, setTextureBuffer, setTextureCoord, setTextures, setTextures, setVBOColorEnabled, setVBOColorID, setVBONormalEnabled, setVBONormalID, setVBOTextureEnabled, setVBOTextureID, setVBOVertexEnabled, setVBOVertexID, setVertex, setVertexBuffer, setVertices, updateColorBuffer, updateColorBuffer, updateModelBound, updateNormalBuffer, updateNormalBuffer, updateTextureBuffer, updateTextureBuffer, updateTextureBuffer, updateVertexBuffer, updateVertexBuffer, updateWorldBound
 
Methods inherited from class com.jme.scene.Spatial
addController, applyDefaultStates, calculateCollisions, calculatePick, clearCurrentState, clearCurrentStates, clearRenderState, getController, getControllers, getCurrentState, getLastFrustumIntersection, getLightCombineMode, getLocalRotation, getLocalScale, getLocalTranslation, getName, getParent, getRenderQueueMode, getRenderStateList, getTextureCombineMode, getWorldBound, getWorldRotation, getWorldScale, getWorldTranslation, getZOrder, isForceCulled, isForceView, onDraw, onDrawBounds, propagateBoundToRoot, propagateStatesFromRoot, removeController, removeFromParent, setForceCull, setLightCombineMode, setLocalRotation, setLocalRotation, setLocalScale, setLocalScale, setLocalTranslation, setName, setParent, setRenderQueueMode, setRenderState, setTextureCombineMode, setWorldBound, setZOrder, toString, updateCollisionTree, updateGeometricState, updateRenderState, updateRenderState, updateWorldData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Text

public Text(java.lang.String name,
            java.lang.String text)
Creates a texture object that starts with the given text.

Parameters:
name - the name of the scene element. This is required for identification and comparision purposes.
text - The text to show.
See Also:
TextureManager
Method Detail

print

public void print(java.lang.String text)
print sets the text to be rendered on the next render pass.

Parameters:
text - the text to display.

print

public void print(java.lang.StringBuffer text)
Sets the text to be rendered on the next render. This function is a more efficient version of print(String).

Parameters:
text - The text to display.

getText

public java.lang.StringBuffer getText()
getText retrieves the text string of this Text object.

Returns:
the text string of this object.

draw

public void draw(Renderer r)
draw calls super to set the render state then calls the renderer to display the text string.

Overrides:
draw in class Geometry
Parameters:
r - the renderer used to display the text.
See Also:
Spatial.draw(com.jme.renderer.Renderer)

drawBounds

public void drawBounds(Renderer r)
drawBounds calls super to set the render state then passes itself to the renderer.

Overrides:
drawBounds in class Geometry
Parameters:
r - the renderer to display

setTextColor

public void setTextColor(ColorRGBA color)
Sets the color of the text.

Parameters:
color - Color to set.

getTextColor

public ColorRGBA getTextColor()
Returns the current text color.

Returns:
Current text color.

findCollisions

public void findCollisions(Spatial scene,
                           CollisionResults results)
Description copied from class: Spatial
checks this spatial against a second spatial, any collisions are stored in the results object.

Specified by:
findCollisions in class Spatial
Parameters:
scene - the scene to test against.
results - the results of the collisions.

hasCollision

public boolean hasCollision(Spatial scene,
                            boolean checkTriangles)
Specified by:
hasCollision in class Spatial

getWidth

public float getWidth()

getHeight

public float getHeight()