January 20, 2021, 01:27:58 PM
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
»
Miscellaneous
»
[bb] Types for newbies by Filax [ 1+ years ago ]
« previous
next »
Print
Pages: [
1
]
Go Down
Author
Topic: [bb] Types for newbies by Filax [ 1+ years ago ] (Read 400 times)
BlitzBot
Jr. Member
Posts: 1
[bb] Types for newbies by Filax [ 1+ years ago ]
«
on:
June 29, 2017, 12:28:40 AM »
Title :
Types for newbies
Author :
Filax
Posted :
1+ years ago
Description :
How make simple windows using types
Code :
Code: BlitzBasic
Graphics3D
640
,
480
,
32
,
2
SetBuffer
BackBuffer
(
)
Global
Name$
Type
OpenWindow
Field
Px
Field
Py
Field
Tx
Field
Ty
End Type
Procedure_OpenWindow
(
50
,
50
,
300
,
200
)
Procedure_OpenWindow
(
150
,
300
,
200
,
150
)
Procedure_OpenWindow
(
250
,
200
,
200
,
50
)
While
KeyDown
(
1
)
<>
1
Procedure_RefreshWindow
(
)
Flip
Wend
Function
Procedure_OpenWindow
(
Px,Py,Tx,Ty
)
Gui.OpenWindow=
New
OpenWindow
GuiPx=Px
GuiPy=Py
GuiTx=Tx
GuiTy=Ty
Procedure_DrawWindow
(
GuiPx,GuiPy,GuiTx,GuiTy
)
End Function
Function
Procedure_DrawWindow
(
Px,Py,Tx,Ty
)
Color
100
,
100
,
100
Rect
Px,Py,Tx,Ty,
1
Color
19
,
66
,
117
Rect
Px,Py,Tx,
20
,
1
Procedure_DrawCloseGadget
(
Px+Tx-
17
,Py+
3
,
0
)
Color
200
,
200
,
200
Line
Px,Py,Px+Tx,Py
Line
Px,Py,Px,Py+Ty
Color
50
,
50
,
50
Line
Px+Tx,Py,Px+Tx,Py+Ty
Line
Px,Py+Ty,Px+Tx,Py+Ty
End Function
Function
Procedure_DrawCloseGadget
(
Px,Py,Flag
)
If
Flag=
0
Then
Color
100
,
10
,
10
Rect
Px,Py,
15
,
15
,
1
EndIf
If
Flag=
1
Then
Color
10
,
10
,
100
Rect
Px,Py,
15
,
15
,
1
EndIf
End Function
Function
Procedure_RefreshWindow
(
)
For
Gui.OpenWindow =
Each
OpenWindow
Procedure_DrawWindow
(
GuiPx,GuiPy,GuiTx,GuiTy
)
If
MouseX
(
)
>GuiPx+GuiTx-
17
And
MouseX
(
)
<GuiPx +GuiTx-
2
And
MouseY
(
)
>GuiPy+
3
And
MouseY
(
)
<GuiPy+
18
And
MouseDown
(
1
)
=
1
Procedure_DrawCloseGadget
(
GuiPx+GuiTx-
17
,GuiPy+
3
,
1
)
:
Flip
:
Cls
While
MouseDown
(
1
)
=
1
Wend
Delete
Gui
EndIf
Next
End Function
Comments :
none...
Logged
Print
Pages: [
1
]
Go Up
« previous
next »
SyntaxBomb - Indie Coders
»
Languages & Coding
»
Blitz Code Archives
»
Miscellaneous
»
[bb] Types for newbies by Filax [ 1+ years ago ]
SimplePortal 2.3.6 © 2008-2014, SimplePortal