Nice Info  -  animated sprites in windows

by Andrew Miles


Do you think info boxes and other desktop windows look boring? Wouldn't it be nice if they could just spring to life? If the answer to this question is yes, then this program could be just what you need! It provides a set of routines which allow you to include an smooth animation in an info box, or indeed any other window.

A demonstration of the technique can be seen by running the program, either from the RISC User menu system, or by double-clicking on its icon in a directory viewer. An icon will be installed on the icon bar.

Clicking Menu on the icon bar icon presents you with the standard icon bar menu, containing two options: Info and Quit. Choosing the latter option terminates the program, while moving the pointer across the Info item opens an info box as usual, but this time with a difference: it contains a moving picture!

The demo program uses a rotating globe for the animation, which is made up from a number of sprites in a file within the application called Sprites. It would be very easy to change the animation by replacing the sprites in this file with your own. The animation can be made up from any number of sprites, since the program will simply cycle through all the sprites in the file.

Using the Techniques in your own Programs
To include animation in your own program's windows all you need to do is copy the following procedures from NiceInfo into your program:

PROCloadsprites(file$,size%)
This procedure loads a sprite file which has a filename of file$ and is size% bytes long. This procedure should be called at the start of your program.

PROCupdateinfo(whandle%,ihandle%)
This procedure produces an animation in window whandle% and icon ihandle%. The procedure should be called when "Wimp_Poll" returns a null event.

PROCsetsprites(whandle%,ihandle%,sprite$)
This procedure is called by PROCupdateinfo.

PROCsetstate(whandle%,ihandle%,clear%,eor%)
This procedure is called by PROCsetsprites.

Note:
The routines use the variables sprite% and number%.  Therefore it is important that these variables are not used in your program.


Copyright  RISC User 1994
