ScummVM API documentation
Titanic::STFont Class Reference

Public Member Functions

void load (int fontNumber)
 
int stringWidth (const CString &text) const
 
int writeString (CVideoSurface *surface, const Rect &rect1, const Rect &destRect, int yOffset, const CString &str, CTextCursor *textCursor)
 
void writeString (CVideoSurface *surface, const Point &destPos, Rect &clipRect, const CString &str, int lineWidth=0)
 
int getTextBounds (const CString &str, int maxWidth, Point *sizeOut) const
 
void setColor (byte r, byte g, byte b)
 
uint16 getColor () const
 

Public Attributes

byte * _dataPtr
 
size_t _dataSize
 
int _fontHeight
 
uint _dataWidth
 
CharEntry _chars [256]
 
byte _fontR
 
byte _fontG
 
byte _fontB
 

Member Function Documentation

◆ load()

void Titanic::STFont::load ( int  fontNumber)

Load a specified font

◆ stringWidth()

int Titanic::STFont::stringWidth ( const CString text) const

Return the width in pixels of the specified text

◆ writeString() [1/2]

int Titanic::STFont::writeString ( CVideoSurface surface,
const Rect rect1,
const Rect destRect,
int  yOffset,
const CString str,
CTextCursor textCursor 
)

Write a string to the specified surface

Returns
The index of the last character that was visible with the drawing area

◆ writeString() [2/2]

void Titanic::STFont::writeString ( CVideoSurface surface,
const Point destPos,
Rect clipRect,
const CString str,
int  lineWidth = 0 
)

Write a string to the specified surface

◆ getTextBounds()

int Titanic::STFont::getTextBounds ( const CString str,
int  maxWidth,
Point sizeOut 
) const

Get the text area a string will fit into

Parameters
strString
maxWidthMaximum width in pixels
sizeOutOptional pointer to output size (width, height)
Returns
Required height

◆ setColor()

void Titanic::STFont::setColor ( byte  r,
byte  g,
byte  b 
)

Sets the font color

◆ getColor()

uint16 Titanic::STFont::getColor ( ) const

Gets the font color


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