home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 63 / CDACTUAL63.iso / Aplicaciones / DarkBasic / DemoDarkBasic.exe / help / examples / bobs / exam06.dba < prev    next >
Encoding:
Text File  |  1999-09-07  |  1.5 KB  |  72 lines

  1. Rem * Title  : Stretching a Bob
  2. Rem * Author : DBS-MB
  3. Rem * Date   : 1st August 99
  4. rem ===================================================
  5. rem DARK BASIC EXAMPLE PROGRAM 6
  6. rem ===================================================
  7. rem This program will draw a stretch a bob on screen 
  8. rem ---------------------------------------------------
  9.  
  10. rem Set the ink to white and paper color to black 
  11. ink rgb(244,214,210),1
  12.  
  13. rem Load a bitmap on to the screen
  14. load bitmap "face.bmp"
  15.  
  16. rem Grab image 1 from bitmap
  17. get image 1,18,17,156,196
  18.  
  19. rem Clear the Screen
  20. cls
  21.  
  22. rem Now we will make a bob
  23. bob 1,100,100,1
  24.  
  25. rem get bob width and find the middle of it going across
  26. rem get bob height and find the middle of it going down
  27. rem new offset for bob 1 
  28.  
  29. offset bob 1,(bob width(1)/2),(bob height(1)/2)
  30.  
  31. rem the is were on screen bob will appear
  32. acrossscreen=0
  33. downscreen=0
  34.  
  35. rem press left mouse button to quit
  36. rem move mouse left,right,up and down to stretch bob
  37.  
  38.  
  39. repeat
  40.  
  41.     if returnkey()=1
  42.         cls 0
  43.         set cursor 0,440
  44.         print "using the stretch bob command"
  45.         print " bob x ",bob x(1);
  46.         print " bob y ",bob y(1);
  47.         print " bob scale x ",bob scale x(1);
  48.         print " bob scale y ",bob scale y(1)
  49.         repeat:until returnkey()<>1
  50.         cls
  51.     endif
  52.  
  53.     rem draw the bob at the new position
  54.     bob 1,acrossscreen,downscreen,1
  55.  
  56.     rem resize bob
  57.     stretch bob 1,mousex(),mousey()
  58.     
  59. until mouseclick()=1
  60.  
  61. rem clear the screen
  62. cls 
  63.  
  64. rem remove the bob from memory
  65. delete bob 1
  66.  
  67. rem remove image 1 from memory
  68. delete image 1
  69.  
  70. rem End the program
  71. end
  72.