An attractive animation will look good on your GUI if we don't overdo it.  When we think of animations, SPRITES or GIF images usually come to mind.  One problem, Just Basic does not display GIF images so we have to convert them to BMP images and display them in rapid succession to give the impression of animation.

A GIF image contains two or more frames (individual images).  To separate these, you can use any animation program.  Around 1995, MS made a free GIF animator available for download, but I've been unable to find it on the MS website.  I did find it this month at www.jhepple.com/gif_animator.htm and you may want to download this utility, while it's still available, in the event you want to work with GIF images in the future.

The image I'm going to use for this DEMO is the animated LB Torch, which consists of six frames.  The image was first opened with MS GIF Animator, then each frame was copied and pasted into MS Paint.  (You may wonder why I didn't use one of the many third party animation programs available, I simply wanted to do this in a manner which anyone could copy without purchasing additional software.)

Each frame of the animation will have to be saved as a BMP image with a unique ID; in this case I named them torch1 through 6.  The torch animation saved from the web has a transparent background, meaning it can be placed over any background the the back color will show through.  Transparency is not possible with BMP images, so I filled the background with gray while still in paint.  Plan ahead when doing this as the background color will determine the color you use for your GUI, unless you want the image to appear it a graphicbox with it's own color.  You can choose from any of JB's standard colors to fill your GUI and graphicbox.

The code for this DEMO is straight forward and very similar to code you would use to display animated SPRITES, except we're using DRAWBMP rather than DRAWSPRITE, and we have to write code to cycle the images because we can't use the CYCLESPRITE command with non-sprite images.
[code]
'Add LB Torch to graphic window

NOMAINWIN

WindowWidth=200
WindowHeight=200
UpperLeftX=INT((DisplayWidth-WindowWidth)/2)
UpperLeftY=INT((DisplayHeight-WindowHeight)/2)

LOADBMP "#1", "torch1.bmp"
LOADBMP "#2", "torch2.bmp"
LOADBMP "#3", "torch3.bmp"
LOADBMP "#4", "torch4.bmp"
LOADBMP "#5", "torch5.bmp"
LOADBMP "#6", "torch6.bmp"

GRAPHICBOX #main.gbx1, 0, 0, 200, 200
BUTTON #main.btn, "CLOSE", [quit], UL, 70, 130, 60, 30

OPEN "Liberty Basic Torch" for WINDOW AS #main
PRINT #main, "trapclose [quit]"
    PRINT #main.gbx1, "backcolor buttonface"
    PRINT #main.gbx1, "font arial 18 bold"
    PRINT #main.gbx1, "down"
    PRINT #main.gbx1, "color blue"
    PRINT #main.gbx1, "place 10 75"  'Place the pen here for text.
    PRINT #main.gbx1, "\Liberty Basic is"+CHR$(13)+" great fun too!"
    PRINT #main.gbx1, "flush"
    WHILE 1=1  'Causes endless loop to display BMP images
        img=img+1  'Image frame to display
        PRINT #main.gbx1, "drawbmp #"; img; " 10 10"  'Display left torch.
        PRINT #main.gbx1, "drawbmp #"; img; " 160 10"  'Display right torch.
        IF img=6 THEN img=0
        TIMER 150, [continue]  'Animation speed
        WAIT
        [continue]
        TIMER 0
    WEND

WAIT
[quit]
    UNLOADBMP "#1"
    UNLOADBMP "#2"
    UNLOADBMP "#3"
    UNLOADBMP "#4"
    UNLOADBMP "#5"
    UNLOADBMP "#6"
    CLOSE #main
    END
[/code]
First a window is defined and then all six BMP images are loaded with the LOADBMP command.  At first I simply gave each image a working name of 1, 2, 3, etc, but JB could not find the images.  Working names must be a string, so using #1, #2, and #3 worked fine.

A GRAPHICBOX was added to the window and is sized to fill the window with no margins.  The fill color of the window is "buttonface," the same shade of gray as the background of my BMP images.  This provides the illusion of a transparent background.  A font and text color is assigned to the GRAPHICBOX and then we begin an endless loop to animate the images.

WHILE 1=1 should be true in all cases (at least I hope it will!) and the WHILE/WEND loop will continue forever until we interrupt it with CLOSE.  The image counter is incremented each time through the loop to print the next image with the DRAWBMP command.  There are 6 images, so the counter is reset to 0 immediately after printing image 6.  A timer slows down the animation so our torch will not burn out too quickly and leave us reading in the dark.

If we wish to use a GIF image in Just Basic, we cannot avoid the many steps required to extract individual frames and save them as BMP images.  In Liberty Basic, there are several DLL calls which can be made to make it possible to display JPG, ICO, WMF and even AVI files (See LB NL#111), but we have to accept the limitations of Just Basic and devise a suitable work-around.  Adding animations to your GUI is not impossible, we just have to work a little harder to accomplish the same task.

