NL3D::UTextContext::CStringInfo Struct Reference

#include <u_text_context.h>


Detailed Description

The render size of a string.

Definition at line 87 of file u_text_context.h.

Public Member Functions

void convertTo01Size (UDriver *drv)
 convert size in pixels to size in 0-1 relative coordinates, according to Driver current size

void convertToPixelSize (UDriver *drv)
 convert back to pixels size, according to Driver current size

 CStringInfo (float w, float h, float l)
 CStringInfo ()
NLMISC::CVector getHotSpotVector (THotSpot hotspot)

Data Fields

float StringHeight
 The height of the string, in pixels (eg: 10).

float StringLine
float StringWidth
 The width of the string, in pixels (eg: 30).


Constructor & Destructor Documentation

NL3D::UTextContext::CStringInfo::CStringInfo  )  [inline]
 

Definition at line 100 of file u_text_context.h.

NL3D::UTextContext::CStringInfo::CStringInfo float  w,
float  h,
float  l
[inline]
 

Definition at line 101 of file u_text_context.h.

References w.


Member Function Documentation

void NL3D::UTextContext::CStringInfo::convertTo01Size UDriver drv  ) 
 

convert size in pixels to size in 0-1 relative coordinates, according to Driver current size

Definition at line 81 of file text_context_user.cpp.

References NL3D::UDriver::getWindowSize(), uint32, and w.

00082 {
00083         uint32  w,h;
00084         drv->getWindowSize(w,h);
00085         StringWidth/= w;
00086         StringHeight/= h;
00087         StringLine/= h;
00088 }

void NL3D::UTextContext::CStringInfo::convertToPixelSize UDriver drv  ) 
 

convert back to pixels size, according to Driver current size

Definition at line 89 of file text_context_user.cpp.

References NL3D::UDriver::getWindowSize(), uint32, and w.

00090 {
00091         uint32  w,h;
00092         drv->getWindowSize(w,h);
00093         StringWidth*= w;
00094         StringHeight*= h;
00095         StringLine*= h;
00096 }

NLMISC::CVector NL3D::UTextContext::CStringInfo::getHotSpotVector THotSpot  hotspot  ) 
 

Get the string's origin

Parameters:
hotspot the origin of the string


Field Documentation

float NL3D::UTextContext::CStringInfo::StringHeight
 

The height of the string, in pixels (eg: 10).

Definition at line 92 of file u_text_context.h.

float NL3D::UTextContext::CStringInfo::StringLine
 

StringLine is the size from bottom of the whole string image to the hotspot in pixels. for instance if the hotspot is bottomLeft the imaginary line of the string "bpc" is under the b, under the loop of the p but over the leg of the p. So StringLine is a positive value in this case. It may be a negative value for the string "^" for example.

Definition at line 98 of file u_text_context.h.

float NL3D::UTextContext::CStringInfo::StringWidth
 

The width of the string, in pixels (eg: 30).

Definition at line 90 of file u_text_context.h.


The documentation for this struct was generated from the following files:
Generated on Tue Mar 16 08:51:15 2004 for NeL by doxygen 1.3.6