dsfml.graphics.string



class String: dsfml.graphics.drawableimpl.Drawableimpl!(sfString).Drawableimpl;
String defines a graphical 2D text, that can be drawn on screen

All string litterals used must be prefixed with c for utf-8 and w for utf-16 string.

Examples :
   String s = new String("Hello"c);
   //this(char[], Font, float)
   s = new String("Hello"w);
   //this(wchar[], Font, float)


See Also:
IDrawable

this(char[] text, Font font = getDefaultFont(), float size = 30F);
Construct the string from a text

Prefixs string litterals with c

Params:
char[] text Text assigned to the string ("" by default)
Font font Font used to draw the string (use default font)
float size Characters size, in pixels (32 by default)

this(wchar[] text, Font font = getDefaultFont(), float size = 30F);
Construct the string from a unicode text

Prefixs string litterals with w

Params:
wchar[] text Text assigned to the string ("" by default)
Font font Font used to draw the string (use default font)
float size Characters size, in pixels (32 by default)

void setText(char[] text);
Set the text (from a multibyte string)

Params:
char[] text New text

void setText(wchar[] text);
Set the text (from a unicode string)

Params:
wchar[] text New text

void setFont(Font font);
Set the font of the string

Params:
Font font Font filename

void setSize(float size);
Set the size of the string

Params:
float size New size, in pixels

void setStyle(TextStyle style);
Set the style of the text The default style is Regular

Params:
TextStyle New text style, (combination of Style enum values)

wchar[] getUnicodeText();
Get the text (returns a unicode string)

Returns:
Text

char[] getText();
Get the text (returns a multibyte string)

Returns:
Text

Font getFont();
Get the font used by the string

Returns:
Font name

float getSize();
Get the size of the characters

Returns:
Size of the characters

TextStyle getStyle();
Get the current font style

Returns:
Font style

Rect getRect();
Get the string rectangle on screen

Returns:
Rectangle contaning the string in screen coordinates


Page generated by Ddoc.