A game interface to render string. More...
#include <u_text_context.h>
Inherited by NL3D::CTextContextUser.
Classes | |
| struct | CStringInfo |
| The render size of a string. More... | |
Public Types | |
| enum | THotSpot { BottomLeft = 0, MiddleLeft, TopLeft, MiddleBottom, MiddleMiddle, MiddleTop, BottomRight, MiddleRight, TopRight, HotSpotCount } |
Public Member Functions | |
| virtual void | dumpCacheTexture (const char *filename)=0 |
| Used for debug. | |
| virtual URenderStringBuffer * | createRenderBuffer ()=0 |
| create a renderBuffer for printClipAt(). Must delete it with deleteRenderBuffer() | |
| virtual void | deleteRenderBuffer (URenderStringBuffer *buffer)=0 |
| virtual void | flushRenderBuffer (URenderStringBuffer *buffer)=0 |
| Flush the rendered string buffer. This method sets the driver matrix to a 2d11 matrix and sets ztest to always and disable z write. | |
| virtual void | flushRenderBufferUnProjected (URenderStringBuffer *buffer, bool zwrite)=0 |
| Flush the rendered string buffer. This method doesn't change the current matrices nor the material properties. | |
| virtual void | setLetterColors (ULetterColors *letterColors, uint index)=0 |
| In single line mode you can assign several color to letters. | |
| virtual bool | isSameLetterColors (ULetterColors *letterColors, uint index)=0 |
| virtual ULetterColors * | createLetterColors ()=0 |
Text look. | |
| virtual void | setColor (NLMISC::CRGBA color)=0 |
| set the font color | |
| virtual void | setFontSize (uint32 fontSize)=0 |
| set the font size. | |
| virtual uint32 | getFontSize () const =0 |
| get the font size | |
| virtual void | setHotSpot (THotSpot hotSpot)=0 |
| set the hot spot | |
| virtual THotSpot | getHotSpot () const =0 |
| get the hot spot | |
| virtual void | setScaleX (float scaleX)=0 |
| set the X scale | |
| virtual void | setScaleY (float scaleY)=0 |
| set the Y scale | |
| virtual float | getScaleX () const =0 |
| virtual float | getScaleY () const =0 |
| virtual void | setShaded (bool b)=0 |
| set the shade states | |
| virtual bool | getShaded () const =0 |
| virtual void | setShadeExtent (float shext)=0 |
| set the shadow's size | |
| virtual void | setShadeColor (NLMISC::CRGBA sc)=0 |
| set the shadow's color The alpha of the shade is multiplied at each draw with the alpha of the color. | |
| virtual NLMISC::CRGBA | getShadeColor () const =0 |
| get the shadow's color the shadow color | |
| virtual void | setKeep800x600Ratio (bool keep)=0 |
| set to true if you want that the font manager look at Driver window size, and resize fontSize so it keeps same size than if it was in 800x600. | |
| virtual bool | getKeep800x600Ratio () const =0 |
| return keep800x600Ratio state. | |
Rendering. | |
| virtual uint32 | textPush (const char *format,...)=0 |
All rendering are done in proprietary matrix context for UTextContext:
| |
| virtual uint32 | textPush (const ucstring &str)=0 |
| computes an ucstring and adds the result to the stack | |
| virtual void | setStringColor (uint32 i, NLMISC::CRGBA newCol)=0 |
| set the color of a string. | |
| virtual void | setStringSelection (uint32 i, uint32 selectStart, uint32 selectSize)=0 |
| set the letter selection of a string. | |
| virtual void | resetStringSelection (uint32 i)=0 |
| reset the letter selection of a string to 0/0xFFFFFFFF (all displayed) | |
| virtual void | erase (uint32 i)=0 |
| remove a string from the list | |
| virtual CStringInfo | getStringInfo (uint32 i)=0 |
| Get a string information from the list. | |
| virtual CStringInfo | getStringInfo (const ucstring &ucstr)=0 |
| Get a string information from the ucstring The returned string info is in pixel size per default. | |
| virtual void | clear ()=0 |
| empty the map | |
| virtual void | printAt (float x, float y, uint32 i)=0 |
| print a string of the list (2D method). | |
| virtual void | printClipAt (URenderStringBuffer &renderBuffer, float x, float y, uint32 i, float xmin, float ymin, float xmax, float ymax)=0 |
| Same as printAt but special version for interface: clip and insert in a temp buffer. | |
| virtual void | printClipAtUnProjected (URenderStringBuffer &renderBuffer, class NL3D::CFrustum &frustum, const NLMISC::CMatrix &worldSpaceMatrix, float x, float y, float depth, uint32 i, float xmin, float ymin, float xmax, float ymax)=0 |
| Same as printClipAt but special version for planar 3d interface: the final vertices are unproject using a frustum. | |
| virtual void | printClipAtOld (float x, float y, uint32 i, float xmin, float ymin, float xmax, float ymax)=0 |
| virtual void | printAt (float x, float y, const ucstring &ucstr)=0 |
| compute and print a ucstring at the location (2D method) x/y E [0,1] | |
| virtual void | printfAt (float x, float y, const char *format,...)=0 |
| compute and print a string at the location (2D method) x/y E [0,1] | |
| virtual void | render3D (const NLMISC::CMatrix &mat, const ucstring &ucstr)=0 |
| compute and render a ucstring at the location (3D method) render3D() use UDriver Matrix context for Frustum/ViewMatrix, but use its own modelmatrix (mat). | |
| virtual void | render3D (const NLMISC::CMatrix &mat, const char *format,...)=0 |
| compute and render a string at the location (3D method) render3D() use UDriver Matrix context for Frustum/ViewMatrix, but use its own modelmatrix (mat). | |
| virtual float | getLastXBound () const =0 |
| Return max x coordinate of last string printed. | |
Protected Member Functions | |
Object | |
| UTextContext () | |
| virtual | ~UTextContext () |
A game interface to render string.
Definition at line 69 of file u_text_context.h.
| BottomLeft | |
| MiddleLeft | |
| TopLeft | |
| MiddleBottom | |
| MiddleMiddle | |
| MiddleTop | |
| BottomRight | |
| MiddleRight | |
| TopRight | |
| HotSpotCount |
Definition at line 81 of file u_text_context.h.
| NL3D::UTextContext::UTextContext | ( | ) | [inline, protected] |
Definition at line 74 of file u_text_context.h.
| virtual NL3D::UTextContext::~UTextContext | ( | ) | [inline, protected, virtual] |
Definition at line 75 of file u_text_context.h.
| virtual void NL3D::UTextContext::clear | ( | ) | [pure virtual] |
empty the map
Implemented in NL3D::CTextContextUser.
| virtual ULetterColors* NL3D::UTextContext::createLetterColors | ( | ) | [pure virtual] |
Implemented in NL3D::CTextContextUser.
| virtual URenderStringBuffer* NL3D::UTextContext::createRenderBuffer | ( | ) | [pure virtual] |
create a renderBuffer for printClipAt(). Must delete it with deleteRenderBuffer()
Implemented in NL3D::CTextContextUser.
| virtual void NL3D::UTextContext::deleteRenderBuffer | ( | URenderStringBuffer * | buffer | ) | [pure virtual] |
Implemented in NL3D::CTextContextUser.
| virtual void NL3D::UTextContext::dumpCacheTexture | ( | const char * | filename | ) | [pure virtual] |
Used for debug.
Implemented in NL3D::CTextContextUser.
| virtual void NL3D::UTextContext::erase | ( | uint32 | i | ) | [pure virtual] |
remove a string from the list
Implemented in NL3D::CTextContextUser.
| virtual void NL3D::UTextContext::flushRenderBuffer | ( | URenderStringBuffer * | buffer | ) | [pure virtual] |
Flush the rendered string buffer. This method sets the driver matrix to a 2d11 matrix and sets ztest to always and disable z write.
Implemented in NL3D::CTextContextUser.
| virtual void NL3D::UTextContext::flushRenderBufferUnProjected | ( | URenderStringBuffer * | buffer, | |
| bool | zwrite | |||
| ) | [pure virtual] |
Flush the rendered string buffer. This method doesn't change the current matrices nor the material properties.
Implemented in NL3D::CTextContextUser.
| virtual uint32 NL3D::UTextContext::getFontSize | ( | ) | const [pure virtual] |
| virtual THotSpot NL3D::UTextContext::getHotSpot | ( | ) | const [pure virtual] |
| virtual bool NL3D::UTextContext::getKeep800x600Ratio | ( | ) | const [pure virtual] |
return keep800x600Ratio state.
Implemented in NL3D::CTextContextUser.
| virtual float NL3D::UTextContext::getLastXBound | ( | ) | const [pure virtual] |
Return max x coordinate of last string printed.
Useful to know if a string goes out of the screen (screen limit is supposed at x==4/3, should actually depend on driver's frustum).
Implemented in NL3D::CTextContextUser.
| virtual float NL3D::UTextContext::getScaleX | ( | ) | const [pure virtual] |
Implemented in NL3D::CTextContextUser.
| virtual float NL3D::UTextContext::getScaleY | ( | ) | const [pure virtual] |
Implemented in NL3D::CTextContextUser.
| virtual NLMISC::CRGBA NL3D::UTextContext::getShadeColor | ( | ) | const [pure virtual] |
get the shadow's color the shadow color
Implemented in NL3D::CTextContextUser.
| virtual bool NL3D::UTextContext::getShaded | ( | ) | const [pure virtual] |
Implemented in NL3D::CTextContextUser.
| virtual CStringInfo NL3D::UTextContext::getStringInfo | ( | const ucstring & | ucstr | ) | [pure virtual] |
Get a string information from the ucstring The returned string info is in pixel size per default.
Implemented in NL3D::CTextContextUser.
| virtual CStringInfo NL3D::UTextContext::getStringInfo | ( | uint32 | i | ) | [pure virtual] |
Get a string information from the list.
return CStringInfo(0,0) if not found. The returned string info is in pixel size per default.
Implemented in NL3D::CTextContextUser.
| virtual bool NL3D::UTextContext::isSameLetterColors | ( | ULetterColors * | letterColors, | |
| uint | index | |||
| ) | [pure virtual] |
Implemented in NL3D::CTextContextUser.
| virtual void NL3D::UTextContext::printAt | ( | float | x, | |
| float | y, | |||
| const ucstring & | ucstr | |||
| ) | [pure virtual] |
compute and print a ucstring at the location (2D method) x/y E [0,1]
Implemented in NL3D::CTextContextUser.
print a string of the list (2D method).
x/y E [0,1] (rq : it leaves the string in the stack) z : if the hotspot is bottom z is the position of the line of the string, not the bottom of the string bounding box !
Implemented in NL3D::CTextContextUser.
| virtual void NL3D::UTextContext::printClipAt | ( | URenderStringBuffer & | renderBuffer, | |
| float | x, | |||
| float | y, | |||
| uint32 | i, | |||
| float | xmin, | |||
| float | ymin, | |||
| float | xmax, | |||
| float | ymax | |||
| ) | [pure virtual] |
Same as printAt but special version for interface: clip and insert in a temp buffer.
z : if the hotspot is bottom z is the position of the line of the string, not the bottom of the string bounding box !
Implemented in NL3D::CTextContextUser.
| virtual void NL3D::UTextContext::printClipAtOld | ( | float | x, | |
| float | y, | |||
| uint32 | i, | |||
| float | xmin, | |||
| float | ymin, | |||
| float | xmax, | |||
| float | ymax | |||
| ) | [pure virtual] |
Implemented in NL3D::CTextContextUser.
| virtual void NL3D::UTextContext::printClipAtUnProjected | ( | URenderStringBuffer & | renderBuffer, | |
| class NL3D::CFrustum & | frustum, | |||
| const NLMISC::CMatrix & | worldSpaceMatrix, | |||
| float | x, | |||
| float | y, | |||
| float | depth, | |||
| uint32 | i, | |||
| float | xmin, | |||
| float | ymin, | |||
| float | xmax, | |||
| float | ymax | |||
| ) | [pure virtual] |
Same as printClipAt but special version for planar 3d interface: the final vertices are unproject using a frustum.
depth is the positive depth to used to unproject the string worldSpaceMatrix is used to mul each vertex (when in 0..1 coordinate for x/y and in meter for z coordinate)
Implemented in NL3D::CTextContextUser.
| virtual void NL3D::UTextContext::printfAt | ( | float | x, | |
| float | y, | |||
| const char * | format, | |||
| ... | ||||
| ) | [pure virtual] |
compute and print a string at the location (2D method) x/y E [0,1]
Implemented in NL3D::CTextContextUser.
| virtual void NL3D::UTextContext::render3D | ( | const NLMISC::CMatrix & | mat, | |
| const char * | format, | |||
| ... | ||||
| ) | [pure virtual] |
compute and render a string at the location (3D method) render3D() use UDriver Matrix context for Frustum/ViewMatrix, but use its own modelmatrix (mat).
Implemented in NL3D::CTextContextUser.
| virtual void NL3D::UTextContext::render3D | ( | const NLMISC::CMatrix & | mat, | |
| const ucstring & | ucstr | |||
| ) | [pure virtual] |
compute and render a ucstring at the location (3D method) render3D() use UDriver Matrix context for Frustum/ViewMatrix, but use its own modelmatrix (mat).
Implemented in NL3D::CTextContextUser.
| virtual void NL3D::UTextContext::resetStringSelection | ( | uint32 | i | ) | [pure virtual] |
reset the letter selection of a string to 0/0xFFFFFFFF (all displayed)
Implemented in NL3D::CTextContextUser.
| virtual void NL3D::UTextContext::setColor | ( | NLMISC::CRGBA | color | ) | [pure virtual] |
| virtual void NL3D::UTextContext::setFontSize | ( | uint32 | fontSize | ) | [pure virtual] |
set the font size.
Should be called before the first print
| fonSize | the font size |
Implemented in NL3D::CTextContextUser.
| virtual void NL3D::UTextContext::setHotSpot | ( | THotSpot | hotSpot | ) | [pure virtual] |
| virtual void NL3D::UTextContext::setKeep800x600Ratio | ( | bool | keep | ) | [pure virtual] |
set to true if you want that the font manager look at Driver window size, and resize fontSize so it keeps same size than if it was in 800x600.
..
Implemented in NL3D::CTextContextUser.
| virtual void NL3D::UTextContext::setLetterColors | ( | ULetterColors * | letterColors, | |
| uint | index | |||
| ) | [pure virtual] |
In single line mode you can assign several color to letters.
Implemented in NL3D::CTextContextUser.
| virtual void NL3D::UTextContext::setScaleX | ( | float | scaleX | ) | [pure virtual] |
| virtual void NL3D::UTextContext::setScaleY | ( | float | scaleY | ) | [pure virtual] |
| virtual void NL3D::UTextContext::setShadeColor | ( | NLMISC::CRGBA | sc | ) | [pure virtual] |
set the shadow's color The alpha of the shade is multiplied at each draw with the alpha of the color.
Default: (0,0,0,255)
| the | shadow color |
Implemented in NL3D::CTextContextUser.
| virtual void NL3D::UTextContext::setShaded | ( | bool | b | ) | [pure virtual] |
| virtual void NL3D::UTextContext::setShadeExtent | ( | float | shext | ) | [pure virtual] |
| virtual void NL3D::UTextContext::setStringColor | ( | uint32 | i, | |
| NLMISC::CRGBA | newCol | |||
| ) | [pure virtual] |
set the color of a string.
Implemented in NL3D::CTextContextUser.
| virtual void NL3D::UTextContext::setStringSelection | ( | uint32 | i, | |
| uint32 | selectStart, | |||
| uint32 | selectSize | |||
| ) | [pure virtual] |
set the letter selection of a string.
Only letters in the range given are displayed. Default is 0/0xFFFFFFFF
Implemented in NL3D::CTextContextUser.
computes an ucstring and adds the result to the stack
| an | ucstring |
Implemented in NL3D::CTextContextUser.
| virtual uint32 NL3D::UTextContext::textPush | ( | const char * | format, | |
| ... | ||||
| ) | [pure virtual] |
All rendering are done in proprietary matrix context for UTextContext:
| a | string |
Implemented in NL3D::CTextContextUser.
1.6.1