ScummVM API documentation
Bagel::CBofText Class Reference
Inheritance diagram for Bagel::CBofText:
Bagel::CBofObject Bagel::CBofError

Public Member Functions

 CBofText (const CBofRect *pRect, int nJustify=0, uint32 nFormatFlags=((0x00000000|0x00000000)|0x00000010))
 
ErrorCode setupText (const CBofRect *pRect, int nJustify=0, uint32 nFormatFlags=((0x00000000|0x00000000)|0x00000010))
 
ErrorCode setupTextOpt (const CBofRect *pRect, int nJustify=0, uint32 nFormatFlags=((0x00000000|0x00000000)|0x00000010))
 
void setText (const CBofString &cString)
 
void setColor (const RGBCOLOR cColor)
 
void SetSize (const int nSize)
 
void setWeight (const int nWeight)
 
void setShadowColor (const RGBCOLOR cColor)
 
void setShadowSize (int nDX, int nDY)
 
CBofString getText () const
 
RGBCOLOR getColor () const
 
int getSize () const
 
int getWeight () const
 
ErrorCode erase (CBofWindow *pWnd)
 
ErrorCode erase (CBofBitmap *pBmp)
 
ErrorCode display (CBofWindow *pWnd)
 
ErrorCode display (CBofBitmap *pBmp)
 
ErrorCode display (CBofWindow *pWnd, const char *pszText, int nSize, int nWeight, RGBCOLOR cColor=RGB(0, 0, 0), int nFont=0)
 
ErrorCode display (CBofBitmap *pBmp, const char *pszText, int nSize, int nWeight, RGBCOLOR cColor=RGB(0, 0, 0), int nFont=0)
 
ErrorCode displayShadowed (CBofWindow *pWnd, const char *pszText, int nSize, int nWeight, RGBCOLOR cColor, RGBCOLOR cShadow=RGB(0, 0, 0), int nDX=2, int nDY=2, int nFont=0)
 
void flushBackground ()
 
ErrorCode displayTextEx (CBofBitmap *pBmp, const char *pszText, CBofRect *pRect, int nSize, int nWeight, bool bShadowed, int nFont=0)
 
- Public Member Functions inherited from Bagel::CBofError
void reportError (ErrorCode errCode, const char *format,...)
 
bool errorOccurred () const
 
ErrorCode getErrorCode () const
 
void clearError ()
 

Static Public Member Functions

static ErrorCode initialize ()
 
static ErrorCode shutdown ()
 
static Graphics::FontgetFont (int nFont, int nSize, int nWeight)
 
- Static Public Member Functions inherited from Bagel::CBofObject
static bool isValidObject (const CBofObject *pObject)
 
- Static Public Member Functions inherited from Bagel::CBofError
static void fatalError (ErrorCode errCode, const char *format,...)
 
static void initialize ()
 
static int getErrorCount ()
 

Protected Attributes

CBofString _cCurString
 
CBofRect _cRect
 
CBofPoint _cPosition
 
CBofSize _cSize
 
RGBCOLOR _cTextColor
 
RGBCOLOR _cShadowColor
 
CBofBitmap_pBackground
 
CBofBitmap_pWork
 
int _nCurSize
 
int _nCurWeight
 
int _nJustify
 
int _nShadow_DX
 
int _nShadow_DY
 
uint32 _nFormatFlags
 
bool _bMultiLine
 
bool _bSaved
 
- Protected Attributes inherited from Bagel::CBofError
ErrorCode _errCode
 

Static Protected Attributes

static Graphics::Font_defaultFonts [32]
 
static Graphics::Font_fixedFonts [32]
 
static bool _initialized
 
static int _tabStop
 
- Static Protected Attributes inherited from Bagel::CBofError
static int _count
 

Additional Inherited Members

- Protected Member Functions inherited from Bagel::CBofError
virtual void bofMessageBox (const Common::String &content, const Common::String &title)
 

Member Function Documentation

◆ setupText()

ErrorCode Bagel::CBofText::setupText ( const CBofRect pRect,
int  nJustify = 0,
uint32  nFormatFlags = ((0x00000000|0x00000000)|0x00000010) 
)

Build primary data objects and work areas; text will be displayed centered within the defined rectangular area, hence it is up to the caller to ensure that the text fits (excess is cropped).

Parameters
pRectRectangular area encompassed by the text object
nJustifyAlignment of text in the rectangle
nFormatFlagsFormat flag

◆ erase() [1/2]

ErrorCode Bagel::CBofText::erase ( CBofWindow pWnd)

Restores the background behind current text on screen

Parameters
pWndWindow to erase text from
Returns
Error return Code

◆ erase() [2/2]

ErrorCode Bagel::CBofText::erase ( CBofBitmap pBmp)

Restores the background behind current text offscreen

Parameters
pBmpOffscreen bitmap to erase text from
Returns
Error return Code

◆ display() [1/4]

ErrorCode Bagel::CBofText::display ( CBofWindow pWnd)

Re-displays current text, formatted with current attribs

Parameters
pWndWindow to paint into
Returns
Error return Code

◆ display() [2/4]

ErrorCode Bagel::CBofText::display ( CBofBitmap pBmp)

Re-displays current text, formatted with current attribs

Parameters
pBmpBitmap to paint into
Returns
Error return Code

◆ display() [3/4]

ErrorCode Bagel::CBofText::display ( CBofWindow pWnd,
const char *  pszText,
int  nSize,
int  nWeight,
RGBCOLOR  cColor = RGB(0, 0, 0),
int  nFont = 0 
)

Display a text string, formatted in the current text area

Parameters
pWndWindow to paint into
pszTextPoint to text string to be displayed
nSizePoint size of the text to be used
nWeightWeighting of the font (FW_ identifier)
cColorColor that the text will be
nFontFont used (default or mono)
Returns
Error return Code

◆ display() [4/4]

ErrorCode Bagel::CBofText::display ( CBofBitmap pBmp,
const char *  pszText,
int  nSize,
int  nWeight,
RGBCOLOR  cColor = RGB(0, 0, 0),
int  nFont = 0 
)

Display a text string, formatted in the current text area

Parameters
pBmpBitmap to paint into
pszTextPoint to text string to be displayed
nSizePoint size of the text to be used
nWeightWeighting of the font (FW_ identifier)
cColorColor that the text will be
nFontFont used (default or mono)
Returns
Error return Code

◆ displayShadowed()

ErrorCode Bagel::CBofText::displayShadowed ( CBofWindow pWnd,
const char *  pszText,
int  nSize,
int  nWeight,
RGBCOLOR  cColor,
RGBCOLOR  cShadow = RGB(0, 0, 0),
int  nDX = 2,
int  nDY = 2,
int  nFont = 0 
)

Display a shadowed text string into the current text area

Parameters
pWndWindow to paint into
pszTextPoint to text string to be displayed
nSizePoint size of the text to be used
nWeightWeighting of the font (FW_ identifier)
cColorColor that the text will be
cShadowColor that the text's shadow will be
nDXShadow DX
nDYShadow DY
nFontFont used (default or mono)
Returns
Error return Code

◆ displayTextEx()

ErrorCode Bagel::CBofText::displayTextEx ( CBofBitmap pBmp,
const char *  pszText,
CBofRect pRect,
int  nSize,
int  nWeight,
bool  bShadowed,
int  nFont = 0 
)

Displays specified text onto specified bitmap

Parameters
pBmpBitmap to paint text onto
pszTextPointer to text string to be displayed
pRectArea to paint text to
nSizePoint size of the text to be used
nWeightWeighting of the font (FW_ identifier)
bShadowedWhether the text is shadowed
nFontFont used (default or mono)
Returns
Error return Code

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