public class LabelSceneObject extends SceneObject
SceneObject that represents a label for displaying text.ORIGIN_TOP_LEFT| Constructor and Description |
|---|
LabelSceneObject() |
LabelSceneObject(String text) |
| Modifier and Type | Method and Description |
|---|---|
Font |
getFont()
Set the font used to draw the text.
|
int |
getFontFlags() |
Orientation.HorizontalOrientation |
getHorizontalTextOrientation() |
Paint |
getOutlinePaint() |
Paint |
getPaint() |
FontScaleStrategy |
getScaleStrategy() |
Stroke |
getStroke() |
String |
getText()
Get the text, this label will draw
|
Orientation.VerticalOrientation |
getVerticalTextOrientation() |
protected void |
paint(Graphics2D g,
long elapsedTime)
Paint this SceneObject.
|
void |
setColor(Color color) |
void |
setFont(Font font)
Set the font used to draw the text.
|
void |
setFontFlags(int fontFlags)
Set the font flags as specified by
Font.layoutGlyphVector(java.awt.font.FontRenderContext, char[], int, int, int) |
void |
setHorizontalTextOrientation(Orientation.HorizontalOrientation horizontalTextOrientation)
Set the horizontal orientation of the drawn text
|
void |
setOutlineColor(Color outlineColor)
Set the color for outline painting
|
void |
setOutlinePaint(Paint outlinePaint)
Set the
Paint, that is used for drawing outlines |
void |
setPaint(Paint paint)
Set the
Paint, that is used for drawing |
void |
setScaleStrategy(FontScaleStrategy scaleStrategy)
Set the used
FontScaleStrategy. |
void |
setStroke(Stroke stroke)
Set the
Stroke, that is used for text drawing |
void |
setText(String text)
Set the text, this label will draw
|
void |
setVerticalTextOrientation(Orientation.VerticalOrientation verticalTextOrientation)
Set the vertical orientation of the drawn text
|
collides, collidesBoundingBox, collidesExactly, consumes, consumesBoundingBox, consumesExactly, getHeight, getOrigin, getPosition, getPreciseHeight, getPreciseWidth, getPreciseX, getPreciseY, getRectangle, getRenderingOptions, getSize, getTopLeftPosition, getWidth, getX, getY, isDrawBoundingBox, paintAbsoluteOnScene, paintOnScene, paintOnScene, paintOnScene, paintOnScene, setDrawBoundingBox, setPosition, setPosition, setRenderingOptions, setSize, setSize, setTopLeftPositionpublic LabelSceneObject()
public LabelSceneObject(String text)
protected void paint(Graphics2D g, long elapsedTime)
SceneObjectSceneObject it is
important, that the object is drawn in it's actual state.paint in class SceneObjectg - Graphics Object for paintingelapsedTime - Elapsed time since the last call to this methodpublic Font getFont()
public void setFont(Font font)
font - Used font for drawingpublic Orientation.VerticalOrientation getVerticalTextOrientation()
public void setVerticalTextOrientation(Orientation.VerticalOrientation verticalTextOrientation)
verticalTextOrientation - Vertical orientation of the drawn textpublic Orientation.HorizontalOrientation getHorizontalTextOrientation()
public void setHorizontalTextOrientation(Orientation.HorizontalOrientation horizontalTextOrientation)
horizontalTextOrientation - Horizontal orientation of the drawn textpublic String getText()
public void setText(String text)
text - The text that will be drawnpublic Paint getPaint()
public void setPaint(Paint paint)
Paint, that is used for drawingpaint - The paint used for drawingpublic void setColor(Color color)
color - The color for drawing the stringsetPaint(Paint)public Paint getOutlinePaint()
public void setOutlinePaint(Paint outlinePaint)
Paint, that is used for drawing outlinesoutlinePaint - The paint used for drawing outlinespublic void setOutlineColor(Color outlineColor)
outlineColor - Color for outline paintingsetOutlinePaint(Paint)public Stroke getStroke()
public void setStroke(Stroke stroke)
Stroke, that is used for text drawingstroke - The stroke used for text drawingpublic FontScaleStrategy getScaleStrategy()
public void setScaleStrategy(FontScaleStrategy scaleStrategy)
FontScaleStrategy. If the scale strategy is not
FontScaleStrategy.NoScale the size of the Font is ignored.scaleStrategy - The strategy, that will be used fore scaling the textpublic int getFontFlags()
public void setFontFlags(int fontFlags)
Font.layoutGlyphVector(java.awt.font.FontRenderContext, char[], int, int, int)fontFlags - The flags used for creating the GlyphVectorCopyright © 2017. All rights reserved.