Post by epikhbk1 on Apr 12, 2012 23:09:09 GMT -5
how can i add my created menu into the blitzsonic source so that it actually works?? this is my menu
Graphics3D 800,600,0,2
SetBuffer BackBuffer()
font=LoadFont("Arial",15)
SetFont font
While result=0
result=MainMenu()
;put these options inside the menu loop, as these
;return 0 - continuing the mainmenu loop.
If result=2 Then result=Options()
If result=3 Then result=Credits()
Wend
If result=1 Then StartGame()
;if the result isn't 1, then it must be 4 - hence QUIT
End
Function MainMenu()
Cls
Text 400,50,"My Menu",1,1
Rect 300,100,200,50,0
Text 400,125,"Start Game",1,1
Rect 300,200,200,50,0
Text 400,225,"Options",1,1
Rect 300,300,200,50,0
Text 400,325,"Credits",1,1
Rect 300,400,200,50,0
Text 400,425,"Quit",1,1
Flip
result=0
While result=0
mx=MouseX():my=MouseY()
If MouseHit(1) Then
If RectsOverlap(300,100,200,50,mx,my,1,1) Then result = 1
If RectsOverlap(300,200,200,50,mx,my,1,1) Then result = 2
If RectsOverlap(300,300,200,50,mx,my,1,1) Then result = 3
If RectsOverlap(300,400,200,40,mx,my,1,1) Then result = 4
End If
Wend
Return result
End Function
Function Options()
Cls
Text 400,300,"Options Screen! Any key to return to main menu",1,1
Flip
WaitKey()
Return 0
End Function
Function Credits()
Cls
Text 400,300,"Credits!!",1,1
Text 400,330,"Made by epikhbk1",1,1
Text 400,400,"Any key to return",1,1
Flip
WaitKey()
Return 0
End Function
Function StartGame()
Cls
Text 400,300,"AND you're away...",1,1
Text 400,400,"ESC to exit",1,1
Flip
While Not KeyHit(1):Wend
End
End Function