I have a big problem: I would like to scroll 3 images between two arrow icons. These 3 images are part of more images, but I would like show these 3 ones once, therefore I need the two arrow icons to scroll. Everything is OK until this point. But I would like to scroll only if the player releases the left mouse button above the arrow icon. This is my problem, because this is not works. I can do my code at pressing the mouse button, but not in case of release. The arrow icons and the other images are consists of two subimages (pressed and released).
Here is my code:
Code: Select all
for i as ubyte=0 to 1
if scrollarrows(i).exists=1 then
dim as integer mousex,mousey,mousebutton,mouse
dim as any ptr sasprite=scrollarrows(i).itssprite
mouse=getmouse(mousex,mousey,,mousebutton)
if mouse=0 then
if (mousebutton and 1) then
if mousex>=scrollarrows(i).xplace and mousex<=scrollarrows(i).xplace+64 and mousey>=scrollarrows(i).yplace and mousey<=scrollarrows(i).yplace+64 then
select case scrollarrows(i).itssprite
case leftarrowspr(0)
sasprite=leftarrowspr(1)
case rightarrowspr(0)
sasprite=rightarrowspr(1)
end select
else
select case scrollarrows(i).itssprite
case leftarrowspr(1)
sasprite=leftarrowspr(0)
case rightarrowspr(1)
sasprite=rightarrowspr(0)
end select
end if
else'if mousex>=scrollarrows(i).xplace and mousex<=scrollarrows(i).xplace+64 and mousey>=scrollarrows(i).yplace and mousey<=scrollarrows(i).yplace+64 then
select case scrollarrows(i).itssprite
case leftarrowspr(1)
if arraystart>0 and canscrollmenu=0 then
arraystart-=1
for j as ubyte=0 to showiconnumber-1
if showicons(j).exists=1 then showicons(j).itssprite=iconarray(arraystart+j)
next j
canscrollmenu=10
end if
sasprite=leftarrowspr(0)
case rightarrowspr(1)
if arraystart+(showiconnumber-1)<numoficons-1 and canscrollmenu=0 then
arraystart+=1
for j as ubyte=0 to showiconnumber-1
if showicons(j).exists=1 then showicons(j).itssprite=iconarray(arraystart+j)
next j
canscrollmenu=10
end if
sasprite=rightarrowspr(0)
end select
end if
end if
put (scrollarrows(i).xplace, scrollarrows(i).yplace),sasprite,pset
end if
next i