'// UnseenGDK Tool - Level Designer v.01 \\
'// By John Onyon a.k.a Unseen Machine \\
'// #Rev : 0 \\
VQB_Screen
0, 0, 1024, 768, _RGB32(200, 200, 255), "UnseenGDK Level Designer v.01"
'// DIMS \\
CONST Col_Max
= 1024, Row_Max
= 1024, Col_Standard
= 256, Row_Standard
= 256
'// GUI Elements \\
DIM Btn
(9) AS Button
, Map
(3) AS Button
GridSize = 10
VQB_CheckBox_New GridCBox, 650, 20, 8, 8, TRUE
VQB_Button_New GridBTN
(0), 720, 20, 20, 20, _RGB32(180, 180, 180), "-"VQB_Button_New GridBTN
(1), 800, 20, 20, 20, _RGB32(180, 180, 180), "+"
'// Control variables \\
DIM Mouse
(1) AS MouseInfo
, GDK_Mouse
(1) AS MouseState
, KB
(1) AS KeyBoardState
, LMB_Mode
AS _BYTE, RMB_Mode
AS _BYTE '// And there is a basis for my new project QB Blocks. GDK mouse is different to VQB mouse so GDK mouse functions cant use the VQB typedef...
'// QB Blocks will be the frame work on which all my libraries are going to be re-written/written so they all work seemlessly together.
'// im hoping to add support for some stuff from InForm and hopefully some pyhsics etc...but thats all way down the road
'// File Setup - To be improved in the future!! \\
'// DATA Arrays
'////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
VQB_Frame
10, 10, 600, 600, _RGB32(0, 0, 0)VQB_Frame
10, 620, 600, 25, _RGB32(0, 0, 0)VQB_Frame
756, 18, 22, 22, _RGB32(0, 0, 0)
EditorBCK& = VQB_StoreScreen& '// The stuff which doesnt change only needs to be drawn once and then stored.
'// MAIN LOOP \\
'// Loop control \\
'// Control Logic \\
'// Get Input \\
GDK_Keyboard_GetState KB(0)
GDK_Mouse_GetState GDK_Mouse(0)
VQB_Mouse_GetInfo Mouse(0)
'// Event checking is based on the state of the input controllers and control variables \\
'// Is mouse over editor window \\
IF Mouse
(0).X
>= 10 AND Mouse
(0).X
<= 610 THEN IF Mouse
(0).Y
>= 10 AND Mouse
(0).Y
<= 610 THEN
'// Calcuate col/row
Col = (Mouse(0).X - 10) / GridSize
Row = (Mouse(0).Y - 10) / GridSize
IF Mouse
(0).L
THEN '// Left button clicked
'// For future expansion \\
CASE 1 '// Select tile for data edit
'// Check buttons \\
IF VQB_CheckBox_Click
(GridCBox
, Mouse
(0)) AND NOT Mouse
(1).L
THEN IF GridCBox.CheckValue
= TRUE
THEN GridCBox.CheckValue = FALSE
GridCBox.CheckValue = TRUE
'// Copy the input states for comaprisons next loop.
KB(1) = KB(0)
Mouse(1) = Mouse(0)
GDK_Mouse(1) = GDK_Mouse(0)
'// End of control logic \\
'// Render \\
VQB_RestoreScreen EditorBCK&
VQB_CheckBox_Draw GridCBox
VQB_Button_Draw GridBTN(0)
VQB_Button_Draw GridBTN(1)
'// Text \\
'// END OF MAIN LOOP \\
'///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
'////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
'// SUB contains all the programs TYPE defs \\
Levels
AS _UNSIGNED _BYTE '// Max 255 levels - First level (0) will be made with GDK intro \\