Author Topic: Screen selector[BPLUS]  (Read 2649 times)

0 Members and 1 Guest are viewing this topic.

Offline Roly

  • Amiga 1200
  • ****
  • Posts: 390
  • Karma: 7
    • View Profile
Screen selector[BPLUS]
« on: May 17, 2006 »
Original post from Codeman, taken from the ezboard forum

Quote from: Codeman
Could anybody help me out with a screen selector
id like to start by asking full screen or windowed b4 i start the intro

Code: [Select]
Graphics 640,480 , 16 ,2

selected=1
SetBuffer BackBuffer()

While Not KeyHit(1)
Cls

If selected-1
EndIf
EndIf


If KeyHit(208) Then
If selected=2 Then
selected=1
Else
selected=selected +1
EndIf
EndIf


If selected=1 Then

Text 250,330, "> Full screen 250,345, " Windowed "
Text 210,370,"Use cursor up/down then press"
Text 210,380,"enter to choose screen size"
Text 210,390,"Then hit ESC to start demo"
If KeyHit(28) Or KeyHit(156) Then choice = 1

EndIf


If selected=2 Then

Text 250,330, " Full screen "
Text 250,345, "> Windowed 210,370, "Use cursor up/down then press"
Text 210,380, "enter to choose screen size"
Text 210,390, "Then hit ESC to start demo"

If KeyHit(28) Or KeyHit(156) Then choice = 2
EndIf


Flip
Wend

This is the code i have but after selecting screen size you press enter and then have to press escape to continue. how could i just select option then hit enter and continue ?

Code: [Select]
Graphics 800,600,16,choice
SetBuffer BackBuffer()
While Not KeyHit(1)
Text 300,300,"HELLO"
Flip
Wend

Quote from: AlienEye0
Try this out. It probably does more than you need but you can just use the window selection gadget. Hope this helps.

Code: [Select]
intModes=CountGfxModes()
Dim scn_width( 255 )
Dim scn_height( 255 )
Dim scn_depth( 255 )
window = 1
i = 1
For t = 1 To intModes
scn_width(t) = GfxModeWidth(t)
scn_height(t)= GfxModeHeight(t)
scn_depth(t) = GfxModeDepth(t)
Next
SetBuffer BackBuffer()
 ClsColor 155,100,100:Flip:Cls
 While Not KeyDown( 28 )
   
    If KeyHit( 200 )  Then
        i = i + 1 
         If i > intModes i = 1
         Cls
          End If
     If KeyHit( 208 ) Then
     i = i - 1
     If  i  < 1 i = intModes
     Cls
        End If
         If KeyHit( 205 ) Then         window = window + 1:Cls
         If window = 1 Then onoff$ = "full            "
         If window = 2 Then onoff$ =  "window         "
         If window = 3 Then onoff$ = "scaled window   "
         If window > 3 window = 1: onoff$ = "full" :Cls
Color 0,0,0       
Text 10,3,"Use u/d arrow keys for res and color depth"
Text 10,23,"Use rt arrow key for window modes"
Text 10,40,"Enter to select"
Text 10,60,"Width=  "  + scn_width(i)
Text 10,80,"Height= "  + scn_height(i)
Text 10,100,"Depth=  "  + scn_depth(i)
Text 10,120,"Window= " + onoff$
Color 255,255,255
Text 11,2,"Use u/d arrow keys for res and color depth"
Text 10,22,"Use rt arrow key for window modes"
Text 11,39,"Enter to select"
Text 11,59,"Width=  " + scn_width(i)
Text 11,79,"Height= " + scn_height(i)
Text 11,99,"Depth=  " + scn_depth(i)
Text 11,119,"Window= " + onoff$

  demo_sw                 = scn_width(i)
  demo_sh                 = scn_height(i)
  demo_depth         = scn_depth(i)
  demo_window         = window 
Flip
Wend

Code: [Select]
Graphics demo_sw,demo_sh,demo_depth,demo_window
 
SetBuffer  BackBuffer()
 ClsColor 155,100,100:Flip:Cls
 
While Not KeyDown(1)


Text 20,20,"NEW SCREEN----------------------"
Text 20,40," fantastic demo goes here :)  "

Flip
Cls
Wend

End


Quote from: Rbraz

Hi codeman, check this code to see if it can help you.

Code: [Select]
Graphics 640,480,32,2
SetBuffer BackBuffer()

choice = 1

While Not KeyHit( 28 )

 Cls

 Select choice
 Case 1:
  Text 250,330, "> Full Screen"
  Text 250,345, "  Windowed"
 Case 2:
  Text 250,330, "  Full Screen"
  Text 250,345, "> Windowed"
 End Select

 Text 210,370,"Use cursor up/down then press"
 Text 210,380,"enter to choose screen size"

 If KeyHit( 200 ) Then choice = 1
 If KeyHit( 208 )  Then choice = 2

 Flip

Wend

Code: [Select]
Graphics 800,600,32,choice
SetBuffer BackBuffer()

While Not KeyHit(1)
 Text 300,300,"HELLO"
 Flip
Wend


Quote from: Codeman

Cheers guys for the reply :)

@ Alieneye0 ...
cheers for ya help m8 but couldnt get it to work , just crashed me blitz :( .. Appreciate the help thou m8

@ Rbraz .. Excellent m8 just what i wanted ...

CoDeMaN
« Last Edit: July 21, 2007 by Shockwave »