org.xith3d.ui.hud.utils
Class MultilineText

java.lang.Object
  extended by org.xith3d.ui.hud.utils.MultilineText

public class MultilineText
extends java.lang.Object

MultilineText splits an input string at the newline character and calculates sizes and offsets in pixels.


Constructor Summary
MultilineText()
           
 
Method Summary
 int getHeight(int lineIndex)
           
 java.lang.String getLine(int index)
           
 int getLineOffsetY(int lineIndex)
           
 int getMinPosX()
           
 int getNumLines()
           
 int getOffsetY()
           
 int getPosX(int lineIndex)
           
 int getPosY(int lineIndex)
           
 int getTotalHeight()
           
 int getTotalWidth()
           
 int getWidth(int lineIndex)
           
 void setPositionDirty()
          Marks sizes and offsets dirty.
 void setText(java.lang.String text)
          Sets the new text and instantly splits it.
 void update(Texture2DCanvas texCanvas, int width, int height, int paddingLeft, int paddingRight, int paddingTop, int paddingBottom, TextAlignment alignment)
          Updates all dirty content.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MultilineText

public MultilineText()
Method Detail

getNumLines

public final int getNumLines()

getLine

public final java.lang.String getLine(int index)

getMinPosX

public final int getMinPosX()

getPosX

public final int getPosX(int lineIndex)

getPosY

public final int getPosY(int lineIndex)

getLineOffsetY

public final int getLineOffsetY(int lineIndex)

getWidth

public final int getWidth(int lineIndex)

getHeight

public final int getHeight(int lineIndex)

getTotalWidth

public final int getTotalWidth()

getTotalHeight

public final int getTotalHeight()

getOffsetY

public final int getOffsetY()

setText

public void setText(java.lang.String text)
Sets the new text and instantly splits it. update(Texture2DCanvas, int, int, int, int, int, int, TextAlignment) must be called to update the sizes and offsets.

Parameters:
text -

setPositionDirty

public void setPositionDirty()
Marks sizes and offsets dirty.


update

public void update(Texture2DCanvas texCanvas,
                   int width,
                   int height,
                   int paddingLeft,
                   int paddingRight,
                   int paddingTop,
                   int paddingBottom,
                   TextAlignment alignment)
Updates all dirty content.

Parameters:
texCanvas -
width -
height -
paddingLeft -
paddingRight -
paddingTop -
paddingBottom -
alignment -