A contribtution to all who have helped me. My menu so far that can be textured. Still working on making the items clickable...
rem Set sync
sync on
sync rate 60
rem Create an item list 1 item name 2 function to call 3 if have at all 4 is how many
dim Itemgrid$(5,4)
itemgrid$(1,1)="Small Hp Potion"
itemgrid$(1,2)="smplushp"
itemgrid$(2,1)="Meduim Hp Potion"
itemgrid$(2,2)="mdplushp"
itemgrid$(3,1)="Large Hp Potion"
itemgrid$(3,2)="lgplushp"
itemgrid$(4,1)="Small Mp Potion"
itemgrid$(4,2)="smplusmp"
itemgrid$(5,1)="Meduim Mp Potion"
itemgrid$(5,2)="mdplusmp"
rem Varibles and presets
plife#=100000
itemgrid$(1,3)="1"
itemgrid$(3,3)="1"
itemgrid$(5,3)="1"
rem Create simple landscape
make matrix 1,10000.0,10000.0,25,25
randomize matrix 1,50.0
position camera 5000,200,5000
rem Set to screen and varibles
set current bitmap 0
draw to front
ink rgb(250,0,12),0
menu=0
rem Start main loop
do
rem Control camera with arrow keys
if upkey()=1 then move camera 10.0
if downkey()=1 then move camera -10.0
if leftkey()=1 then angley#=wrapvalue(angley#-2.0)
if rightkey()=1 then angley#=wrapvalue(angley#+2.0)
rem Update camera
xrotate camera 0.0
yrotate camera angley#
zrotate camera 0.0
rem Create menu button with function
ink rgb(25,70,255),0
box 0,0,50,20
ink rgb(0,0,0),0
set cursor 2,2
print "Menu"
clicked=0
if mouseclick()=1
if mousex()>=0 and mousex()=<50
if mousey()>=0 and mousey()=<20
clicked=1
endif
endif
endif
if clicked=1 then goto inventory
menureturn:
rem Syncronise
sync
rem End main loop
loop
inventory:
rem Set to screen and varibles
set current bitmap 0
draw to front
ink rgb(250,0,12),0
menu=0
rem Make the inventory screen
make object plain 487,400,400
rem load image "misc/skin1.bmp",1
rem texture object 487,1
rem delete image 1
lock object on 487
position object 487,0,0,400
scale object 487,120,100,500
wait 100
do
rem Print base menu
if menu = 0
set cursor 100,60
print plife#
ctime$ = get time$()
set cursor 160,60
print ctime$
ink rgb(0,255,0),0
box 100,90,170,110
ink rgb(0,0,0),0
set cursor 105,90
print "Inventory"
if mouseclick()=1
if mousex()>=100 and mousex()=<170
if mousey()>=90 and mousey()=<110
wait 100
menu = 1
endif
endif
endif
endif
itemgrid$(1,3)="1"
itemgrid$(3,3)="1"
itemgrid$(5,3)="1"
rem Print Item menu
if menu = 1
pa = 120
for x = 1 to 5
if itemgrid$(x,3) = "1"
set cursor 100,pa
pa = pa + 20
print itemgrid$(x,1)
endif
next x
ink rgb(0,255,0),0
box 100,90,180,110
ink rgb(0,0,0),0
set cursor 105,90
print "Main Menu"
if mouseclick()=1
if mousex()>=100 and mousex()=<170
if mousey()>=90 and mousey()=<110
wait 100
menu = 0
endif
endif
endif
endif
rem Exit menu execution
ink rgb(250,0,12),0
box 525,50,550,75
ink rgb(255,255,255),0
set cursor 534,55
print "X"
if mouseclick()=1
if mousex()>=525 and mousex()=<550
if mousey()>=50 and mousey()=<75
wait 100
exit
endif
endif
endif
if inkey$()="i"
wait 100
exit
endif
rem Refrsh the screen
sync
loop
delete object 487
goto menureturn
return
return
return