Sliding Menu or whatever it is called..
Remmed codes have nothing to do with this snippet so you can ignore them, attached is a 17kb media for the button images, put them in the same folder as your project.
Rem ***** Main Source File *****
REMSTART
REM PATH GLOBAL VARIABLES
GLOBAL pthRoot As String
GLOBAL pthImg As String
pthRoot = GET DIR$( )
pthImg = pthRoot+"/../Media/Images/menuImages/"
REM SCREEN GLOBAL VARIABLES
GLOBAL scrFps As Integer
GLOBAL scrF As Integer
GLOBAL scrW As Integer
GLOBAL scrH As Integer
GLOBAL scrD As Integer
scrFps = 60
scrF = 62
scrW = 800
scrH = 600
scrD = 32
REMEND
REM Types
Type checklist
s As String `String
a As Integer `checklist a
b As Integer `checklist b
c As Integer `checklist c
d As Integer `checklist d
EndType
Type entityProperties
num As Integer `sprite - object
`exist As Integer `sprite - object
`visible As Integer `sprite - object
`posX As Float `sprite - object
`posY As Float `sprite - object
`posZ As Float `sprite - object
`offX As Integer `sprite
`offY As Integer `sprite
`scaleX As Integer `sprite
`scaleY As Integer `sprite
`size As Float `object
`sizeX As Float `object
`sizeY As Float `object
`sizeZ As Float `object
width As Integer `sprite
height As Integer `sprite
image As Integer `sprite
`mirrored As Integer `sprite
`flipped As Integer `sprite
`hit As Integer `sprite - object
`col As Integer `sprite - object
`colX As Float `object
`colY As Float `object
`colZ As Float `object
`ang As Float `sprite
`angX As Float `object
`angY As Float `object
`angZ As Float `object
`frame As Integer `sprite - object
`speed As Integer `object
`alpha As Integer `sprite
`red As Integer `sprite
`green As Integer `sprite
`blue As Integer `sprite
`interpolation As Integer `object
`totalFrames As Integer `object
`inScreen As Integer `object
`screenX As integer `object
`screenY As integer `object
EndType
`#CONSTANT Obj = 1
`#CONSTANT Spr = 1
`#CONSTANT Img = 2
`GLOBAL DIM O(1000, 2) As entityProperties
`GLOBAL DIM S(1000, 2) As entityProperties
GLOBAL DIM menuSlide(10, 1) As entityProperties
menuSlide(1,0).image = freeImage( )
Load Image "okSolU.png", menuSlide(1,0).image
menuSlide(1,1).image = freeImage( )
Load Image "okSolD.png", menuSlide(1,1).image
menuSlide(1,0).num = freeSprite( )
Sprite menuSlide(1,0).num, 0, 0, menuSlide(1,0).image
menuSlide(1,0).width = Sprite Width( menuSlide(1,0).num )
menuSlide(1,0).height = Sprite Height( menuSlide(1,0).num )
Offset Sprite menuSlide(1,0).num, menuSlide(1,0).width / 2.0, menuSlide(1,0).height / 2.0
menuSlide(2,0).image = freeImage( )
Load Image "okSagU.png", menuSlide(2,0).image
menuSlide(2,1).image = freeImage( )
Load Image "okSagD.png", menuSlide(2,1).image
menuSlide(2,0).num = freeSprite( )
Sprite menuSlide(2,0).num, 0, 0, menuSlide(2,0).image
menuSlide(2,0).width = Sprite Width( menuSlide(2,0).num )
menuSlide(2,0).height = Sprite Height( menuSlide(2,0).num )
Offset Sprite menuSlide(2,0).num, menuSlide(2,0).width / 2.0, menuSlide(2,0).height / 2.0
PERFORM CHECKLIST FOR DISPLAY MODES
check = CHECKLIST QUANTITY()
GLOBAL DIM menudisplayChecklist(check) As checklist
if check > 0
for f = 1 to check
menudisplayChecklist(f).s = CHECKLIST STRING$( f )
if CHECKLIST VALUE A( f ) <> 0 then menudisplayChecklist(f).a = CHECKLIST VALUE A( f )
if CHECKLIST VALUE B( f ) <> 0 then menudisplayChecklist(f).b = CHECKLIST VALUE B( f )
if CHECKLIST VALUE C( f ) <> 0 then menudisplayChecklist(f).c = CHECKLIST VALUE C( f )
next f
endif
GLOBAL menudisplayCheck = check
GLOBAL menudisplayClick
menudisplay1Item = 1
menudisplay2Item = 5
menudisplay3Item = 2
menudisplay4Item = 3
menudisplay5Item = 7
repeat
menudisplay1Item = menuSliding( 150, 50, menudisplay1Item, 1, 2 )
menudisplay2Item = menuSliding( 150, 100, menudisplay2Item, 3, 4 )
menudisplay3Item = menuSliding( 150, 150, menudisplay3Item, 5, 6 )
menudisplay4Item = menuSliding( 150, 200, menudisplay4Item, 7, 8 )
menudisplay5Item = menuSliding( 150, 250, menudisplay5Item, 9, 10 )
until returnkey()
end
Function menuSliding( x As Integer, y As Integer, menuItem As Integer, spr1 As Integer, spr2 As Integer )
If menuSlide(spr1,0).num = 0
menuSlide(spr1,0).num = freeSprite( )
Clone Sprite menuSlide(1,0).num, menuSlide(spr1,0).num
EndIf
If menuSlide(spr2,0).num = 0
menuSlide(spr2,0).num = freeSprite( )
Clone Sprite menuSlide(2,0).num, menuSlide(spr2,0).num
EndIf
w1 = menuSlide(1,0).width / 2.0
h1 = menuSlide(1,0).height/ 2.0
w2 = menuSlide(2,0).width / 2.0
h2 = menuSlide(2,0).height/ 2.0
x1 = x - w1
y1 = y - 4 + h1
x2 = x + Text Width( menudisplayChecklist(menuItem).s ) + w2
mx = mousex() : my = mousey()
if mx > x1 - w1 and mx < x1 + w1 and my > y1 - h1 and my < y1 + h1
if mouseclick() > 0 and menudisplayClick = 0 then menudisplayClick = 1
if menudisplayClick = 1
menudisplayClick = 2
REM START VALUES HERE
Sprite menuSlide(spr1,0).num, x1, y1, menuSlide(1,0).image
dec menuItem
if menuItem < 1 then menuItem = 1
endif
endif
if mx > x2 - w2 and mx < x2 + w2 and my > y1 - h2 and my < y1 + h2
if mouseclick() > 0 and menudisplayClick = 0 then menudisplayClick = 1
if menudisplayClick = 1
menudisplayClick = 2
REM START VALUES HERE
Sprite menuSlide(spr2,0).num, x2, y1, menuSlide(2,0).image
inc menuItem
if menuItem > menudisplayCheck then menuItem = menudisplayCheck
endif
endif
if mouseclick() = 0
menudisplayClick = 0
Sprite menuSlide(spr1,0).num, x1, y1, menuSlide(1,1).image
Sprite menuSlide(spr2,0).num, x2, y1, menuSlide(2,1).image
endif
Text x, y, menudisplayChecklist(menuItem).s
Text 0, y, "Option: "+str$(menuItem)
EndFunction menuItem
`---------------------------------------------------------
Function freeImage()
Repeat
Inc i
Until Image Exist(i) = 0
EndFunction i
`---------------------------------------------------------
Function freeSprite()
Repeat
Inc i
Until Sprite Exist(i) = 0
EndFunction i
`---------------------------------------------------------