Main Menu


Sponsored Links

  


  
  

Help - Global Functions

There are several global functions defined in Web Cartoon Maker

          
void Sleep ( double dSeconds )

This function changes the current scene time moving it forward by dSeconds seconds.

          
void SetTime ( double dSeconds )

This function sets the current scene time in seconds.

          
double GetTime ()

This function returns the current scene time in seconds.

          
void Play ( const char *sFile, double dVolume = 1, int iMixMode = MIXMODE_MIX );

You can play audio files in your Web Cartoon Maker movie. Audio files should be in WAV format and appropriate audio codecs must be installed on your computer. You should use this function to Play an audio file. sFile can point to an audio file in online Web Cartoon Maker library (for example "people/applause.wav"), your local file (for example "c:\\myaudio.wav") or any online audio in WAV format (for example "http://www.mywebsite.com/myaudio.wav"). dVolume is actually a volume. If dVolume it set to 1 the volume is the same as in audio file. If dVolume is set to zero, no audio is playing. When you play an audio file, it is mixed with another sounds in your movie. The following mix modes are supported:

  • MIXMODE_MIX - audio is mixed with other sounds
  • MIXMODE_REPLACE - audio replaces all other sounds
  • MIXMODE_REPLACEFADE - audio replaces all other sounds smoothly
  • MIXMODE_DAMP - audio is mixed with other sounds but volume of other sounds is decreased
  • MIXMODE_DAMPFADE - audio is mixed with other sounds but volume of other sounds is decreased smoothly

Please keep in mind that playing a WAV file does not influence on movie length. If your movie is finished before WAV file finished to play then it is going to be truncated. If you WAV file cannot be found or cannot be played because of unsupported format then no errors will be reported but no sound will play

          
void SetCameraX ( double dX )
void SetCameraY ( double dX )
void SetCameraPos ( double dX, double dY )

void ChangeCameraX ( double dX, double dDuration )
void ChangeCameraY ( double dX, double dDuration )
void ChangeCameraPos ( double dX, double dY, double dDuration )

You should use these function to change the virtual camera position after a current time in the scene. Camera movement is an equivalent of moving every single object in your scene in opposite direction. Default camera location is (0,0). If you use a Set... function and the camera position was explicitly set before then camera is moving smoothly. If you use a Change... function then the camera is always moving smoothly from its current position to a new one during dDuration number of seconds

          
void SetCameraAngle ( double dAngle )

void ChangeCameraAngle ( double dAngle, double dDuration )

You should use this function to change the virtual camera angle after a current time in the scene. Camera rotation is an equivalent of rotation of every single object in your scene in opposite direction relative to current camera position. If you use a Set... function and the camera angle was explicitly set before then camera is rotating smoothly. If you use a Change... function then the camera is always rotating smoothly from its current angle to a new one during dDuration number of seconds.

          
void SetCameraZoom ( double dZoom )

void ChangeCameraZoom ( double dZoom, double dDuration )

You should use this function to change the virtual camera zoom after a current time in the scene. Camera zoom is an equivalent of resizing the entire scene. If dZoom < 1 then the camera zooms out and all objects become smaller. if dZoom > 0 then the camera zooms in and all objects become bigger. If you use a Set... function and the camera zoom was explicitly set before then camera is zooming smoothly. If you use a Change... function then the camera is always zooming smoothly from its current zoom factor to a new one during dDuration number of seconds

          
double GetCameraX ()
double GetCameraY ()
double GetCameraAngle ()
double GetCameraZoom ()

These functions retrieve the current camera parameters

          
void SetMovieSize ( int iWidth, int iHeight )

You should use this function only once during your entire movie. This function sets the movie dimensions. You can also resize your movie later when exporting to AVI format from WCM player almost without loosing quality (if only vector graphics is used)

string IntToString ( int iFrom )
string DoubleToString ( double dFrom )
string CharToString ( char cFrom )
int StringToInt ( const string &sFrom )
int StringToDouble ( const string &sFrom )

These functions can be used to explicitly convert from вшааукуте types to strings

string UpperCase ( const string &sWhat )
string LowerCase ( const string &sWhat )

These function can be used to convert a string to upper or lower case

double DegreesToRadians ( double dDegrees )
double RadiansToDegrees ( double dRadians )

These function can be used to convert between different angle units

double Sin ( double dAngle )
double Cos ( double dAngle )
double Tan ( double dAngle )
double ASin ( double dSin )
double ACos ( double dCos )
double ATan ( double dTan )
double Pow ( double dX, double dN )
double Exp ( double dX )
double Log ( double dX )
double Sqrt ( double dX )
double Rand ()

These are math functions. Keep in mind that all angles are in degrees, not in radians lilke in classic C++. This is because it is more convenient for cartoons

void ShowText ( const string &sText, double dDuration = 1, double dX = 0, double dY = 0, int iSize = 50, const string &sColor = "FFFF00", const string &sStyle = "" )

This function can be used to display a text for desired amount of seconds (default is one). It is very useful for debugging. You can supply not only a string but int, double, char or bool value and these will be automatically converted to a string

  
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