| HOME | FORUM | DOWNLOADS | TUTORIAL | CODE LIBRARY | LINKS | CONTACT US |

TUTORIALS>> MAKING A SLIDE SHOW

 

Contributed by Alex Jones

 

After learning the basics with graphics the next step I recommend you try is to create a simple slideshow. This will build on the previous example with more things like showing multiple images,moving through different pictures etc.
As ever you'll need some graphics. Make in MS Paint two graphics containing anything, as long as there different and are less than 800,600 pixels in size.

First we need to say how big the screen size will be. This is the same as in the first graphics tutorial.
The Command we need is "Graphics" followed by pixels across then down. We'll use 800 by 600 pixels so:

We'll also need to let Windows know the name of our program using the "Apptitle" command.

Next we need to load in the graphics (which should be in the same folder as this .bb file will be. As in the first graphics tutorial

Then to actually draw the first image we need to use the Drawimage command followed by both the handle and the location in pixels across then down. In our example:

Then we need to say how long that the image will be displayed on the screen. There are many ways of doing this using time and/or conditions. However a very simple one is to wait for the user to press a key. The command for doing this is simply:

This means it will wait for the user to press a key on the keyboard before moving on to the next line.
Once the key is pressed we want to display another image. Firstly clear the screen:

And then another image can be displayed:

Wait for another keypress

And end the program

Of course the loop of image,waitkey,cls,image can go on for as long as you want, meaning if you want 2 or 10 images this code will allow you to do that. This techinque could be used to create an image viewer, splash screen or anything else which could be created using images displayed one after another

One step closer to creating your dream game...

Alex Jones

 

 
 
 
 

| HOME | FORUM | DOWNLOADS | TUTORIAL | CODE LIBRARY | LINKS | CONTACT US |