public class BitmapText extends Node
Spatial.BatchHint, Spatial.CullHint, Spatial.DFSMode
batchHint, 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 and Description |
---|
BitmapText(BitmapFont font) |
BitmapText(BitmapFont font,
boolean rightToLeft)
Deprecated.
The "rightToLeft" flag should be specified in the font.
Use
BitmapText(com.jme3.font.BitmapFont) |
BitmapText(BitmapFont font,
boolean rightToLeft,
boolean arrayBased) |
Modifier and Type | Method and Description |
---|---|
BitmapText |
clone()
Creates a clone of the asset.
|
void |
cloneFields(Cloner cloner,
java.lang.Object original)
Called internally by com.jme3.util.clone.Cloner.
|
BitmapFont.Align |
getAlignment() |
float |
getAlpha() |
ColorRGBA |
getColor() |
BitmapFont |
getFont() |
float |
getHeight() |
int |
getLineCount() |
float |
getLineHeight() |
float |
getLineWidth() |
LineWrapMode |
getLineWrapMode() |
float |
getSize() |
java.lang.String |
getText() |
BitmapFont.VAlign |
getVerticalAlignment() |
void |
render(RenderManager rm,
ColorRGBA color) |
void |
setAlignment(BitmapFont.Align align)
Set horizontal alignment.
|
void |
setAlpha(float alpha)
Sets an overall alpha that will be applied to all
letters.
|
void |
setBox(Rectangle rect)
Define the area where the 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. |
attachChild, 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, write
addControl, 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
public BitmapText(BitmapFont font)
@Deprecated public BitmapText(BitmapFont font, boolean rightToLeft)
BitmapText(com.jme3.font.BitmapFont)
font
- the font to use (not null, alias created)rightToLeft
- true → right-to-left, false → left-to-right
(default=false)public BitmapText(BitmapFont font, boolean rightToLeft, boolean arrayBased)
public BitmapText clone()
CloneableSmartAsset
Object.clone()
for more info on how this method
should be implemented.clone
in interface CloneableSmartAsset
clone
in class Spatial
Mesh.cloneForAnim()
public void cloneFields(Cloner cloner, java.lang.Object original)
cloneFields
in interface JmeCloneable
cloneFields
in class Node
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.public BitmapFont getFont()
public void setSize(float size)
size
- text sizepublic float getSize()
public void setText(java.lang.CharSequence text)
text
- charsequence to change text topublic void setText(java.lang.String text)
text
- String to change text topublic java.lang.String getText()
public ColorRGBA getColor()
public void setColor(ColorRGBA color)
color
- new color of textpublic void setAlpha(float alpha)
alpha
- the desired alpha, or -1 to revert to the defaultpublic float getAlpha()
public void setBox(Rectangle rect)
rect
- position and size box where text is renderedpublic float getLineHeight()
public float getHeight()
public float getLineWidth()
public int getLineCount()
public LineWrapMode getLineWrapMode()
public void setAlignment(BitmapFont.Align align)
align
- the desired alignment (such as Align.Left)public void setVerticalAlignment(BitmapFont.VAlign align)
align
- the desired alignment (such as Align.Top)public BitmapFont.Align getAlignment()
public BitmapFont.VAlign getVerticalAlignment()
public void setStyle(int start, int end, int style)
start
- start index to set style. inclusive.end
- end index to set style. EXCLUSIVE.style
- the style to applypublic void setStyle(java.lang.String regexp, int style)
regexp
- regular expressionstyle
- the style to applypublic void setColor(int start, int end, ColorRGBA color)
start
- start index to set style. inclusive.end
- end index to set style. EXCLUSIVE.color
- the desired colorpublic void setColor(java.lang.String regexp, ColorRGBA color)
regexp
- regular expressioncolor
- the desired colorpublic void setTabPosition(float... tabs)
tabs
- tab positionspublic void setTabWidth(float width)
width
- tab sizepublic void setEllipsisChar(char c)
c
- the character to indicate truncated textpublic void setLineWrapMode(LineWrapMode wrap)
setBox()
method call is needed in advance.
true whenwrap
- 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.public void updateLogicalState(float tpf)
Spatial
updateLogicalState
calls the update()
method
for all controls attached to this Spatial.updateLogicalState
in class Node
tpf
- Time per frame.Spatial.addControl(com.jme3.scene.control.Control)
public void render(RenderManager rm, ColorRGBA color)