public class CachedLabelSceneObject extends LabelSceneObject
LabelSceneObject that draws the text on a cached BufferedImage. This speeds up
drawing when animating text, but the quality might be less.LabelSceneObjectORIGIN_TOP_LEFT| Constructor and Description |
|---|
CachedLabelSceneObject() |
CachedLabelSceneObject(String text) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
paint(Graphics2D g,
long elapsedTime)
Paint this SceneObject.
|
void |
setColor(Color color) |
void |
setDrawBoundingBox(boolean drawBoundingBox)
Change the drawing state of the bounding box.
|
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 |
setSize(int width,
int height) |
void |
setSize(Size size)
Set the size of this
SceneObject |
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
|
getFont, getFontFlags, getHorizontalTextOrientation, getOutlinePaint, getPaint, getScaleStrategy, getStroke, getText, getVerticalTextOrientationcollides, 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, setPosition, setPosition, setRenderingOptions, setTopLeftPositionpublic CachedLabelSceneObject(String text)
public CachedLabelSceneObject()
protected void paint(Graphics2D g, long elapsedTime)
SceneObjectSceneObject it is
important, that the object is drawn in it's actual state.paint in class LabelSceneObjectg - Graphics Object for paintingelapsedTime - Elapsed time since the last call to this methodpublic void setText(String text)
LabelSceneObjectsetText in class LabelSceneObjecttext - The text that will be drawnpublic void setSize(int width,
int height)
setSize in class SceneObjectwidth - Width of this ScreenObjectheight - Height of this ScreenObjectSceneObject.setSize(Size)public void setSize(Size size)
SceneObjectSceneObjectsetSize in class SceneObjectsize - Size of this ScreenObjectpublic void setColor(Color color)
setColor in class LabelSceneObjectcolor - The color for drawing the stringLabelSceneObject.setPaint(Paint)public void setFont(Font font)
LabelSceneObjectsetFont in class LabelSceneObjectfont - Used font for drawingpublic void setFontFlags(int fontFlags)
LabelSceneObjectFont.layoutGlyphVector(java.awt.font.FontRenderContext, char[], int, int, int)setFontFlags in class LabelSceneObjectfontFlags - The flags used for creating the GlyphVectorpublic void setDrawBoundingBox(boolean drawBoundingBox)
SceneObjectsetDrawBoundingBox in class SceneObjectdrawBoundingBox - true if the bounding box should be paintedpublic void setHorizontalTextOrientation(Orientation.HorizontalOrientation horizontalTextOrientation)
LabelSceneObjectsetHorizontalTextOrientation in class LabelSceneObjecthorizontalTextOrientation - Horizontal orientation of the drawn textpublic void setOutlineColor(Color outlineColor)
LabelSceneObjectsetOutlineColor in class LabelSceneObjectoutlineColor - Color for outline paintingLabelSceneObject.setOutlinePaint(Paint)public void setOutlinePaint(Paint outlinePaint)
LabelSceneObjectPaint, that is used for drawing outlinessetOutlinePaint in class LabelSceneObjectoutlinePaint - The paint used for drawing outlinespublic void setPaint(Paint paint)
LabelSceneObjectPaint, that is used for drawingsetPaint in class LabelSceneObjectpaint - The paint used for drawingpublic void setStroke(Stroke stroke)
LabelSceneObjectStroke, that is used for text drawingsetStroke in class LabelSceneObjectstroke - The stroke used for text drawingpublic void setVerticalTextOrientation(Orientation.VerticalOrientation verticalTextOrientation)
LabelSceneObjectsetVerticalTextOrientation in class LabelSceneObjectverticalTextOrientation - Vertical orientation of the drawn textpublic void setScaleStrategy(FontScaleStrategy scaleStrategy)
LabelSceneObjectFontScaleStrategy. If the scale strategy is not
FontScaleStrategy.NoScale the size of the Font is ignored.setScaleStrategy in class LabelSceneObjectscaleStrategy - The strategy, that will be used fore scaling the textCopyright © 2017. All rights reserved.