Package com.simsilica.lemur
Class Label
java.lang.Object
com.jme3.scene.Spatial
com.jme3.scene.Node
com.simsilica.lemur.Panel
com.simsilica.lemur.Label
- All Implemented Interfaces:
HasLocalTransform
,CloneableSmartAsset
,Collidable
,Savable
,JmeCloneable
,Cloneable
A standard GUI element for displaying text with an optional
shadow.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.jme3.scene.Spatial
Spatial.BatchHint, Spatial.CullHint, Spatial.DFSMode
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
Fields inherited from class com.simsilica.lemur.Panel
EFFECT_CLOSE, EFFECT_OPEN, LAYER_BACKGROUND, LAYER_BORDER, LAYER_INSETS
Fields inherited from class com.jme3.scene.Spatial
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Text2d
createText2d
(ElementId elementId, String style) Utility method to encapsulate the font shell game that we play for backwards compatibility.getColor()
getFont()
float
getIcon()
float
getText()
static void
void
void
setFont
(BitmapFont font) void
setFontName
(String fontName) void
setFontSize
(float f) void
setIcon
(GuiComponent icon) void
setMaxWidth
(float f) Sets the maximum width of the label.void
setShadowColor
(ColorRGBA color) void
setShadowOffset
(Vector3f offset) void
void
void
toString()
Returns the Spatial's name followed by the class of the spatial
Example: "MyNode (com.jme3.scene.Spatial)"Methods inherited from class com.simsilica.lemur.Panel
addEffect, addMouseListener, getAlpha, getBackground, getBorder, getEffectControl, getEffects, getElementId, getInsets, getInsetsComponent, getPreferredSize, getSize, getStyle, hasEffect, removeEffect, removeMouseListener, runEffect, setAlpha, setAlpha, setBackground, setBorder, setChildAlpha, setEffects, setInsets, setInsetsComponent, setPreferredSize, setSize
Methods inherited from class com.jme3.scene.Node
attachChild, attachChildAt, breadthFirstTraversal, clone, cloneFields, 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, updateLogicalState, updateModelBound, updateWorldBound, write
Methods inherited from class com.jme3.scene.Spatial
addControl, addControlAt, addLight, addMatParamOverride, breadthFirstTraversal, center, checkCulling, clearMatParamOverrides, clone, 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, updateMatParamOverrides, updateWorldLightList, updateWorldTransforms, worldToLocal
-
Field Details
-
ELEMENT_ID
- See Also:
-
LAYER_ICON
- See Also:
-
LAYER_TEXT
- See Also:
-
LAYER_SHADOW_TEXT
- See Also:
-
-
Constructor Details
-
Label
-
Label
-
Label
-
Label
-
Label
-
-
Method Details
-
initializeDefaultStyles
-
createText2d
Utility method to encapsulate the font shell game that we play for backwards compatibility. If a Label has overridden the default fontName somewhere in its style hierarchy then that will always be used here. Otherwise, the bitmap "font" styling is checked. If that is different than the default 'font' style then it is used. If the local 'font' style is the same as the default 'font' style then the font name is used, regardless of if it was overridden or not. In this way, any existing style hierarchies should continue to work with actual BitmapFonts will also seemlessly supporting 'fontName' styles. 'fontName' is preferred going forward because it better supports overriding Text2d implementations. -
setText
-
getText
-
setTextVAlignment
@StyleAttribute(value="textVAlignment", lookupDefault=false) public void setTextVAlignment(VAlignment a) -
getTextVAlignment
-
setTextHAlignment
@StyleAttribute(value="textHAlignment", lookupDefault=false) public void setTextHAlignment(HAlignment a) -
getTextHAlignment
-
setMaxWidth
Sets the maximum width of the label. If the text is longer than this width then it will be wrapped and the label will grow vertically (in a way that the layout's can use for proper positioning). -
getMaxWidth
public float getMaxWidth() -
setFont
-
getFont
-
setFontName
-
getFontName
-
setColor
-
getColor
-
setFontSize
-
getFontSize
public float getFontSize() -
setShadowOffset
-
getShadowOffset
-
setShadowColor
@StyleAttribute(value="shadowColor", lookupDefault=false) public void setShadowColor(ColorRGBA color) -
getShadowColor
-
setIcon
-
getIcon
-
toString
Description copied from class:Spatial
Returns the Spatial's name followed by the class of the spatial
Example: "MyNode (com.jme3.scene.Spatial)"
-