com.jme3.font
Class BitmapText

java.lang.Object
  extended by com.jme3.scene.Spatial
      extended by com.jme3.scene.Node
          extended by com.jme3.font.BitmapText
All Implemented Interfaces:
CloneableSmartAsset, Collidable, Savable, java.lang.Cloneable

public class BitmapText
extends Node


Nested Class Summary
 
Nested classes/interfaces inherited from class com.jme3.scene.Spatial
Spatial.BatchHint, Spatial.CullHint
 
Field Summary
 
Fields inherited from class com.jme3.scene.Node
children
 
Fields inherited from class com.jme3.scene.Spatial
batchHint, controls, cullHint, frustrumIntersects, key, localLights, localTransform, name, parent, queueBucket, queueDistance, refreshFlags, RF_BOUND, RF_LIGHTLIST, RF_TRANSFORM, shadowMode, userData, worldBound, worldLights, worldTransform
 
Constructor Summary
BitmapText(BitmapFont font)
           
BitmapText(BitmapFont font, boolean rightToLeft)
           
BitmapText(BitmapFont font, boolean rightToLeft, boolean arrayBased)
           
 
Method Summary
 BitmapText clone()
          Creates a clone of the asset.
 BitmapFont.Align getAlignment()
           
 ColorRGBA getColor()
           
 BitmapFont getFont()
           
 float getHeight()
           
 int getLineCount()
           
 float getLineHeight()
           
 float getLineWidth()
           
 LineWrapMode getLineWrapMode()
           
 java.lang.String getText()
           
 BitmapFont.VAlign getVerticalAlignment()
           
 void render(RenderManager rm)
           
 void setAlignment(BitmapFont.Align align)
          Set horizontal alignment.
 void setBox(Rectangle rect)
          Define area where bitmaptext will be rendered
 void setColor(ColorRGBA color)
          changes text color.
 void setColor(int start, int end, ColorRGBA color)
          Set the color of substring.
 void setColor(java.lang.String regexp, ColorRGBA color)
          Set the color of substring.
 void setEllipsisChar(char c)
          for setLineWrapType(LineWrapType.NoWrap), set the last character when the text exceeds the bound.
 void setLineWrapMode(LineWrapMode wrap)
          Available only when bounding is set.
 void setSize(float size)
          Changes text size
 void setStyle(int start, int end, int style)
          Set the font style of substring.
 void setStyle(java.lang.String regexp, int style)
          Set the font style of substring.
 void setTabPosition(float... tabs)
           
 void setTabWidth(float width)
          used for the tabs over the last tab position.
 void setText(java.lang.CharSequence text)
           
 void setText(java.lang.String text)
           
 void setVerticalAlignment(BitmapFont.VAlign align)
          Set vertical alignment.
 void updateLogicalState(float tpf)
          updateLogicalState calls the update() method for all controls attached to this Spatial.
 
Methods inherited from class com.jme3.scene.Node
attachChild, attachChildAt, breadthFirstTraversal, clone, collideWith, deepClone, depthFirstTraversal, descendantMatches, descendantMatches, descendantMatches, detachAllChildren, detachChild, detachChildAt, detachChildNamed, getChild, getChild, getChildIndex, getChildren, getQuantity, getTriangleCount, getVertexCount, hasChild, read, setLightListRefresh, setLodLevel, setMaterial, setModelBound, setTransformRefresh, swapChildren, updateGeometricState, updateModelBound, updateWorldBound, write
 
Methods inherited from class com.jme3.scene.Spatial
addControl, addLight, breadthFirstTraversal, center, checkCulling, getBatchHint, getControl, getControl, getCullHint, getKey, getLastFrustumIntersection, getLocalBatchHint, getLocalCullHint, getLocalLightList, getLocalQueueBucket, getLocalRotation, getLocalScale, getLocalShadowMode, getLocalToWorldMatrix, getLocalTransform, getLocalTranslation, getName, getNumControls, getParent, getQueueBucket, getShadowMode, getUserData, getUserDataKeys, getWorldBound, getWorldLightList, getWorldRotation, getWorldScale, getWorldTransform, getWorldTranslation, hasAncestor, localToWorld, lookAt, matches, move, move, removeControl, removeControl, removeFromParent, removeLight, rotate, rotate, rotateUpTo, runControlRender, scale, scale, setBatchHint, setBoundRefresh, setCullHint, setKey, setLastFrustumIntersection, setLocalRotation, setLocalRotation, setLocalScale, setLocalScale, setLocalScale, setLocalTransform, setLocalTranslation, setLocalTranslation, setName, setParent, setQueueBucket, setShadowMode, setUserData, toString, updateWorldLightList, updateWorldTransforms, worldToLocal
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BitmapText

public BitmapText(BitmapFont font)

BitmapText

public BitmapText(BitmapFont font,
                  boolean rightToLeft)

BitmapText

public BitmapText(BitmapFont font,
                  boolean rightToLeft,
                  boolean arrayBased)
Method Detail

clone

public BitmapText clone()
Description copied from interface: CloneableSmartAsset
Creates a clone of the asset. Please see Object.clone() for more info on how this method should be implemented.

Specified by:
clone in interface CloneableSmartAsset
Overrides:
clone in class Spatial
Returns:
A clone of this Spatial, the scene graph in its entirety is cloned and can be altered independently of the original scene graph. Note that meshes of geometries are not cloned explicitly, they are shared if static, or specially cloned if animated. All controls will be cloned using the Control.cloneForSpatial method on the clone.
See Also:
Mesh.cloneForAnim()

getFont

public BitmapFont getFont()

setSize

public void setSize(float size)
Changes text size

Parameters:
size - text size

setText

public void setText(java.lang.CharSequence text)
Parameters:
text - charsequence to change text to

setText

public void setText(java.lang.String text)
Parameters:
text - String to change text to

getText

public java.lang.String getText()
Returns:
returns text

getColor

public ColorRGBA getColor()
Returns:
color of the text

setColor

public void setColor(ColorRGBA color)
changes text color. all substring colors are deleted.

Parameters:
color - new color of text

setBox

public void setBox(Rectangle rect)
Define area where bitmaptext will be rendered

Parameters:
rect - position and size box where text is rendered

getLineHeight

public float getLineHeight()
Returns:
height of the line

getHeight

public float getHeight()
Returns:
height of whole textblock

getLineWidth

public float getLineWidth()
Returns:
width of line

getLineCount

public int getLineCount()
Returns:
line count

getLineWrapMode

public LineWrapMode getLineWrapMode()

setAlignment

public void setAlignment(BitmapFont.Align align)
Set horizontal alignment. Applicable only when text bound is set.

Parameters:
align -

setVerticalAlignment

public void setVerticalAlignment(BitmapFont.VAlign align)
Set vertical alignment. Applicable only when text bound is set.

Parameters:
align -

getAlignment

public BitmapFont.Align getAlignment()

getVerticalAlignment

public BitmapFont.VAlign getVerticalAlignment()

setStyle

public void setStyle(int start,
                     int end,
                     int style)
Set the font style of substring. If font doesn't contain style, default style is used

Parameters:
start - start index to set style. inclusive.
end - end index to set style. EXCLUSIVE.
style -

setStyle

public void setStyle(java.lang.String regexp,
                     int style)
Set the font style of substring. If font doesn't contain style, default style is applied

Parameters:
regexp - regular expression
style -

setColor

public void setColor(int start,
                     int end,
                     ColorRGBA color)
Set the color of substring.

Parameters:
start - start index to set style. inclusive.
end - end index to set style. EXCLUSIVE.
color -

setColor

public void setColor(java.lang.String regexp,
                     ColorRGBA color)
Set the color of substring.

Parameters:
regexp - regular expression
color -

setTabPosition

public void setTabPosition(float... tabs)
Parameters:
tabs - tab positions

setTabWidth

public void setTabWidth(float width)
used for the tabs over the last tab position.

Parameters:
width - tab size

setEllipsisChar

public void setEllipsisChar(char c)
for setLineWrapType(LineWrapType.NoWrap), set the last character when the text exceeds the bound.

Parameters:
c -

setLineWrapMode

public void setLineWrapMode(LineWrapMode wrap)
Available only when bounding is set. setBox() method call is needed in advance. true when

Parameters:
wrap - NoWrap : Letters over the text bound is not shown. the last character is set to '...'(0x2026) Character: Character is split at the end of the line. Word : Word is split at the end of the line.

updateLogicalState

public void updateLogicalState(float tpf)
Description copied from class: Spatial
updateLogicalState calls the update() method for all controls attached to this Spatial.

Overrides:
updateLogicalState in class Node
Parameters:
tpf - Time per frame.
See Also:
Spatial.addControl(com.jme3.scene.control.Control)

render

public void render(RenderManager rm)