January 20, 2021, 10:46:35 AM

### Author Topic: [bmx] Menu by jankupila [ 1+ years ago ]  (Read 1298 times)

#### BlitzBot

• Jr. Member
• Posts: 1
##### [bmx] Menu by jankupila [ 1+ years ago ]
« on: June 29, 2017, 12:28:43 AM »
Author : jankupila
Posted : 1+ years ago

Description : How to make simple menu

Code :
Code: BlitzMax
1. Graphics 800,600,16,60,1
2.
3. Const x:Int=50
4. Const y:Int=100 '       place of the list
5.
6. t=1
7.
8. Repeat
9.         Cls
10.
11.         SetColor 255,255,255
12.         If t=1 Then
13.                 SetColor 255,0,0
14.                 DrawText "Chosen number 1",200,200
15.         End If
16.         DrawText "Choice 1",x,y
17.
18.         SetColor 255,255,255
19.         If t=2 Then
20.                 SetColor 255,0,0
21.                 DrawText "Chosen number 2",200,200
22.         End If
23.         DrawText "Choice 2",x,y+20
24.
25.         SetColor 255,255,255
26.         If t=3 Then
27.                 SetColor 255,0,0
28.                 DrawText "Chosen number 3",200,200
29.         End If
30.         DrawText "Choice 3",x,y+40
31.
32.         SetColor 255,255,255
33.         If t=4 Then
34.                 SetColor 255,0,0
35.                 DrawText "Chosen number 4",200,200
36.         End If
37.         DrawText "Choice 4",x,y+60
38.
39.         SetColor 255,255,255
40.         If t=5 Then
41.                 SetColor 255,0,0
42.                 DrawText "Chosen number 5",200,200
43.         End If
44.         DrawText "Choice 5",x,y+80
45.
46.         If KeyHit(KEY_UP) Then t=t-1
47.         If KeyHit(KEY_DOWN) Then t=t+1
48.
49.         If t=0 Then t=5
50.         If t=6 Then t=1
51.
52.         Flip
53.
54. Until KeyDown(KEY_ESCAPE)
55.
56. End

_33(Posted 1+ years ago)

choice

jankupila(Posted 1+ years ago)

`SuperStrictGraphics 1024,768,1Local x:Int=50Local Y:Int=50Local Choise:Int=0RepeatDrawText "Choise 1",x,yDrawText "Choise 2",x,y+20DrawText "Choise 3",x,y+40DrawText "Quit",x,y+60DrawText "<==",x+70,Choise*20+50Flip;Cls If KeyHit(key_up) Then Choise=Choise-1If KeyHit(key_down) Then Choise = Choise +1If Choise = -1 Then Choise =3If Choise=  4 Then  Choise =0If Choise = 0 And KeyHit(key_return) Then go_to_0()If Choise = 1 And KeyHit(key_return) Then go_to_1()If Choise = 2 And KeyHit(key_return) Then go_to_2()If Choise = 3 And KeyHit(key_return) Then EndForeverFunction go_to_0() Cls DrawText "Chosen number 1",50,200 Flip Delay(1000)End FunctionFunction go_to_1() Cls DrawText "Chosen number 2",50,200 Flip Delay(1000)End FunctionFunction go_to_2() Cls DrawText "Chosen number 3",50,200 Flip Delay(1000)End Function`