Main Menu


Sponsored Links

  


  
  
Web Cartoon Maker: a Fun Way to Learn C++ Contents Previous Next

Methods Unique to Text Objects

There are also some "set", "get" and "change" methods to work with text objects only. You already know one of them: SetText , which can change the default text associated with a text object at a current time in cartoon scene. Here is a full list of functions specifically designed to work with text objects

  • SetText – accepts one string parameter. Changes the text associated with a text object. It is even possible to declare a text object without parameters, which is equal to a text object initiated with an empty string, and then use SetText to change it at a desired moment in your cartoon:

void Scene1 ()

{

Text MyText;

Sleep ( 5 );

MyText.SetText ( "5 seconds passed" );

Sleep ( 5 );

}

  • SetFont – accepts one string parameter – Windows font name. Changes the fonts associated with a text object. You can see the fonts available on your machine by clicking on the font icon in the Control Panel. You can also add or remove fonts there.

  • SetStyle - accepts one string parameter. The string may contain some of the following letters: B, I, U or S, specifying the font style in use. These letters are responsible for bold, italic, underlined and stroked out styles respectively. For example if you want to make a text italic and stroked out, you should supply "IS".

  • SetColor - accepts one string parameter. The string contains a hex encoded color in "RRGGBB" format. For example if you want to use a green color, you should supply the hex value "00FF00".

Note: You can find the RGB decimal values for any color by clicking on the color box in Paint and selecting “custom Color.” The Scientific Calculator available in “Accessories” will do the decimal to hex conversion for you. Be sure to convert the red, green and blue numbers separately.

  • SetSize – accepts one int parameter – windows font size. Changes the font size associated with a text object

  • GetText – requires no parameters and returns a string – a text currently associated with a text object

  • GetFont – requires no parameters and returns a string – a Windows font name currently associated with a text object

  • GetStyle – requires no parameters and returns a string with encoded text style associated with a text object. Pease see SetStyle for encoding format.

  • Get Color – requires no parameters and returns a string with encoded text color associated with a text object. Pease see SetColor for encoding format.

  • GetSize – requires no parameters and returns an integer value – windows font size associated with a text object

  • ChangeSize – as I already mentioned, all "set" methods with numerical parameters have a corresponding "change" method. ChangeSize accepts 2 parameters – int for font size and double for duration. It inserts two control points and changes the font size smoothly between them during specified number of seconds.


Contents Previous Next
  
News

New Tales Animator Video by Alan Sturgess

Alan Sturgess shared an excellent video he made using Tales Animator! You can still download Tales Animator here. Unfortunately it is only available for Wi

...

Simple Online Character Designer

There is a prototype of simple online character designer available HERE. It is only a prototype, it does not contain many pieces yet but it can already generat

...

Book is updated

Now our book "Web Cartoon Maker: A Fun Way to Learn C++" is fully in synch with WCM 1.5! It is available for download and online reading HERE.

...

Web Cartoon Maker 1.5 is here!

Web Cartoon Maker 1.5 is finally here! You can download it HERE! Here is what was updated in version 1.5: Web Cartoon Maker Desktop Edition is now fully standal

...

read more news...


Poll