home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 63 / CDACTUAL63.iso / Aplicaciones / DarkBasic / DemoDarkBasic.exe / help / examples / input / exam02.dba < prev    next >
Encoding:
Text File  |  2000-01-24  |  663 b   |  34 lines

  1. Rem * Title  : Mouse Draw
  2. Rem * Author : DBS-LB
  3. Rem * Date   : 1st Sept 99
  4. rem ==========================================
  5. rem DARK BASIC EXAMPLE PROGRAM 2
  6. rem ==========================================
  7. rem This program will make the mouse draw
  8. rem ------------------------------------------
  9.  
  10. rem User prompt
  11. print "Use the mouse to draw connecting lines"
  12.  
  13. rem Begin main loop
  14. do
  15.  
  16. rem Store old values
  17. oldx=x
  18. oldy=y
  19.  
  20. rem Draw line to cursor if mouse button pressed
  21. if mouseclick()=1
  22.     x=mousex()
  23.     y=mousey()
  24.     c=mousez()
  25.     ink rgb(100+c,100+c,100+c),0
  26.     line oldx, oldy, x, y
  27.     hide mouse
  28. else
  29.     show mouse
  30. endif
  31.  
  32. rem End main loop
  33. loop
  34.