#include <W3DDisplayString.h>
Inherits DisplayString.
Public Member Functions | |
| W3DDisplayString (void) | |
| void | notifyTextChanged (void) |
| called when text contents change | |
| void | draw (Int x, Int y, Color color, Color dropColor) |
| render text | |
| void | draw (Int x, Int y, Color color, Color dropColor, Int xDrop, Int yDrop) |
| render text with the drop shadow being at the offsets passed in | |
| void | getSize (Int *width, Int *height) |
| get render size | |
| Int | getWidth (Int charPos=-1) |
| void | setWordWrap (Int wordWrap) |
| set the word wrap width | |
| void | setWordWrapCentered (Bool isCentered) |
| If this is set to true, the text on a new line is centered. | |
| void | setFont (GameFont *font) |
| set a font for display | |
| void | setUseHotkey (Bool useHotkey, Color hotKeyColor=0xffffffff) |
| void | setClipRegion (IRegion2D *region) |
| clip text in this region | |
Public Member Functions inherited from DisplayString | |
| DisplayString (void) | |
| virtual void | setText (UnicodeString text) |
| set text for this string | |
| virtual UnicodeString | getText (void) |
| get text for this string | |
| virtual Int | getTextLength (void) |
| return number of chars in string | |
| virtual void | reset (void) |
| reset all contents of string | |
| virtual GameFont * | getFont (void) |
| return font in string | |
| virtual void | removeLastChar (void) |
| remove the last character | |
| virtual void | appendChar (WideChar c) |
| append character to end | |
| DisplayString * | next (void) |
| return next string | |
Public Member Functions inherited from MemoryPoolObject | |
| void | deleteInstance () |
Public Attributes | |
| friend | W3DDisplayStringManager |
Public Attributes inherited from DisplayString | |
| friend | DisplayStringManager |
Protected Member Functions | |
| void | checkForChangedTextData (void) |
| void | usingResources (UnsignedInt frame) |
| void | computeExtents (void) |
| compupte text width and height | |
Protected Member Functions inherited from MemoryPoolObject | |
| virtual | ~MemoryPoolObject () |
| void * | operator new (size_t s) |
| void | operator delete (void *p) |
| virtual MemoryPool * | getObjectMemoryPool ()=0 |
Protected Attributes | |
| Render2DSentenceClass | m_textRenderer |
| for drawing text | |
| Render2DSentenceClass | m_textRendererHotKey |
| for drawing text | |
| Bool | m_textChanged |
| when contents of string change this is TRUE | |
| Bool | m_fontChanged |
| when font has chagned this is TRUE | |
| UnicodeString | m_hotkey |
| holds the current hotkey marker. | |
| Bool | m_useHotKey |
| ICoord2D | m_hotKeyPos |
| Color | m_hotKeyColor |
| ICoord2D | m_textPos |
| current text pos set in text renderer | |
| Color | m_currTextColor |
| current color used in text renderer | |
| Color | m_currDropColor |
| current color used for shadow in text | |
| ICoord2D | m_size |
| (width,height) size of rendered text | |
| IRegion2D | m_clipRegion |
| the clipping region for text | |
| UnsignedInt | m_lastResourceFrame |
| last frame resources were used on | |
Protected Attributes inherited from DisplayString | |
| UnicodeString | m_textString |
| GameFont * | m_font |
| font to display this string with | |
| DisplayString * | m_next |
| for the display string factory list ONLY | |
| DisplayString * | m_prev |
| for the display string factory list ONLY | |
Definition at line 68 of file W3DDisplayString.h.
| W3DDisplayString::W3DDisplayString | ( | void | ) |
Definition at line 82 of file W3DDisplayString.cpp.
|
protected |
called when we need to update our render sentence and update extents
|
protected |
compupte text width and height
Update the width and height of our string
Definition at line 352 of file W3DDisplayString.cpp.
render text
Draw the text at the specified location in in the specified colors in the parameters. Since we keep an instance of the rendered text texture around, this is the time to check to see if any of our properties have changed since the last render, like color, or position, or content. If they have, we need to rebuild the sentence texture for rendering
Implements DisplayString.
Definition at line 160 of file W3DDisplayString.cpp.
|
virtual |
render text with the drop shadow being at the offsets passed in
Implements DisplayString.
Definition at line 164 of file W3DDisplayString.cpp.
get render size
Get the render size width and height of the string in this instance with the font associated with it
Implements DisplayString.
Definition at line 247 of file W3DDisplayString.cpp.
Get text with up to charPos characters, -1 = all characters
Implements DisplayString.
Definition at line 262 of file W3DDisplayString.cpp.
|
virtual |
called when text contents change
This method automatically gets called from some methods in the display class so that we can write our own code here to to appropriate things on the changing of string data
Reimplemented from DisplayString.
Definition at line 118 of file W3DDisplayString.cpp.
|
virtual |
clip text in this region
Set the clipping region for the text
Reimplemented from DisplayString.
Definition at line 320 of file W3DDisplayString.cpp.
|
virtual |
set a font for display
Set the font for this particular display string
Reimplemented from DisplayString.
Definition at line 291 of file W3DDisplayString.cpp.
Implements DisplayString.
Definition at line 385 of file W3DDisplayString.cpp.
|
virtual |
set the word wrap width
Set the wordwrap of the m_textRenderer
Implements DisplayString.
Definition at line 378 of file W3DDisplayString.cpp.
|
virtual |
If this is set to true, the text on a new line is centered.
Set the whether or not we want to center each new line in a text string
Implements DisplayString.
Definition at line 396 of file W3DDisplayString.cpp.
|
inlineprotected |
call this whenever display resources are in use
Definition at line 119 of file W3DDisplayString.h.
|
protected |
the clipping region for text
Definition at line 111 of file W3DDisplayString.h.
|
protected |
current color used for shadow in text
Definition at line 109 of file W3DDisplayString.h.
|
protected |
current color used in text renderer
Definition at line 108 of file W3DDisplayString.h.
|
protected |
when font has chagned this is TRUE
Definition at line 102 of file W3DDisplayString.h.
|
protected |
holds the current hotkey marker.
Definition at line 103 of file W3DDisplayString.h.
|
protected |
Definition at line 106 of file W3DDisplayString.h.
|
protected |
Definition at line 105 of file W3DDisplayString.h.
|
protected |
last frame resources were used on
Definition at line 112 of file W3DDisplayString.h.
|
protected |
(width,height) size of rendered text
Definition at line 110 of file W3DDisplayString.h.
|
protected |
when contents of string change this is TRUE
Definition at line 101 of file W3DDisplayString.h.
|
protected |
current text pos set in text renderer
Definition at line 107 of file W3DDisplayString.h.
|
protected |
for drawing text
Definition at line 99 of file W3DDisplayString.h.
|
protected |
for drawing text
Definition at line 100 of file W3DDisplayString.h.
|
protected |
Definition at line 104 of file W3DDisplayString.h.
| friend W3DDisplayString::W3DDisplayStringManager |
Definition at line 75 of file W3DDisplayString.h.