new AnimatedPNG(name, firstImage, imageCount, delay);
||The name of the animation object.|
||The filename of the first image of the animation.|
||The number of frames in the animation.|
||The number of milliseconds to wait between each frame of the animation.|
This is used to create and initialise the animation with the basic settings.
name, on which the
other functions are invoked to alter its behaviour.
firstImage parameter specifies the filename of the first frame of the animation.
This should be in the same directory as the current page, and should be of the form
<letters><numbers>.png. The library will automatically calculate the filenames
of the subsequent frames by deconstructing the filename. If you wish to zero-pad
the numbers in the filename, that will also be detected automatically.
Some suitable filename formats are as follows:
delay parameter will set the delay between all the frames in the animation.
If you wish to set different delays for some frames, you can use the
Note: This constructor will not actually draw the animation in the page.
You must call the
draw function to display the animation.
||Indicates whether the animation should start immediately or not.|
Draws the animation in the page. This can be called directly after the constructor, or after other function calls if you wish to alter the animation’s settings before it is drawn.
delayStart is set to false (the default), the animation will be started immediately.
If true, the animation will not be started until
is called. You can add
to the onload attribute to delay the animation until the whole page has loaded.
||Indicates whether the animation will repeat when it completes.|
Specifies whether or not the animation will repeat when it completes.
repeatFlag is set to
true when the animation is not running, it will be restarted.
||The frame number for which the delay will be set.|
||The frame delay in milliseconds.|
Sets the delay for an individual frame of the animation. This will override the delay specified in the constructor.
Restarts the animation if it has been stopped.
Stops the animation on the current frame.