Ooops
October 28, 2020, 11:41:53 PM

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

Offline BlitzBot

  • Jr. Member
  • **
  • Posts: 1
[bmx] Menu by jankupila [ 1+ years ago ]
« on: June 29, 2017, 12:28:43 AM »
Title : Menu
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


Comments :


_33(Posted 1+ years ago)

 choice


jankupila(Posted 1+ years ago)

 Another menu
Code: [Select]

SuperStrict

Graphics 1024,768,1

Local x:Int=50
Local Y:Int=50
Local Choise:Int=0

Repeat

DrawText "Choise 1",x,y
DrawText "Choise 2",x,y+20
DrawText "Choise 3",x,y+40
DrawText "Quit",x,y+60

DrawText "<==",x+70,Choise*20+50
Flip;Cls

If KeyHit(key_up) Then Choise=Choise-1
If KeyHit(key_down) Then Choise = Choise +1
If Choise = -1 Then Choise =3
If Choise=  4 Then  Choise =0
If 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 End
Forever

Function go_to_0()
Cls
DrawText "Chosen number 1",50,200
Flip
Delay(1000)
End Function

Function go_to_1()
Cls
DrawText "Chosen number 2",50,200
Flip
Delay(1000)
End Function

Function go_to_2()
Cls
DrawText "Chosen number 3",50,200
Flip
Delay(1000)
End Function



 

SimplePortal 2.3.6 © 2008-2014, SimplePortal