Package com.jme3.font
Class BitmapText
java.lang.Object
com.jme3.scene.Spatial
com.jme3.scene.Node
com.jme3.font.BitmapText
- All Implemented Interfaces:
- HasLocalTransform,- CloneableSmartAsset,- Collidable,- Savable,- JmeCloneable,- Cloneable
- 
Nested Class SummaryNested classes/interfaces inherited from class com.jme3.scene.SpatialSpatial.BatchHint, Spatial.CullHint, Spatial.DFSMode
- 
Field SummaryFields inherited from class com.jme3.scene.SpatialbatchHint, controls, cullHint, frustrumIntersects, key, localLights, localOverrides, localTransform, name, parent, queueBucket, queueDistance, refreshFlags, RF_BOUND, RF_CHILD_LIGHTLIST, RF_LIGHTLIST, RF_MATPARAM_OVERRIDE, RF_TRANSFORM, shadowMode, userData, worldBound, worldLights, worldOverrides, worldTransform
- 
Constructor SummaryConstructorsConstructorDescriptionBitmapText(BitmapFont font) BitmapText(BitmapFont font, boolean rightToLeft) Deprecated.The "rightToLeft" flag should be specified in the font.BitmapText(BitmapFont font, boolean rightToLeft, boolean arrayBased) 
- 
Method SummaryModifier and TypeMethodDescriptionclone()Creates a clone of the asset.voidcloneFields(Cloner cloner, Object original) Called internally by com.jme3.util.clone.Cloner.floatgetAlpha()getColor()getFont()floatintfloatfloatfloatgetSize()getText()voidrender(RenderManager rm, ColorRGBA color) voidsetAlignment(BitmapFont.Align align) Set horizontal alignment.voidsetAlpha(float alpha) Sets an overall alpha that will be applied to all letters.voidDefine the area where the BitmapText will be rendered.voidSet the color of substring.voidchanges text color.voidSet the color of substring.voidsetEllipsisChar(char c) for setLineWrapType(LineWrapType.NoWrap), set the last character when the text exceeds the bound.voidsetLineWrapMode(LineWrapMode wrap) Available only when bounding is set.voidsetSize(float size) Changes text sizevoidsetStyle(int start, int end, int style) Set the font style of substring.voidSet the font style of substring.voidsetTabPosition(float... tabs) voidsetTabWidth(float width) used for the tabs over the last tab position.voidsetText(CharSequence text) voidvoidSet vertical alignment.voidupdateLogicalState(float tpf) updateLogicalStatecalls theupdate()method for all controls attached to this Spatial.Methods inherited from class com.jme3.scene.NodeattachChild, attachChildAt, breadthFirstTraversal, clone, collideWith, deepClone, depthFirstTraversal, descendantMatches, descendantMatches, descendantMatches, detachAllChildren, detachChild, detachChildAt, detachChildNamed, getChild, getChild, getChildIndex, getChildren, getQuantity, getTriangleCount, getVertexCount, hasChild, oldDeepClone, read, setLightListRefresh, setLodLevel, setMaterial, setMatParamOverrideRefresh, setModelBound, setParent, setTransformRefresh, swapChildren, updateGeometricState, updateModelBound, updateWorldBound, writeMethods inherited from class com.jme3.scene.SpatialaddControl, addControlAt, addLight, addMatParamOverride, breadthFirstTraversal, center, checkCulling, clearMatParamOverrides, depthFirstTraversal, forceRefresh, getBatchHint, getControl, getControl, getCullHint, getKey, getLastFrustumIntersection, getLocalBatchHint, getLocalCullHint, getLocalLightList, getLocalMatParamOverrides, getLocalQueueBucket, getLocalRotation, getLocalScale, getLocalShadowMode, getLocalToWorldMatrix, getLocalTransform, getLocalTranslation, getName, getNumControls, getParent, getQueueBucket, getShadowMode, getUserData, getUserDataKeys, getWorldBound, getWorldLightList, getWorldMatParamOverrides, getWorldRotation, getWorldScale, getWorldTransform, getWorldTranslation, hasAncestor, jmeClone, localToWorld, lookAt, matches, move, move, oldClone, removeControl, removeControl, removeFromParent, removeLight, removeMatParamOverride, rotate, rotate, rotateUpTo, runControlRender, scale, scale, setBatchHint, setBoundRefresh, setCullHint, setKey, setLastFrustumIntersection, setLocalRotation, setLocalRotation, setLocalScale, setLocalScale, setLocalScale, setLocalTransform, setLocalTranslation, setLocalTranslation, setName, setQueueBucket, setRequiresUpdates, setShadowMode, setUserData, toString, updateMatParamOverrides, updateWorldLightList, updateWorldTransforms, worldToLocal
- 
Constructor Details- 
BitmapText
- 
BitmapTextDeprecated.The "rightToLeft" flag should be specified in the font. UseBitmapText(com.jme3.font.BitmapFont)- Parameters:
- font- the font to use (not null, alias created)
- rightToLeft- true → right-to-left, false → left-to-right (default=false)
 
- 
BitmapText
 
- 
- 
Method Details- 
cloneDescription copied from interface:CloneableSmartAssetCreates a clone of the asset. Please seeObject.clone()for more info on how this method should be implemented.- Specified by:
- clonein interface- CloneableSmartAsset
- Overrides:
- clonein 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.
- See Also:
 
- 
cloneFieldsCalled internally by com.jme3.util.clone.Cloner. Do not call directly.- Specified by:
- cloneFieldsin interface- JmeCloneable
- Overrides:
- cloneFieldsin class- Node
- Parameters:
- cloner- The cloner that is performing the cloning operation. The cloneFields method can call back into the cloner to make clones of its subordinate fields.
- original- The original object from which this object was cloned. This is provided for the very rare case that this object needs to refer to its original for some reason. In general, all of the relevant values should have been transferred during the shallow clone, and this object need only clone what it wants.
 
- 
getFont
- 
setSizepublic void setSize(float size) Changes text size- Parameters:
- size- text size
 
- 
getSizepublic float getSize()
- 
setText- Parameters:
- text- charsequence to change text to
 
- 
setText- Parameters:
- text- String to change text to
 
- 
getText- Returns:
- returns text
 
- 
getColor- Returns:
- color of the text
 
- 
setColorchanges text color. all substring colors are deleted.- Parameters:
- color- new color of text
 
- 
setAlphapublic void setAlpha(float alpha) Sets an overall alpha that will be applied to all letters. If the alpha passed is -1 then alpha reverts to default... which will be 1 for anything unspecified and color tags will be reset to 1 or their encoded alpha.- Parameters:
- alpha- the desired alpha, or -1 to revert to the default
 
- 
getAlphapublic float getAlpha()
- 
setBoxDefine the area where the BitmapText will be rendered.- Parameters:
- rect- position and size box where text is rendered
 
- 
getLineHeightpublic float getLineHeight()- Returns:
- height of the line
 
- 
getHeightpublic float getHeight()- Returns:
- height of whole text block
 
- 
getLineWidthpublic float getLineWidth()- Returns:
- width of line
 
- 
getLineCountpublic int getLineCount()- Returns:
- line count
 
- 
getLineWrapMode
- 
setAlignmentSet horizontal alignment. Applicable only when text bound is set.- Parameters:
- align- the desired alignment (such as Align.Left)
 
- 
setVerticalAlignmentSet vertical alignment. Applicable only when text bound is set.- Parameters:
- align- the desired alignment (such as Align.Top)
 
- 
getAlignment
- 
getVerticalAlignment
- 
setStylepublic 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- the style to apply
 
- 
setStyleSet the font style of substring. If font doesn't contain style, default style is applied- Parameters:
- regexp- regular expression
- style- the style to apply
 
- 
setColorSet the color of substring.- Parameters:
- start- start index to set style. inclusive.
- end- end index to set style. EXCLUSIVE.
- color- the desired color
 
- 
setColorSet the color of substring.- Parameters:
- regexp- regular expression
- color- the desired color
 
- 
setTabPositionpublic void setTabPosition(float... tabs) - Parameters:
- tabs- tab positions
 
- 
setTabWidthpublic void setTabWidth(float width) used for the tabs over the last tab position.- Parameters:
- width- tab size
 
- 
setEllipsisCharpublic void setEllipsisChar(char c) for setLineWrapType(LineWrapType.NoWrap), set the last character when the text exceeds the bound.- Parameters:
- c- the character to indicate truncated text
 
- 
setLineWrapModeAvailable 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. Clip : The text is hard-clipped at the border including showing only a partial letter if it goes beyond the text bound.
 
- 
updateLogicalStatepublic void updateLogicalState(float tpf) Description copied from class:SpatialupdateLogicalStatecalls theupdate()method for all controls attached to this Spatial.- Overrides:
- updateLogicalStatein class- Node
- Parameters:
- tpf- Time per frame.
- See Also:
 
- 
render
 
-