NGUI: Next-Gen UI kit  3.7.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Macros
UITextList Class Reference

Text list can be used with a UILabel to create a scrollable multi-line text field that's easy to add new entries to. Optimal use: chat window. More...

Inheritance diagram for UITextList:

Classes

class  Paragraph
 

Public Types

enum  Style { Style.Text, Style.Chat }
 

Public Member Functions

void Clear ()
 Clear the text. More...
 
void OnScroll (float val)
 Allow scrolling of the text list. More...
 
void OnDrag (Vector2 delta)
 Allow dragging of the text list. More...
 
void Add (string text)
 Add a new paragraph. More...
 

Public Attributes

UILabel textLabel
 Label the contents of which will be modified with the chat entries. More...
 
UIProgressBar scrollBar
 Vertical scroll bar associated with the text list. More...
 
Style style = Style.Text
 Text style. Text entries go top to bottom. Chat entries go bottom to top. More...
 
int paragraphHistory = 50
 Maximum number of chat log entries to keep before discarding them. More...
 

Protected Member Functions

void Add (string text, bool updateVisible)
 Add a new paragraph. More...
 
void Rebuild ()
 Rebuild the visible text. More...
 
void UpdateVisibleText ()
 Refill the text label based on what's currently visible. More...
 

Protected Attributes

char[] mSeparator = new char[] { '\n' }
 
BetterList< ParagraphmParagraphs = new BetterList<Paragraph>()
 
float mScroll = 0f
 
int mTotalLines = 0
 
int mLastWidth = 0
 
int mLastHeight = 0
 

Properties

bool isValid [get]
 Whether the text list is usable. More...
 
float scrollValue [get, set]
 Relative (0-1 range) scroll value, with 0 being the oldest entry and 1 being the newest entry. More...
 
float lineHeight [get]
 Height of each line. More...
 
int scrollHeight [get]
 Height of the scrollable area (outside of the visible area's bounds). More...
 

Detailed Description

Text list can be used with a UILabel to create a scrollable multi-line text field that's easy to add new entries to. Optimal use: chat window.

Member Enumeration Documentation

Enumerator
Text 
Chat 

Member Function Documentation

void UITextList.Add ( string  text)

Add a new paragraph.

void UITextList.Add ( string  text,
bool  updateVisible 
)
protected

Add a new paragraph.

void UITextList.Clear ( )

Clear the text.

void UITextList.OnDrag ( Vector2  delta)

Allow dragging of the text list.

void UITextList.OnScroll ( float  val)

Allow scrolling of the text list.

void UITextList.Rebuild ( )
protected

Rebuild the visible text.

void UITextList.UpdateVisibleText ( )
protected

Refill the text label based on what's currently visible.

Member Data Documentation

int UITextList.mLastHeight = 0
protected
int UITextList.mLastWidth = 0
protected
BetterList<Paragraph> UITextList.mParagraphs = new BetterList<Paragraph>()
protected
float UITextList.mScroll = 0f
protected
char [] UITextList.mSeparator = new char[] { '\n' }
protected
int UITextList.mTotalLines = 0
protected
int UITextList.paragraphHistory = 50

Maximum number of chat log entries to keep before discarding them.

UIProgressBar UITextList.scrollBar

Vertical scroll bar associated with the text list.

Style UITextList.style = Style.Text

Text style. Text entries go top to bottom. Chat entries go bottom to top.

UILabel UITextList.textLabel

Label the contents of which will be modified with the chat entries.

Property Documentation

bool UITextList.isValid
get

Whether the text list is usable.

float UITextList.lineHeight
getprotected

Height of each line.

int UITextList.scrollHeight
getprotected

Height of the scrollable area (outside of the visible area's bounds).

float UITextList.scrollValue
getset

Relative (0-1 range) scroll value, with 0 being the oldest entry and 1 being the newest entry.


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