public class DrawableTextWrapper extends AbstractDrawable
DrawableTextWrapper
wraps any text rendered by an ITextRenderer
into an AbstractDrawable
, meaning it can be injected in the scene graph, and be transformed.Modifier and Type | Field and Description |
---|---|
protected Color |
color |
protected Halign |
halign |
protected Coord3d |
position |
protected ITextRenderer |
renderer |
protected String |
txt |
protected Valign |
valign |
bbox, boundingBoxColor, boundingBoxDisplayed, displayed, hasListeners, legend, legendDisplayed, listeners, spaceTransformer, transform, transformBefore
Constructor and Description |
---|
DrawableTextWrapper(ITextRenderer renderer) |
DrawableTextWrapper(String txt,
Coord3d position,
Color color,
ITextRenderer renderer) |
Modifier and Type | Method and Description |
---|---|
void |
applyGeometryTransform(Transform transform) |
void |
configure(String txt,
Coord3d position,
Color color,
Halign ha,
Valign va) |
void |
draw(com.jogamp.opengl.GL gl,
com.jogamp.opengl.glu.GLU glu,
Camera cam)
Call OpenGL2 routines for rendering the object.
|
BoundingBox3d |
getBounds()
Return the BoundingBox of this object.
|
Halign |
getHalign() |
Coord3d |
getPosition() |
String |
getText() |
Valign |
getValign() |
void |
setColor(Color color) |
void |
setHalign(Halign halign) |
void |
setPosition(Coord3d position) |
void |
setText(String txt) |
void |
setValign(Valign valign) |
String |
toString() |
void |
updateBounds() |
addDrawableListener, call, call, callWithAlphaFactor, colorGL2, colorGLES2, dispose, doDrawBounds, doTransform, fireDrawableChanged, fireDrawableChanged, getBarycentre, getBoundingBoxColor, getDistance, getLegend, getLongestDistance, getShortestDistance, getSpaceTransformer, getTransform, getTransformBefore, hasLegend, isBoundingBoxDisplayed, isDisplayed, isLegendDisplayed, negative, removeDrawableListener, setBoundingBoxColor, setBoundingBoxDisplayed, setDisplayed, setLegend, setLegendDisplayed, setSpaceTransformer, setTransform, setTransformBefore, toString, vertexGL2, vertexGLES2
protected String txt
protected Coord3d position
protected Halign halign
protected Valign valign
protected Color color
protected ITextRenderer renderer
public DrawableTextWrapper(ITextRenderer renderer)
public DrawableTextWrapper(String txt, Coord3d position, Color color, ITextRenderer renderer)
public void draw(com.jogamp.opengl.GL gl, com.jogamp.opengl.glu.GLU glu, Camera cam)
AbstractDrawable
draw
in interface IGLRenderer
draw
in class AbstractDrawable
gl
- GL2 contextglu
- GLU contextcam
- a reference to a shooting Camera.public BoundingBox3d getBounds()
AbstractDrawable
getBounds
in class AbstractDrawable
public String getText()
public void setText(String txt)
public void setPosition(Coord3d position)
public Coord3d getPosition()
public void setColor(Color color)
public Halign getHalign()
public void setHalign(Halign halign)
public Valign getValign()
public void setValign(Valign valign)
public String toString()
toString
in class AbstractDrawable
public void applyGeometryTransform(Transform transform)
applyGeometryTransform
in class AbstractDrawable
public void updateBounds()
updateBounds
in class AbstractDrawable
Copyright © 2016. All rights reserved.