This might sound simple, but a nice interface can be very complex. Most likely you will need to use variables. I am going to assume that you already know what those are, if you dont just post. You will need a variable for which portrait it is going to display. This is fairly simple. When you click the left arrow decrease that variable. When you click the right increase that variable. There are several ways to do buttons, there isin't any really right or wrong way to do it as long as it works. The method I use for standard buttons is a function. By a standard button I mean one that has a default position ie mouse isint over it, a hover position ie mouse is over it, and a down position ie you clicked the button. It also acts like regular buttons you would see in windows, that is that you can click it and it won't do anything untill you release the mouse button. If you drag the mouse pointer off the button it will go back to the default position unless you move the mouse back then it goes back to the down position. This is fairly complicated like I said. You will probably want to start off with a simple button, if you want the more advanced version like I am talking about just post. One of the easiest buttons to make is the regular square button. This method uses the mouses x and y position. This works like the following:
If mousex()>10 and mousex()<20
if mousey()>10 and mousey()<20
`display hover image
if mouseclick()=1
decrease portraitnum#
endif
endif
endif
This will create a button at the top left of the screen it is a 10x10 box that starts a 10x, and 10y. This button is invisable unless you tell it to draw a picture there. The picture will no affect the button. Square boxes are simple quick and effictive.
I have heard of methods using sprites for buttons and having a custom curser tat is a sprite for the mouse cursor. All you have to do is check for sprite collision this way. I assume it works something like:
`sprite 1 is the mouse cursor
`sprite 2 is the button (left arrow)
do
sprite 1,mousex(),mousey(),1
if sprite collision(1,2)=1 and mouseclick()=1
dec portraitnum#
endif
loop
What this does is it positions the cursor at the mouses position and checks to see if the two sprites are overlapping and the mouse is clicked then it will decrease the portrait number variable. You would need to hide the mouse and position the arrow sprite.
I would just use the sprites to do this, as its an easy method.
You will need to load your images first.
load image "cursor.bmp",1
load image "leftarrow.bmp",2
`load all of your protraits here starting with portriat number 1 as image 100
hide mouse
sync on :sync rate 60
portrait#=1
totalportraits#=10 `change this value to however many sprites there are.
do
cls
paste image portrait#+99,300,100
sprite 2,300,400,2
sprite 1,mousex(),mousey(),1
if sprite collision(1,2)=1 and mouseclick()=1
dec portrait#
if portrait#=0 then portrait#=totalportraits#
endif
sync
loop
I havent tried the code, but it compiles without any errors.
When life hands you lemons go buy some oranges to make orange juice, and stop expecting everything to be given to you.