A TextBox is designed to do A PART of the common text rendering task. This class holds all relevant data and also performs the layouting of the single letters for a text box.

It is possible to set a MaxWidth and have a "boxed" aware layout of the text. Combined with x-alignment this takes care of all the relevant properties of the letter layout.

Each letter position is stored in a "cleverished" cache that defines where exactly each letter is placed.

All values are in local space. So one cannot

Text rendering is not part of this object.

** Example:

text: "Hello I am a Text\nwith two lines" alignX: right maxWidth: 60


| -------------------| | |Hello I am a Text|| | | with two lines|| | -------------------|

** Example:

text: "Hello I am a Text\nwith two lines" alignX: left maxWidth: 60


|------------------- | ||Hello I am a Text| | ||with two lines | | |------------------- |

** Example:

text: "Hello I am a Text\nwith two lines" alignX: center maxWidth: 60


| ------------------- | | |Hello I am a Text| | | | with two lines | | | ------------------- |

Hierarchy

  • LUITextBox

Constructors

Properties

alignX: Align = Align.Center
alignY: Align = Align.Center
definedLetters: number = 0
dirty: number = 1
font: SpriteSheetFont = null
letterColorLookUp: Color[] = []
letterSpacing: number = 0
letters: LetterDesc[] = []
lineHeightFactor: number = 1
lines: LineMeta[] = []
maxWidth: number = Number.MAX_VALUE
namedColors: Record<string, Color>
renderedTextSize: LUIBorder = ...
text: string = ""
textWrap: TextWrapMode = TextWrapMode.None
wait: boolean = false

Accessors

Methods

Generated using TypeDoc