Drag[en]gine Script Module DragonScript 1.35
Loading...
Searching...
No Matches
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 getBorderColor ()
 Border color.
float getBorderThickness ()
 Border thickness in percentage of the font size or null.
Color getColor ()
float getDilation ()
 Dilation in percentage of the font size.
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 setBorderColor (Color color)
 Set border color.
void setBorderThickness (float thickness)
 Set border thickness in percentage of the font size or null.
void setColor (Color color)
void setDilation (float dilation)
 Set dilation in percentage of the font size.
void setFont (Font font)
void setMaximalWidth (int width)
void setText (String text)

Public Attributes

Align pAlignment
bool pAtLeastOneLine
float pBorderThickness
Color pColor
Font pFont
Array pLines
String pText
int pWidth

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.

References addToCanvas(), getAtLeastOneLine(), getDilation(), getHeight(), getLine(), getLineCount(), getMaximalWidth(), getWidth(), layoutText(), pAlignment, pAtLeastOneLine, pBorderThickness, pFont, pLines, pText, pWidth, setAtLeastOneLine(), setBorderThickness(), setDilation(), and setMaximalWidth().

Referenced by addToCanvas().

◆ getAlignment()

Align Dragengine.Utils.TextLayout.getAlignment ( )

Align.of text.

Referenced by setBorderColor().

◆ getAtLeastOneLine()

bool Dragengine.Utils.TextLayout.getAtLeastOneLine ( )

No lines are present.

References pColor.

Referenced by addToCanvas().

◆ getBorderColor()

Color Dragengine.Utils.TextLayout.getBorderColor ( )

Border color.

Version
1.35

References setText().

Referenced by setAtLeastOneLine().

◆ getBorderThickness()

float Dragengine.Utils.TextLayout.getBorderThickness ( )

Border thickness in percentage of the font size or null.

Version
1.35

A good starting value for balanced border size is 0.075 (7.5%) to 0.1 (10%).

References getFont(), pAlignment, and setAlignment().

Referenced by layoutText().

◆ getColor()

Color Dragengine.Utils.TextLayout.getColor ( )

Color.

Referenced by setDilation().

◆ getDilation()

float Dragengine.Utils.TextLayout.getDilation ( )

Dilation in percentage of the font size.

Version
1.35

References pFont.

Referenced by addToCanvas().

◆ getFont()

Font Dragengine.Utils.TextLayout.getFont ( )

Font.

References pAlignment, pFont, and pLines.

Referenced by getBorderThickness().

◆ getHeight()

int Dragengine.Utils.TextLayout.getHeight ( )

Height of the layout text.

Referenced by addToCanvas().

◆ getLine()

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

Line by index.

Referenced by addToCanvas().

◆ getLineCount()

int Dragengine.Utils.TextLayout.getLineCount ( )

Number of lines on the layout text.

References setBorderColor().

Referenced by addToCanvas().

◆ getMaximalWidth()

int Dragengine.Utils.TextLayout.getMaximalWidth ( )

Maximal width of the layout text.

References setColor().

Referenced by addToCanvas().

◆ getText()

String Dragengine.Utils.TextLayout.getText ( )

Layout text.

Referenced by setColor().

◆ getWidth()

int Dragengine.Utils.TextLayout.getWidth ( )

Width of the layout text.

Referenced by addToCanvas().

◆ layoutText()

void Dragengine.Utils.TextLayout.layoutText ( )

Lay out text.

References getBorderThickness(), and pBorderThickness.

Referenced by addToCanvas().

◆ new() [1/2]

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

Creates a new TextLayout object.

References new(), and pText.

Referenced by new().

◆ 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.

References pAlignment, pColor, pFont, and pLines.

◆ setAlignment()

void Dragengine.Utils.TextLayout.setAlignment ( Align alignment)

Set alignement of text.

References pText.

Referenced by getBorderThickness().

◆ setAtLeastOneLine()

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

Set if there is at least one one present.

References getBorderColor().

Referenced by addToCanvas().

◆ setBorderColor()

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

Set border color.

Version
1.35

References getAlignment(), pAlignment, and pText.

Referenced by getLineCount().

◆ setBorderThickness()

void Dragengine.Utils.TextLayout.setBorderThickness ( float thickness)

Set border thickness in percentage of the font size or null.

Version
1.35

A good starting value for balanced border size is 0.075 (7.5%) to 0.1 (10%).

References pFont, and setFont().

Referenced by addToCanvas().

◆ setColor()

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

Set color.

References getText(), and pText.

Referenced by getMaximalWidth().

◆ setDilation()

void Dragengine.Utils.TextLayout.setDilation ( float dilation)

Set dilation in percentage of the font size.

Version
1.35

References getColor(), and pColor.

Referenced by addToCanvas().

◆ setFont()

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

Set font.

References pBorderThickness, and pColor.

Referenced by setBorderThickness().

◆ setMaximalWidth()

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

Set maximal text width.

Referenced by addToCanvas().

◆ setText()

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

Set layout text.

Referenced by getBorderColor().

Member Data Documentation

◆ pAlignment

Align Dragengine.Utils.TextLayout.pAlignment

◆ pAtLeastOneLine

bool Dragengine.Utils.TextLayout.pAtLeastOneLine

Referenced by addToCanvas().

◆ pBorderThickness

float Dragengine.Utils.TextLayout.pBorderThickness

Referenced by addToCanvas(), layoutText(), and setFont().

◆ pColor

Color Dragengine.Utils.TextLayout.pColor

◆ pFont

Font Dragengine.Utils.TextLayout.pFont

◆ pLines

Array Dragengine.Utils.TextLayout.pLines

Referenced by addToCanvas(), getFont(), and new().

◆ pText

String Dragengine.Utils.TextLayout.pText

◆ pWidth

int Dragengine.Utils.TextLayout.pWidth

Referenced by addToCanvas().


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