Table of Contents | ||||||||||
|
||||||||||
ShowText | ||||||||||
Purpose Enables or disables rendering of the text and text looping |
||||||||||
Protoype void CTextMngr::ShowText (string str_text_id, bool b_show, bool b_delay = false, exclude ex_list = exclude(), int i_flag = LIST_IN) |
||||||||||
Parameters
|
||||||||||
Description This function shows or hides text objects. You must pass in the ID of the text object that you want to show or hide for str_text_id and then pass in a flag value for showing (TRUE) or hiding (FALSE) the text object. Text Delays You can use text delays in two ways. One of the ways to use a text delay is if you want the text to show or hide for a limited amount of time. For instance a saved game message. You would create the text object using AddText() with a, say, 5 second (5000 millisecond) timer or set the delay with SetTextDelay(). When you call the function with TRUE for b_delay then the text will hide or show for 5 seconds before reverting to its previous state. The second way you can use text delays is to create blinking text. If you create a text object using AddText() and set the repeat flag to TRUE, or change the repeat flag with SetTextRepeat(), then once you show or hide text and pass TRUE for delay, the text will repeatedly revert states. The frequency of the text blinking depends on the delay set for that text object. To stop the repeat you must either show or hide the text and pass FALSE for b_repeat. Showing/Hiding Multiple Objects If you want to show/hide more than one text object at once, then you can use the last two parameters of the function. First you must compile a list (an STL vector) of objects that you want to either exclude or include. If you want to show/hide all text objects except certain ones, pass those in for ex_list along with the flag LIST_IN. If you want to show/hide only a certain set of objects, pass those in for ex_list along with the flag LIST_OUT. You should also pass ALL_TEXTS for str_text_id. |
||||||||||
Use CTextMngr text; // show one text object text.ShowText("my_text", true); // show ALL text objects except "my_text" exclude ex_list; ex_list.push_back("my_text"); text.ShowText(ALL_TEXTS, true, false, ex_list, LIST_IN); // show ONLY these three text objects exclude ex_list; ex_list.push_back("my_text1"); ex_list.push_back("my_text2"); ex_list.push_back("my_text3"); text.ShowText(ALL_TEXTS, true, false, ex_list, LIST_OUT); // hide text for 5 seconds only text.SetTextDelay("my_text", 5000); text.ShowText("my_text", false, true); |
||||||||||
|
||||||||||
|