Main Menu


Sponsored Links

  


  
  

Tutorial - Coordinates

You know about objects and how to use them now. Int previous topics we used coordinates to move objects using SetPos () methods. What do these coordinates mean? What is the movie size?

The default movie size is 800x600 pixels. You can change it by using SetMovieSize () function. For example if you want to make a high definition 1280x720 pixels movie you can do this using this instruction:

SetMovieSize ( 1280, 720 );

You should use this function only once in your script, preferably at the beginning. If you use this function more than one time, the latest size will be set.

The origin of your movie is in the center and has (0, 0) coordinates. Axis X points to the right. Axis Y points down. The default coordinates of the left upper corner are (-400, -300). The default coordinates of the right bottom corner are (400, 300). If you change your movie size to high definition resolution 1280x720 as described above then the left upper corner will be (-460, -360) and the right bottom corner will be (-460, -360).

There is another reason why coordinates can change. Web Cartoon Maker supports 2D camera which can be moved across your movie and zoom in and out. We do not want to give you details on camera yet. Just want to give you a simple example. If you use ChangeCameraZoom () function to zoom out like this:

ChangeCameraZoom ( 0.5, 1 );

then the default coordinates of movie corners will be (-800,-600) and (800,600).

Here is what you can try after reading this. We have a special image in our library which can show you the coordinates. We never used Image objects yet, but it is really simple:

  1. Copy and paste the following script to Web Cartoon Maker:
    void Scene1 ()
    {
        Image Back ( "wcm/coordinates.emf" );
        Back.SetVisible ();
    }
    
  2. Compile it and preview in WCM player to view the default movie coordinates
  3. Move mouse over the WCM Player window. Current movie coordinates will be displayed as a tooltip near the mouse
  4. Delete the script and copy and paste another one:
    void Scene1 ()
    {
        // setup a background
        Image Back ( "wcm/coordinates.emf" );
        Back.SetPos ( 0, 0 );
        Back.SetVisible ();
    
        // wait
        Sleep ( 1 );
    
        // zoom in 
        ChangeCameraZoom ( 0.5, 1 );
    
        // wait
        Sleep ( 1 );
    }
    
  5. Compile your new script, preview in WCM Player and note how camera zooming can change the coordinates

previous topic next topic

  
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