com.threerings.opengl.util
Class TextBillboard

java.lang.Object
  extended by com.threerings.opengl.util.SimpleRenderable
      extended by com.threerings.opengl.util.SimpleTransformable
          extended by com.threerings.opengl.scene.SimpleSceneElement
              extended by com.threerings.opengl.util.TextBillboard
All Implemented Interfaces:
Compositable, Enqueueable, UIConstants, SceneElement, SceneObject, Intersectable, Tickable

public class TextBillboard
extends SimpleSceneElement
implements UIConstants

A text billboard that may be embedded within a scene.


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.threerings.opengl.scene.SceneElement
SceneElement.TickPolicy
 
Field Summary
protected  float _alpha
          The alpha value with which to render the text.
protected  Box _localBounds
          The bounds of the text.
protected  Text _text
          The text to render.
 
Fields inherited from class com.threerings.opengl.scene.SimpleSceneElement
_bounds, _influences, _lastVisit, _nbounds, _scene, _tickPolicy, _userObject
 
Fields inherited from class com.threerings.opengl.util.SimpleTransformable
_transform
 
Fields inherited from class com.threerings.opengl.util.SimpleRenderable
_batch, _ctx, _priority, _queue
 
Fields inherited from interface com.threerings.opengl.gui.UIConstants
BOTTOM, CENTER, DEFAULT_SIZE, DEFAULT_SPACING, GLOW, HORIZONTAL, LEFT, NORMAL, OUTLINE, OVERLAPPING, PLAIN, RIGHT, SHADOW, TOP, VERTICAL
 
Constructor Summary
TextBillboard(GlContext ctx, Font font, boolean antialias, String text, Color4f color)
          Creates a new text object using a character text factory.
TextBillboard(GlContext ctx, Font font, boolean antialias, String text, Color4f color, int effect, int effectSize, Color4f effectColor)
          Creates a new text object using a character text factory.
TextBillboard(GlContext ctx, Text text)
          Creates a new text object.
 
Method Summary
protected  RenderState[] createStates()
          Creates the state set for this object.
protected  void draw()
          Draws the geometry in immediate mode.
 void enqueue()
          Enqueues this object for rendering.
 float getAlpha()
          Returns the alpha value with which the text is being rendered.
protected  Box getLocalBounds()
          Returns the local bounds of the element.
 Text getText()
          Returns the text being rendered.
 void setAlpha(float alpha)
          Sets the alpha value with which to render the text.
 void setText(Font font, boolean antialias, String text, Color4f color)
          Sets the text using a character text factory.
 void setText(Font font, boolean antialias, String text, Color4f color, int effect, int effectSize, Color4f effectColor)
          Sets the text using a character text factory.
 void setText(Text text)
          Sets the text to render.
 
Methods inherited from class com.threerings.opengl.scene.SimpleSceneElement
boundsDidChange, boundsWillChange, computeBounds, getBounds, getIntersection, getTickPolicy, getUserObject, setInfluences, setTickPolicy, setTransform, setUserObject, tick, updateBounds, updateLastVisit, wasAdded, willBeRemoved
 
Methods inherited from class com.threerings.opengl.util.SimpleTransformable
getCenter, getTransform
 
Methods inherited from class com.threerings.opengl.util.SimpleRenderable
composite, createBatch, getStates
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.threerings.opengl.compositor.Compositable
composite
 

Field Detail

_text

protected Text _text
The text to render.


_localBounds

protected Box _localBounds
The bounds of the text.


_alpha

protected float _alpha
The alpha value with which to render the text.

Constructor Detail

TextBillboard

public TextBillboard(GlContext ctx,
                     Font font,
                     boolean antialias,
                     String text,
                     Color4f color)
Creates a new text object using a character text factory.


TextBillboard

public TextBillboard(GlContext ctx,
                     Font font,
                     boolean antialias,
                     String text,
                     Color4f color,
                     int effect,
                     int effectSize,
                     Color4f effectColor)
Creates a new text object using a character text factory.


TextBillboard

public TextBillboard(GlContext ctx,
                     Text text)
Creates a new text object.

Method Detail

setText

public void setText(Font font,
                    boolean antialias,
                    String text,
                    Color4f color)
Sets the text using a character text factory.


setText

public void setText(Font font,
                    boolean antialias,
                    String text,
                    Color4f color,
                    int effect,
                    int effectSize,
                    Color4f effectColor)
Sets the text using a character text factory.


setText

public void setText(Text text)
Sets the text to render.


getText

public Text getText()
Returns the text being rendered.


setAlpha

public void setAlpha(float alpha)
Sets the alpha value with which to render the text.


getAlpha

public float getAlpha()
Returns the alpha value with which the text is being rendered.


enqueue

public void enqueue()
Description copied from interface: Enqueueable
Enqueues this object for rendering.

Specified by:
enqueue in interface Enqueueable
Overrides:
enqueue in class SimpleTransformable

createStates

protected RenderState[] createStates()
Description copied from class: SimpleRenderable
Creates the state set for this object.

Overrides:
createStates in class SimpleTransformable

getLocalBounds

protected Box getLocalBounds()
Description copied from class: SimpleSceneElement
Returns the local bounds of the element. Default implementation returns Box.ZERO; override to return actual local bounds.

Overrides:
getLocalBounds in class SimpleSceneElement

draw

protected void draw()
Description copied from class: SimpleRenderable
Draws the geometry in immediate mode.

Overrides:
draw in class SimpleRenderable