Author Topic: VQB 05 - Dev and Demos  (Read 3353 times)

0 Members and 1 Guest are viewing this topic.

Offline Unseen Machine

  • Forum Regular
  • Posts: 158
  • Make the game not the engine!
    • View Profile
VQB 05 - Dev and Demos
« on: September 04, 2020, 04:26:26 pm »
Hi Folk's,

This will be my VQB Dev and demo thread. I'll be posting here when i make demo's or when i make a new feature or improve/fix a current one. I've got a a few in the works.

To begin with, here's a MacOSX style dock demo. I'll be expanding on it to demonstrate other features in the next Demo.

Attached are required files (put in QB64 directory and allow overwrites old files), please give feed back and suggestions/questions.

Code: QB64: [Select]
  1. '// VQB Demos - Pt 1. The Dock \\
  2. '// By John Onyon a.k.a Unseen Machine \\
  3.  
  4. CHDIR "VQB\Demo's\Dock\" '// Root file directory
  5.  
  6. REM $INCLUDE:'VQB\VQB.bi' '// Include the base TYPE's and default constants
  7.  
  8. DIM HSI AS LONG, WSI AS LONG '// Variables to hold the Width and Height of the screen
  9.  
  10. HSI = _HEIGHT(_SCREENIMAGE) '// Get system screen width
  11. WSI = _WIDTH(_SCREENIMAGE) '// Get system screen height
  12.  
  13. VQB_Screen 0, 0, WSI, HSI, _RGB32(120, 110, 100), "VQB - Dock Demo" '// Create a screen
  14. _FULLSCREEN '// Make full screen mode
  15.  
  16. '// The dock requires three things, The mouseinfo array, a Dock and an array of however many items you want the dock to have.
  17. DIM Mouse(1) AS MouseInfo, Dock AS DOCK, DockItem(4) AS DOCK_ITEM
  18.  
  19. '// First is array ref then file name and finally helper text (not currently implemented)
  20. VQB_DOCK_ITEM_NEW DockItem(0), "Internet_ICON.PNG", "Network and Internet"
  21. VQB_DOCK_ITEM_NEW DockItem(1), "Music_ICON.PNG", "Music - DJ64"
  22. VQB_DOCK_ITEM_NEW DockItem(2), "Paint_ICON.PNG", "QB Paint"
  23. VQB_DOCK_ITEM_NEW DockItem(3), "Games_ICON.PNG", "Games"
  24. VQB_DOCK_ITEM_NEW DockItem(4), "Computer_ICON.PNG", "File Explorer"
  25.  
  26. '// Once you've loaded the images for the dock items you can initialise the dock
  27. '// First send the master dock type then number of items, max items and the colour
  28. '// Next is Position : BOTTOM, LEFT, TOP or RIGHT
  29. '// Then Reflections Either true or false
  30. '// Finally the width and height of the screen
  31.  
  32. VQB_DOCK_NEW Dock, 5, 5, _RGB32(150, 150, 180), BOTTOM, TRUE, FALSE, WSI, HSI
  33.  
  34.   _LIMIT 30 '// Limit frame loops
  35.  
  36.   CLS '// Clear the screen
  37.  
  38.   VQB_Mouse_GetInfo Mouse(0) '// Get mouse data
  39.  
  40.   '// If the return value is > -1 then thats the icon that the mouse is over
  41.  
  42.   SELECT CASE VQB_DOCK_UPDATE(Dock, DockItem(), Mouse())
  43.  
  44.     CASE 0
  45.       IconText$ = "Internet Icon"
  46.     CASE 1
  47.       IconText$ = "Music Icon"
  48.     CASE 2
  49.       IconText$ = "Paint Icon"
  50.     CASE 3
  51.       IconText$ = "Games Icon"
  52.     CASE 4
  53.       IconText$ = "Computer Icon"
  54.     CASE ELSE
  55.       IconText$ = "NO ICON SELECTED"
  56.  
  57.  
  58.   TxtX% = (WSI / 2) - (_PRINTWIDTH(IconText$) / 2)
  59.   _PRINTSTRING (TxtX%, HSI / 2), IconText$
  60.  
  61.   _DISPLAY '// Update the display
  62.  
  63. LOOP UNTIL Mouse(0).R '// Do this until the right mouse button is clicked
  64.  
  65.  
  66. REM $INCLUDE:'VQB\VQB.bm' '// Include VQB Library
  67.  

Thanks and happy coding.

Unseen
* VQB.zip (Filesize: 122.02 KB, Downloads: 206)

Offline TempodiBasic

  • Forum Resident
  • Posts: 1792
    • View Profile
Re: VQB 05 - Dev and Demos
« Reply #1 on: September 05, 2020, 01:22:52 pm »
I tried it, it seems to work well.. but how to set a background for the desktop of MacOs?
Programming isn't difficult, only it's  consuming time and coffee

Offline Unseen Machine

  • Forum Regular
  • Posts: 158
  • Make the game not the engine!
    • View Profile
Re: VQB 05 - Dev and Demos
« Reply #2 on: September 05, 2020, 03:26:46 pm »
Quote
I tried it, it seems to work well.. but how to set a background for the desktop of MacOs?

Thanks, and it works ok'ish...there's a lot of modding i'm gonna do for this feature. As for the background, just load an image and putimage it to the screen before the dock update call.

Unseen