Tymless Tutorial: Drawing



   
  < colour

Animation

 
simple loops >
 

Drawing

Control

Data

Reference

 

Tymless has a number of keywords which help you create animations. Before we look at these, let us quickly check how Tymless creates simple static images.

When a Tymless program runs, it may encounter many instructions to create shapes. As each shape is created it is stored in a list until the program ends. Then the shapes are resized so the image fits the screen, and the image is drawn.

The animation commands allow you to take more control over this sequence of actions. By repeatedly moving or recolouring shapes then repainting the image you can create the effect of dynamic movement. Between repaints you can delete all the shapes and create new ones. You can also repeatedly save the image to bitmap files. Various programs are available which will convert your bitmaps into a single animated GIF file that you can view in a browser.

Here is a summary of the 'animation commands':

  • clearpaint
    clears the screen and draws all the shapes
  • paintimage
    draws the shapes without clearing the screen first. Use this to build up an image layer by layer
  • saveimage filename
    tells Tymless to clear the screen, draw all the shapes and save the image to the named file
  • clearsave filename
    is similar but does not clear the screen first
  • clearshapes
    deletes all the shapes stored by Tymless, allowing you to create new shapes without having to repaint the old

     

   
  < colour
 
simple loops >