Table of Contents

 
SetFontStyle
 

Purpose

Sets a new style for the text font

 

Protoype

void CTextMngr::SetFontStyle (string str_text_id, int i_style)
 

Parameters

text_id the ID of the text object to change
style the new style flag
 

Description

This function changes the style of a text's font. If you want to display the font normally, then pass in TTF_STYLE_NORMAL for i_style. If you want to format the text, then you can logically OR the following flags together and pass them in instead: TTF_STYLE_BOLD, TTF_STYLE_ITALIC, TTF_STYLE_UNDERLINE.

NOTE: You can not successfully OR TTF_STYLE_NORMAL with any of the other three style flags

 

Use

CTextMngr text;
// format text
FontStyle("my_text", (TTF_STYLE_BOLD | TTF_STYLE_ITALIC));
// no formatting
text.SetFontStyle("my_text", TTF_STYLE_NORMAL);
 

Prev: SetFontPoint
Next: SetSelect