Main Menu


Sponsored Links

  


  
  

Help - Using Characters

Web Cartoon Maker has an online library of ready to use characters. Each character is a class derived from one of the following interfaces:

In order to use a ready to use character you must include appropriate header file. Full list of available ready to use characters can be found here together with information about header files required.

Each of the character classes introduce the particular character parts: legs, hands, head, eyes, mouth and everything else applicable to this particular character. Every part is an instance of class Part. Characters and parts can be moved or transformed at the current moment in current scene. Here is a simple ready to use example:

#include <boy.h>

void Scene1 ()
{
Boy Max;
Max.SetVisible ();

SetTime ( 0 );
Max.SetPos ( 300, 0 );
Max.SetScale ( 0.5 );
Max.Head.SetAngle ( 0 );

SetTime ( 5 );
Max.SetPos ( -300, 200 );
Max.SetScale ( 1 );
Max.Head.SetAngle ( 5 );
}

You can make a character's part visible or invisible after current moment in scene using this method:

void Part::SetVisible ( boob bVisible )

You can use the following methods to move, rotate, scale etc. character parts:

void Part::SetXShift ( double dX )
void Part::SetYShift ( double dY )
void Part::SetShift ( double dX, double dY )

void Part::ChangeXShift ( double dX, double dDuration )
void Part::ChangeYShift ( double dY, double dDuration )
void Part::ChangeShift ( double dX, double dY, double dDuration )

You can use these methods to move a part relative to its origin after a current moment in the scene. If you use a Set... function and these parameters were explicitly set before then a part is moved smoothly. If you use a Change... function then a part is always moved smoothly from its current position to a new one during dDuration number of seconds.

void Part::SetAngle ( double dAngle )

void Part::ChangeAngle ( double dAngle, double dDuration )

You can use this method to rotate a part relative to its origin after a current moment in the scene. If you use a Set... function and the parameter was explicitly set before then a part is rotated smoothly. If you use a Change... function then a part is always rotated smoothly from its current angle to a new one during dDuration number of seconds.

void Part::SetXScale ( double dXScale )
void Part::SetYScale ( double dYScale )
void Part::SetScale ( double dScale )

void Part::ChangeXScale ( double dXScale, double dDuration )
void Part::ChangeYScale ( double dYScale, double dDuration )
void Part::ChangeScale ( double dScale, double dDuration )

You can use these methods to make a part smaller or bigger after a current moment in the scene. Value less than 1 means that part is smaller than original. Value bigger than 1 means that part is bigger than original. If you use a Set... function and the parameter was explicitly set before then the size is changed smoothly. If you use a Change... function then a part is always changing its size smoothly from its current scale factor to a new one during dDuration number of seconds.

void Part::SetDecal ( const string &sDecal )

You can use this method to change a part decal after current moment in scene to one of the decals registered for this part. For example human eyes usually have "DEFAULT", "WINK1" and "WINK2" decals registered.

bool Part::GetVisible ( boob bVisible )

You can use this method to know if a character's part is visible or invisible at the current moment in scene

double Part::GetXShift ()
double Part::GetYShift ()

You can use these methods to determine a current part shift relative to its origin

double Part::GetAngle ()

You can use this methods to determine a current part angle relative to its origin

double Part::GetXScale ()
double Part::GetYScale ()

You can use these methods to determine a current part scale factor

string Part::GetDecal ()

You can use this methods to determine a current part decal assigned. Please keep in mind that you should use it immediately before executing any other method or copy to your buffer. The returned pointer may point to improper value after executing another method.

Some character interfaces allow you to use advanced methods to work with a character

virtual void ISpeakableCharacter::Says ( const string &sText, double dVolume = 1, double dLipSpeed = 6 )

You can use this methods to make your character to speak. sText could be any text which will be converted to audio using a text to speech engine then. Alternatively it can point to a WAV file from your hard drive like "c:\\myaudio.wav", from the internet like "http://www.webcartoonmaker.com/lib/sounds/effects/gunshot.wav" or from our online library like "effects/gunshot.wav". When parameter dVolume is less than 1 the audio is played quieter than original. When it is greater than 1 it is played louder. dLipSpeed parameter can change a number of lip decal changes per second during the speech. Please note that this function does not change the current scene time. You should use Sleep () or SetTime () function to wait for speech completion. Use your best guess to estimate how much time is required to say something.

virtual void IHumanCharacter::WinksLeft ( double dDuration = 0.5 )
virtual void IHumanCharacter::WinksRight ( double dDuration = 0.5 )
virtual void IHumanCharacter::Winks ( double dDuration = 0.5 )

You can use this methods to make your character to wink. You can optionally supply a duration of a wink action

virtual void IHumanCharacter::GoesTo ( double dX, double dY, double dDuration, double dStepDuration = 1 )

You can use this methods to simulate a walking action of a human like character. You should supply the target coordinates and duration of the action in seconds. You can optionally supply a duration of one single step in seconds.

You can also use all the IObject methods with characters:

Help - Methods Derived from IObject

These methods can be used with any objects in your cartoons

void IObject::SetVisible ( int bVisible = true )

This method makes an object visible or invisible after the current moment in scene

void IObject::SetX ( double dX )
void IObject::SetY ( double dY )
void IObject::SetPos ( double dX, double dY )

These methods change an object position after the current moment in scene. If a position was explicitly set before, it will be changed smoothly causing your object to move

void IObject::SetAngle ( double dAngle )

This method sets an object angle after the current moment in scene. If it was explicitly set before, it will be changed smoothly causing your object to rotate

void IObject::SetXScale ( double dXScale )
void IObject::SetYScale ( double dYScale )
void IObject::SetScale ( double dScale )

These methods change an object size after the current moment in scene. If it was explicitly set before, it will be changed smoothly causing your object to increase or decrease in size. If parameter is greater than 1 an object will be bigger than original. If parameter is less than 1 an object will be smaller than original

void IObject::SetTransparency ( double dTransp )

This method changes an object transparency after the current moment in scene. Parameter between 0 and 1 is expected. 0 means that an object in not transparent at all. 1 means that and object is fully transparent and invisible. Any value between 0 and 1 makes and object semi-transparent. If this parameter was explicitly set before, it will be changed smoothly causing your object to appear or disappear

void IObject::SetMirror ( int bMirror )

This method can flip your object horizontally (when bMirror=true) and restore it back (when bMirror=false) after the current moment in scene.

int IObject::GetVisible ()

You can use this method to determine if an object is visible at a current moment in the scene. When it is visible true is returned. Otherwise false is returned

double IObject::GetX ()
double IObject::GetY ()

You can use these methods to determine an object coordinates at a current moment in the scene.

double IObject::GetAngle ()

You can use this method to determine an object angle at a current moment in the scene.

double IObject::GetXScale ()
double IObject::GetYScale ()

You can use these methods to determine an object scale factors at a current moment in the scene.

double IObject::GetTransparency ()

You can use this method to determine an object transparency at a current moment in the scene. The returned value is between 0 and 1. 0 means that an object in not transparent at all. 1 means that and object is fully transparent and invisible. Any value between 0 and 1 means that an object is semi-transparent

int IObject::GetMirror ()

You can use this method to determine if an object is flipped horizontally. When it is flipped true is returned. Otherwise false is returned

void IObject::ChangeX ( double dX, double dDuration )
void IObject::ChangeY ( double dY, double dDuration )
void IObject::ChangePos ( double dX, double dY, double dDuration )
void IObject::ChangeAngle ( double dAngle, double dDuration )
void IObject::ChangeXScale ( double dXScale, double dDuration )
void IObject::ChangeYScale ( double dYScale, double dDuration )
void IObject::ChangeScale ( double dScale, double dDuration )
void IObject::ChangeTransparency ( double dTransp, double dDuration )

These Change... methods are similar to their Set... analogs except they require duration parameter. They do following:

  1. Fix current value of a parameter (before changing it)
  2. Sleep for dDuration seconds
  3. Set a new parameter value

As a result of this you can easily change a parameter smoothly from its current value to a new value during dDuration numer of seconds. It is preferable to use these Change... functions instead of Set... in almost all cases unless you know what are you doing

You can also read the tutorial topic about using characters in Web Cartoon Maker.

  
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