Drag[en]gine Script Module DragonScript  1.23
Dragengine.Utils.TextLayout Class Reference
Inheritance diagram for Dragengine.Utils.TextLayout:

Classes

enum  Align
 Text alignment. More...
 

Public Member Functions

void addToCanvas (CanvasView canvas, int x, int y)
 
Align 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 (Align alignment)
 
void setAtLeastOneLine (bool atLastOneLine)
 
void setColor (Color color)
 
void setFont (Font font)
 
void setMaximalWidth (int width)
 
void setText (String text)
 

Detailed Description

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

Member Function Documentation

◆ addToCanvas()

void Dragengine.Utils.TextLayout.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()

Align Dragengine.Utils.TextLayout.getAlignment ( )

Align.of text.

◆ getAtLeastOneLine()

bool Dragengine.Utils.TextLayout.getAtLeastOneLine ( )

No lines are present.

◆ getColor()

Color Dragengine.Utils.TextLayout.getColor ( )

Color.

◆ getFont()

Font Dragengine.Utils.TextLayout.getFont ( )

Font.

◆ getHeight()

int Dragengine.Utils.TextLayout.getHeight ( )

Height of the layout text.

◆ getLine()

TextLayoutLine Dragengine.Utils.TextLayout.getLine ( int  index)

Line by index.

◆ getLineCount()

int Dragengine.Utils.TextLayout.getLineCount ( )

Number of lines on the layout text.

◆ getMaximalWidth()

int Dragengine.Utils.TextLayout.getMaximalWidth ( )

Maximal width of the layout text.

◆ getText()

String Dragengine.Utils.TextLayout.getText ( )

Layout text.

◆ getWidth()

int Dragengine.Utils.TextLayout.getWidth ( )

Width of the layout text.

◆ layoutText()

void Dragengine.Utils.TextLayout.layoutText ( )

Lay out text.

◆ new() [1/2]

TextLayout Dragengine.Utils.TextLayout.new ( String  text,
Font  font 
)

Creates a new TextLayout object.

◆ new() [2/2]

TextLayout Dragengine.Utils.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 Dragengine.Utils.TextLayout.setAlignment ( Align  alignment)

Set alignement of text.

◆ setAtLeastOneLine()

void Dragengine.Utils.TextLayout.setAtLeastOneLine ( bool  atLastOneLine)

Set if there is at least one one present.

◆ setColor()

void Dragengine.Utils.TextLayout.setColor ( Color  color)

Set color.

◆ setFont()

void Dragengine.Utils.TextLayout.setFont ( Font  font)

Set font.

◆ setMaximalWidth()

void Dragengine.Utils.TextLayout.setMaximalWidth ( int  width)

Set maximal text width.

◆ setText()

void Dragengine.Utils.TextLayout.setText ( String  text)

Set layout text.


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