com.jmex.font3d
Class Text3D
java.lang.Object
com.jme.scene.Spatial
com.jme.scene.Node
com.jme.scene.SharedNode
com.jmex.font3d.Text3D
- All Implemented Interfaces:
- Savable, JmeText, java.io.Serializable
public class Text3D
- extends SharedNode
- implements JmeText
This class represents a peace of text compiled using the
Font3D#createText(String, String, int, boolean, boolean, boolean)
.
- Author:
- emanuel
- See Also:
- Serialized Form
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 |
Text3D(Font3D factory,
java.lang.String text,
float size)
|
Method Summary |
void |
alignCenter()
Just a hack that positions the text with its center in the origo (only on
the X-axis). |
void |
appendText(java.lang.String moretext)
Append text to the string of text that this object is visualizing. |
void |
draw(Renderer r)
draw calls the onDraw method for each child maintained by
this node. |
TextFactory |
getFactory()
|
int |
getFlags()
|
ColorRGBA |
getFontColor()
|
float |
getSize()
|
java.lang.StringBuffer |
getText()
|
float |
getWidth()
|
void |
setFontColor(ColorRGBA fontcolor)
|
void |
setSize(float size)
change the size of the font, this will most likely be implemented with
scaling, so watch out when using this and setLocalScale(...). |
void |
setText(java.lang.String text)
Sets the string of text that this object is visualizing, the geometry of
the object should change to reflect the change. |
void |
updateModelBound()
updateBound recalculates the bounding object for this
Spatial. |
void |
updateWorldBound()
updateWorldBound merges the bounds of all the children
maintained by this node. |
Methods inherited from class com.jme.scene.Node |
applyRenderState, attachChild, attachChildAt, childChange, detachAllChildren, detachChild, detachChildAt, detachChildNamed, findCollisions, findPick, getChild, getChild, getChildIndex, getChildren, getQuantity, getTriangleCount, getVertexCount, hasChild, hasCollision, lockBounds, lockMeshes, lockShadows, lockTransforms, setModelBound, sortLights, swapChildren, unlockBounds, unlockMeshes, unlockShadows, unlockTransforms, updateWorldData, updateWorldVectors |
Methods inherited from class com.jme.scene.Spatial |
addController, calculateCollisions, calculatePick, clearControllers, clearRenderState, clearRenderState, getClassTag, getController, getControllerCount, getControllers, getCullHint, getLastFrustumIntersection, getLightCombineMode, getLocalCullHint, getLocalLightCombineMode, getLocalNormalsMode, getLocalRenderQueueMode, getLocalRotation, getLocalScale, getLocalTextureCombineMode, getLocalToWorldMatrix, getLocalTranslation, getLocks, getName, getNormalsMode, getParent, getRenderQueueMode, getRenderState, getRenderState, getTextureCombineMode, getUserData, getWorldBound, getWorldRotation, getWorldScale, getWorldTranslation, getZOrder, hasAncestor, isCollidable, localToWorld, lock, lock, lockBranch, lockMeshes, lookAt, onDraw, propagateBoundToRoot, propagateStatesFromRoot, removeController, removeController, removeFromParent, removeUserData, rotateUpTo, setCullHint, setIsCollidable, setLastFrustumIntersection, setLightCombineMode, setLocalRotation, setLocalRotation, setLocalScale, setLocalScale, setLocalTranslation, setLocalTranslation, setLocks, setLocks, setName, setNormalsMode, setParent, setRenderQueueMode, setRenderState, setTextureCombineMode, setUserData, setZOrder, setZOrder, toString, unlock, unlock, unlockBranch, unlockMeshes, updateGeometricState, updateRenderState, updateRenderState, updateWorldRotation, updateWorldScale, updateWorldTranslation, updateWorldVectors, worldToLocal |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
render_mesh_bounds
OrientedBoundingBox render_mesh_bounds
Text3D
public Text3D(Font3D factory,
java.lang.String text,
float size)
updateWorldBound
public void updateWorldBound()
- Description copied from class:
Node
updateWorldBound
merges the bounds of all the children
maintained by this node. This will allow for faster culling operations.
- Overrides:
updateWorldBound
in class Node
- See Also:
Spatial.updateWorldBound()
getFactory
public TextFactory getFactory()
- Specified by:
getFactory
in interface JmeText
- Returns:
- the factory where this text was created, or null if it does not
know.
getFlags
public int getFlags()
- Specified by:
getFlags
in interface JmeText
- Returns:
- the flags that were given when this text was created.
getSize
public float getSize()
- Specified by:
getSize
in interface JmeText
- Returns:
- the size of the text (normally size 12 refers to 12pt, in jme I
guess it refers to jme-units).
getText
public java.lang.StringBuffer getText()
- Specified by:
getText
in interface JmeText
- Returns:
- the string of text that this object is visualizing.
setSize
public void setSize(float size)
- Description copied from interface:
JmeText
- change the size of the font, this will most likely be implemented with
scaling, so watch out when using this and setLocalScale(...).
- Specified by:
setSize
in interface JmeText
setText
public void setText(java.lang.String text)
- Description copied from interface:
JmeText
- Sets the string of text that this object is visualizing, the geometry of
the object should change to reflect the change.
- Specified by:
setText
in interface JmeText
appendText
public void appendText(java.lang.String moretext)
- Description copied from interface:
JmeText
- Append text to the string of text that this object is visualizing.
- Specified by:
appendText
in interface JmeText
updateModelBound
public void updateModelBound()
- Description copied from class:
Spatial
updateBound
recalculates the bounding object for this
Spatial.
- Overrides:
updateModelBound
in class Node
draw
public void draw(Renderer r)
- Description copied from class:
Node
draw
calls the onDraw method for each child maintained by
this node.
- Overrides:
draw
in class SharedNode
- Parameters:
r
- the renderer to draw to.- See Also:
Spatial.draw(com.jme.renderer.Renderer)
getFontColor
public ColorRGBA getFontColor()
setFontColor
public void setFontColor(ColorRGBA fontcolor)
getWidth
public float getWidth()
alignCenter
public void alignCenter()
- Just a hack that positions the text with its center in the origo (only on
the X-axis).