 |
|
 |
 |
Documentation |
|
Main Page Namespace List Class Hierarchy Alphabetical List Compound List File List Namespace Members Compound Members File Members Related Pages Search
NL3D::CTextContext Class ReferenceCTextContext.
More...
#include <text_context.h>
List of all members.
Public Methods |
| | CTextContext () |
| | Constructor defaults : fontsize=12, color=black, hotspot=bottomleft, scale=1, shaded=false, 800x600ratio=true. More...
|
| | ~CTextContext () |
| | Destructor. More...
|
| void | init (IDriver *drv, CFontManager *fmg) |
| | set the driver. More...
|
| void | setFontGenerator (const std::string fontFileName, const std::string fontExFileName="") |
| | Must be called before any print. More...
|
| NL3D::CFontGenerator * | getFontGenerator () |
| void | setColor (NLMISC::CRGBA color) |
| | Accessors SET. More...
|
| void | setFontSize (uint32 fontSize) |
| void | setHotSpot (CComputedString::THotSpot hotSpot) |
| void | setScaleX (float scaleX) |
| void | setScaleZ (float scaleZ) |
| void | setShaded (bool b) |
| void | setShadeExtent (float shext) |
| | Set the shadow's size. More...
|
| void | setKeep800x600Ratio (bool keep) |
| | If true the CFontManager look at Driver window size, and resize fontSize to keep the same size than if it was in 800x600... More...
|
| NLMISC::CRGBA | getColor () const |
| | Accessors GET. More...
|
| uint32 | getFontSize () const |
| CComputedString::THotSpot | getHotSpot () const |
| float | getScaleX () const |
| float | getScaleZ () const |
| bool | getShaded () const |
| bool | getKeep800x600Ratio () const |
| uint32 | textPush (const char *format,...) |
| | compute and add a string to the cache (return the index). More...
|
| uint32 | textPush (const ucstring &str) |
| | computes an ucstring and adds the result to the cache (return the index). More...
|
| void | erase (uint32 index) |
| | remove a string from the cache. More...
|
| void | clear () |
| | Clear the cache. More...
|
| void | printAt (float x, float z, uint32 index) |
| | Print a string that is in the cache from its index (it leaves the string in the cache). More...
|
| void | printClipAt (float x, float z, uint32 index, float xmin, float ymin, float xmax, float ymax) |
| | Clip and print a string that is in the cache (it leaves the string in the cache). More...
|
| void | printAt (float x, float z, const ucstring &ucstr) |
| | Directly print a string. More...
|
| void | printfAt (float x, float z, const char *format,...) |
| | Directly print a string. More...
|
| CComputedString & | operator[] (uint32 index) |
| | Get computed string from index. More...
|
| CComputedString * | getComputedString (uint32 index) |
| void | computeString (const std::string &s, CComputedString &output) |
| | Compute a string as primitive blocks using the font manager's method computeString. More...
|
| void | computeString (const ucstring &s, CComputedString &output) |
| | Compute a ucstring as primitive blocks using the font manager's method computeString. More...
|
| void | computeStringInfo (const ucstring &s, CComputedString &output) |
| void | dumpCache (const char *filename) |
| | Debug : write to the disk the texture cache. More...
|
Private Attributes |
| IDriver * | _Driver |
| | Driver. More...
|
| NL3D::CFontManager * | _FontManager |
| | Font manager. More...
|
| NL3D::CFontGenerator * | _FontGen |
| | Font generator. More...
|
| uint32 | _FontSize |
| | Font size;. More...
|
| NLMISC::CRGBA | _Color |
| | Current text color. More...
|
| CComputedString::THotSpot | _HotSpot |
| | Hotspot. More...
|
| float | _ScaleX |
| | X scale. More...
|
| float | _ScaleZ |
| | Z scale. More...
|
| bool | _Shaded |
| | true if text is shaded. More...
|
| float | _ShadeExtent |
| | shade's extent. More...
|
| bool | _Keep800x600Ratio |
| | resize the font to keep the same aspect ratio than in 800x600. More...
|
| std::vector< CComputedString > | _CacheStrings |
| | Cache to manipulate strings with indexes. More...
|
| std::vector< uint32 > | _CacheFreePlaces |
| uint32 | _CacheNbFreePlaces |
| CComputedString | _TempString |
| | Cache for for printAt() and printfAt(). This prevents from creating VBdrvinfos each time they are called (N*each frame!!). More...
|
| CComputedString | _TempShadowString |
Detailed Description
CTextContext.
-
Author:
-
Stephane Coutelas , Nevrax France
-
Date:
-
2000
Definition at line 44 of file text_context.h.
Constructor & Destructor Documentation
| NL3D::CTextContext::CTextContext |
( |
|
) |
|
|
|
|
Constructor defaults : fontsize=12, color=black, hotspot=bottomleft, scale=1, shaded=false, 800x600ratio=true.
Definition at line 36 of file text_context.cpp.
References _CacheNbFreePlaces, _Color, _Driver, _FontGen, _FontManager, _FontSize, _HotSpot, _Keep800x600Ratio, _ScaleX, _ScaleZ, _Shaded, and _ShadeExtent. |
| NL3D::CTextContext::~CTextContext |
( |
|
) |
|
|
Member Function Documentation
| void NL3D::CTextContext::clear |
( |
|
) |
|
|
| void NL3D::CTextContext::computeString |
( |
const std::string & |
s, |
|
|
CComputedString & |
output |
|
) |
[inline] |
|
| void NL3D::CTextContext::dumpCache |
( |
const char * |
filename |
) |
[inline] |
|
| void NL3D::CTextContext::erase |
( |
uint32 |
index |
) |
|
|
| NLMISC::CRGBA NL3D::CTextContext::getColor |
( |
void |
|
) |
const [inline] |
|
| uint32 NL3D::CTextContext::getFontSize |
( |
|
) |
const [inline] |
|
| bool NL3D::CTextContext::getKeep800x600Ratio |
( |
|
) |
const [inline] |
|
| float NL3D::CTextContext::getScaleX |
( |
|
) |
const [inline] |
|
| float NL3D::CTextContext::getScaleZ |
( |
|
) |
const [inline] |
|
| bool NL3D::CTextContext::getShaded |
( |
|
) |
const [inline] |
|
| void NL3D::CTextContext::printAt |
( |
float |
x, |
|
|
float |
z, |
|
|
const ucstring & |
ucstr |
|
) |
[inline] |
|
|
|
Directly print a string.
Definition at line 149 of file text_context.h.
References _Color, _Driver, _FontGen, _FontManager, _FontSize, _HotSpot, _Keep800x600Ratio, _ScaleX, _ScaleZ, _ShadeExtent, _TempShadowString, _TempString, NL3D::CFontManager::computeString, x, and z. |
| void NL3D::CTextContext::printAt |
( |
float |
x, |
|
|
float |
z, |
|
|
uint32 |
index |
|
) |
[inline] |
|
| void NL3D::CTextContext::printClipAt |
( |
float |
x, |
|
|
float |
z, |
|
|
uint32 |
index, |
|
|
float |
xmin, |
|
|
float |
ymin, |
|
|
float |
xmax, |
|
|
float |
ymax |
|
) |
[inline] |
|
| void NL3D::CTextContext::printfAt |
( |
float |
x, |
|
|
float |
z, |
|
|
const char * |
format, |
|
|
... |
|
|
) |
[inline] |
|
|
|
Directly print a string.
Definition at line 162 of file text_context.h.
References _Color, _Driver, _FontGen, _FontManager, _FontSize, _HotSpot, _Keep800x600Ratio, _ScaleX, _ScaleZ, _ShadeExtent, _TempShadowString, _TempString, NL3D::CFontManager::computeString, format, nlassert, NLMISC_CONVERT_VARGS, x, and z. |
| void NL3D::CTextContext::setColor |
( |
NLMISC::CRGBA |
color |
) |
[inline] |
|
| void NL3D::CTextContext::setFontGenerator |
( |
const std::string |
fontFileName, |
|
|
const std::string |
fontExFileName = "" |
|
) |
|
|
| void NL3D::CTextContext::setFontSize |
( |
uint32 |
fontSize |
) |
[inline] |
|
| void NL3D::CTextContext::setKeep800x600Ratio |
( |
bool |
keep |
) |
[inline] |
|
| void NL3D::CTextContext::setScaleX |
( |
float |
scaleX |
) |
[inline] |
|
| void NL3D::CTextContext::setScaleZ |
( |
float |
scaleZ |
) |
[inline] |
|
| void NL3D::CTextContext::setShaded |
( |
bool |
b |
) |
[inline] |
|
| void NL3D::CTextContext::setShadeExtent |
( |
float |
shext |
) |
[inline] |
|
|
|
computes an ucstring and adds the result to the cache (return the index).
Definition at line 99 of file text_context.cpp.
References _CacheFreePlaces, _CacheNbFreePlaces, _CacheStrings, _Color, _Driver, _FontGen, _FontManager, _FontSize, _Keep800x600Ratio, NL3D::CFontManager::computeString, index, and nlassert. |
| uint32 NL3D::CTextContext::textPush |
( |
const char * |
format, |
|
|
... |
|
|
) |
|
|
|
|
compute and add a string to the cache (return the index).
Definition at line 69 of file text_context.cpp.
References _CacheFreePlaces, _CacheNbFreePlaces, _CacheStrings, _Color, _Driver, _FontGen, _FontManager, _FontSize, _Keep800x600Ratio, NL3D::CFontManager::computeString, format, index, nlassert, and NLMISC_CONVERT_VARGS. |
Member Data Documentation
std::vector<uint32> NL3D::CTextContext::_CacheFreePlaces [private]
|
|
uint32 NL3D::CTextContext::_CacheNbFreePlaces [private]
|
|
IDriver* NL3D::CTextContext::_Driver [private]
|
|
uint32 NL3D::CTextContext::_FontSize [private]
|
|
bool NL3D::CTextContext::_Keep800x600Ratio [private]
|
|
float NL3D::CTextContext::_ScaleX [private]
|
|
float NL3D::CTextContext::_ScaleZ [private]
|
|
bool NL3D::CTextContext::_Shaded [private]
|
|
float NL3D::CTextContext::_ShadeExtent [private]
|
|
The documentation for this class was generated from the following files:
|
 |