Class: l2dtext

Displays text on the screen. The Text can be formatted in different ways in order to change its color or textposition:

  1. \vrgb - where r,g,b is replaced by a number between 0 and 9: The textprint color is replaced by the specified color. For example, this given string would print out different colors: "\v900red\v090green\v009blue\v909mangenta\v990yellow"
  2. \vc - resets the color to the original color value
  3. \n - starts a new line
  4. \t - inserts a tab character
  5. \vxn; - replace n with a number that specifies an absolute distance in pixels from the left boundary
  6. \vR - aligns the current line to the RIGHT. The widest line of the printed text sets the total width
  7. \vC - aligns the current line centered, works as \vR
  8. \vs - puts a shadow below the text, used to improve readability. Note that the used font texture can also implement a shadow.

Hierarchy

o-+ l2dlist
  o-+ l2dnode
    o-+ l2dtext

Interfaces:

Methods:

Method overview:


new (string name,string text,[fontset])
returns: (l2dtext)
returns a new l2dtext
charatpos (l2dtext, float x, float y)
returns: (boolean inside, int charpos)
returns character index at given x,y. Returns true / false wether it x,y was inside or not.
dimensions (l2dtext)
returns: (float x,y,z)
returns dimension of space it would take when printed
font (l2dtext,[texture])
returns: (texture)
returns or sets font texture
fontset (l2dtext,[fontset])
returns: (fontset)
returns or sets fontset.
posatchar (l2dtext, int pos)
returns: (float x,y)
returns the character's position offset. Behaviour undefined if pos>length of text.
size (l2dtext,[float])
returns: (float)
returns or sets font size, default is 16
spacing (l2dtext,[float])
returns: (float)
returns or sets font spacing, default is 16
tabwidth (l2dtext,[float])
returns: (float)
returns or sets tab width spacing, default is 0. 0 means spacing * 4 is used, otherwise values will be directly applied.
text (l2dtext,[string])
returns: (string)
returns or sets text

Inherited Methods:

From l2dnode

color, delete, firstchild, local2world, parent, pos, rotcenter, rotdeg, rotrad, scale, scissor, scissorlocal, scissorparent, scissorsize, scissorstart, sortid, swapinchildlist, world2local

From l2dlist