Ooops
January 26, 2021, 05:48:49 AM
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email
?
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Home
Forum
Help
Search
Gallery
Login
Register
SyntaxBomb - Indie Coders
»
Languages & Coding
»
Blitz Code Archives
»
Graphics
»
[bb] Screen mode selector by Filax [ 1+ years ago ]
« previous
next »
Print
Pages: [
1
]
Go Down
Author
Topic: [bb] Screen mode selector by Filax [ 1+ years ago ] (Read 476 times)
BlitzBot
Jr. Member
Posts: 1
[bb] Screen mode selector by Filax [ 1+ years ago ]
«
on:
June 29, 2017, 12:28:38 AM »
Title :
Screen mode selector
Author :
Filax
Posted :
1+ years ago
Description :
Quick screen mode selector without graphics
Code :
Code: BlitzBasic
ChoosescreenMode
(
)
While
Not
KeyHit
(
1
)
RenderWorld
Color
255
,
255
,
0
Text
0
,
20
,
GraphicsWidth
(
)
+
" / "
+
GraphicsHeight
(
)
+
" / "
+
GraphicsDepth
(
)
Flip
False
Wend
ClearWorld
End
Type
tMode
Field
Width%
Field
Height%
Field
Depth%
Field
Mode%
Field
Id%
End Type
Function
ChooseScreenMode
(
Title$=
"My App"
,MinWidth=
1024
)
Graphics3D
400
,
240
,
0
,
2
SetBuffer
BackBuffer
(
)
AppTitle
Title$
Local
Count%=
CountGfxModes3D
(
)
Local
Total%
Local
Current%=
0
Local
Width%
Local
Height%
Local
Depth%
Local
Mode%
Local
C%
Local
Y%
Local
O%
Local
Sx%=
GraphicsWidth
(
)
Local
Sy%=
GraphicsHeight
(
)
Local
ScrollY#=
50
Local
Size%=
20
Local
Font=
LoadFont
(
"arial"
,Size%-
2
,
1
,
0
,
0
)
SetFont
Font
For
i=
1
To
Count%
If
GfxModeWidth
(
I
)
>=MinWidth
Current%=Current%+
1
m.tMode=
New
tMode
mWidth%=
GfxModeWidth
(
I
)
mHeight%=
GfxModeHeight
(
I
)
mDepth%=
GfxModeDepth
(
I
)
mMode%=
1
mId%=Current%
Total%=Total%+
1
EndIf
Next
Current=
1
Repeat
Cls
; ---
; back
; ---
Viewport
0
,
0
, Sx%,Sy%
Color
0
,
49
,
72
Rect
0
,
0
,Sx%,Sy%,
1
ScrollY#=ScrollY#+
0.8
:
If
ScrollY#>Sy%-
50
Then
ScrollY#=
50
Color
0
,
53
,
76
:
Line
0
,ScrollY#+
0
,Sx%,ScrollY#+
0
Color
0
,
57
,
80
:
Line
0
,ScrollY#+
1
,Sx%,ScrollY#+
1
Color
0
,
61
,
84
:
Line
0
,ScrollY#+
2
,Sx%,ScrollY#+
2
Color
0
,
65
,
88
:
Line
0
,ScrollY#+
3
,Sx%,ScrollY#+
3
Color
5
,
76
,
99
:
Line
0
,ScrollY#+
4
,Sx%,ScrollY#+
4
Color
0
,
65
,
88
:
Line
0
,ScrollY#+
5
,Sx%,ScrollY#+
5
Color
0
,
61
,
84
:
Line
0
,ScrollY#+
6
,Sx%,ScrollY#+
6
Color
0
,
29
,
52
Rect
0
,
0
,Sx%,
50
,
1
Rect
0
,Sy%-
50
,Sx%,
50
,
1
Color
0
,
69
,
112
Text
Sx%/
2
,Sy%-
25
,
"Press <up><down> / <left><right>"
,
True
,
True
; ---
; Bar
; ---
Color
0
,
128
,
192
Rect
0
,
110
,Sx%,Size%,
1
Color
20
,
169
,
192
Rect
0
,
110
,Sx%,Size%,
0
Viewport
0
,
60
, Sx%, Sy%-
120
; -------
; Refresh
; -------
C%=
0
Y%=
101
For
d.tMode =
Each
tMode
C%=C%+Size%
If
dId%=Current%
Then
Color
255
,
128
,
0
If
KeyHit
(
203
)
Then
dMode%=
1
EndIf
If
KeyHit
(
205
)
Then
dMode%=
2
EndIf
Else
Color
168
,
54
,
0
EndIf
Text
70
,Y%+C%-O%,dWidth%,
True
,
True
Text
105
,Y%+C%-O%,
"/"
,
True
,
True
Text
140
,Y%+C%-O%,dHeight%,
True
,
True
Text
190
,Y%+C%-O%,dDepth%,
True
,
True
Text
220
,Y%+C%-O%,
"Bits"
,
True
,
True
Select
dMode%
Case
1
Caption$=
"Screen"
Case
2
Caption$=
"Windowed"
End Select
Text
300
,Y%+C%-O%,Caption$,
True
,
True
Next
If
KeyHit
(
200
)
Then
If
Current%>
1
Then
O%=O%-Size%
Current%=Current%-
1
EndIf
EndIf
If
KeyHit
(
208
)
Then
If
Current%<Total%
Then
O%=O%+Size%
Current%=Current%+
1
EndIf
EndIf
If
KeyHit
(
28
)
For
e.tMode =
Each
tMode
If
eId=Current%
Then
Graphics3D
eWidth%,eHeight%,eDepth%,eMode%
Return
True
EndIf
Next
EndIf
Flip
Forever
End Function
Comments :
none...
Logged
Print
Pages: [
1
]
Go Up
« previous
next »
SyntaxBomb - Indie Coders
»
Languages & Coding
»
Blitz Code Archives
»
Graphics
»
[bb] Screen mode selector by Filax [ 1+ years ago ]
SimplePortal 2.3.6 © 2008-2014, SimplePortal