com.threerings.opengl.gui.text
Class Text

java.lang.Object
  extended by com.threerings.opengl.gui.text.Text

public abstract class Text
extends Object

Contains a "run" of text. Specializations of this class render text in different ways, for example using JME's internal bitmapped font support or by using the AWT to render the run of text to an image and texturing a quad with that entire image.


Constructor Summary
Text()
           
 
Method Summary
abstract  int getCursorPos(int index)
          Returns the x position for the cursor at the specified character index.
abstract  int getHitPos(int x, int y)
          Returns the character position to which the cursor should be moved given that the user clicked the specified coordinate (relative to the text's bounds).
abstract  int getLength()
          Returns the length in characters of this text.
abstract  Dimension getSize()
          Returns the screen dimensions of this text.
abstract  void render(Renderer renderer, int x, int y, float alpha)
          Renders this text to the display.
 void render(Renderer renderer, int x, int y, int w, int h, float alpha)
          Optional rendering this text scaled to a certain height/width.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Text

public Text()
Method Detail

getLength

public abstract int getLength()
Returns the length in characters of this text.


getSize

public abstract Dimension getSize()
Returns the screen dimensions of this text.


getHitPos

public abstract int getHitPos(int x,
                              int y)
Returns the character position to which the cursor should be moved given that the user clicked the specified coordinate (relative to the text's bounds).


getCursorPos

public abstract int getCursorPos(int index)
Returns the x position for the cursor at the specified character index. Note that the position should be "before" that character.


render

public abstract void render(Renderer renderer,
                            int x,
                            int y,
                            float alpha)
Renders this text to the display.


render

public void render(Renderer renderer,
                   int x,
                   int y,
                   int w,
                   int h,
                   float alpha)
Optional rendering this text scaled to a certain height/width.



Copyright © 2011. All Rights Reserved.