Drag[en]gine Script Module DragonScript Script API  1.0
TextLayout Class Reference
Inheritance diagram for TextLayout:

Public Member Functions

void addToCanvas (CanvasView canvas, int x, int y)
int getAlignment ()
bool getAtLeastOneLine ()
Color getColor ()
Font getFont ()
int getHeight ()
TextLayoutLine getLine (int index)
int getLineCount ()
int getMaximalWidth ()
String getText ()
int getWidth ()
void layoutText ()
TextLayout new (String text, Font font)
TextLayout new (TextLayout layout, int width)
void setAlignment (int alignment)
void setAtLeastOneLine (bool atLastOneLine)
void setColor (Color color)
void setFont (Font font)
void setMaximalWidth (int width)
void setText (String text)

Public Attributes

final int CENTER = 2
final int LEFT = 0
final int RIGHT = 1

Detailed Description

Takes a text and formats it to fit into a predefined area. Help creating canvas for rendering.

Roland Pl├╝ss

Member Function Documentation

§ addToCanvas()

void addToCanvas ( CanvasView  canvas,
int  x,
int  y 

Add canvas for each line. Canvas has to be of type Canvas.VIEW. Caller is responsible to remove all canvas if required.

§ getAlignment()

int getAlignment ( )

Alignment of text.

§ getAtLeastOneLine()

bool getAtLeastOneLine ( )

No lines are present.

§ getColor()

Color getColor ( )


§ getFont()

Font getFont ( )


§ getHeight()

int getHeight ( )

Height of the layout text.

§ getLine()

TextLayoutLine getLine ( int  index)

Line by index.

§ getLineCount()

int getLineCount ( )

Number of lines on the layout text.

§ getMaximalWidth()

int getMaximalWidth ( )

Maximal width of the layout text.

§ getText()

String getText ( )

Layout text.

§ getWidth()

int getWidth ( )

Width of the layout text.

§ layoutText()

void layoutText ( )

Lay out text.

§ new() [1/2]

TextLayout new ( String  text,
Font  font 

Creates a new TextLayout object.

§ new() [2/2]

TextLayout new ( TextLayout  layout,
int  width 

Creates a new TextLayout object using the attributes stored in another TextLayout object but using a different max width.

§ setAlignment()

void setAlignment ( int  alignment)

Set alignement of text.

§ setAtLeastOneLine()

void setAtLeastOneLine ( bool  atLastOneLine)

Set if there is at least one one present.

§ setColor()

void setColor ( Color  color)

Set color.

§ setFont()

void setFont ( Font  font)

Set font.

§ setMaximalWidth()

void setMaximalWidth ( int  width)

Set maximal text width.

§ setText()

void setText ( String  text)

Set layout text.

Member Data Documentation


final int CENTER = 2

Align text center.


final int LEFT = 0

Align text left side.


final int RIGHT = 1

Align text right side.

The documentation for this class was generated from the following file: