home *** CD-ROM | disk | FTP | other *** search
- Rem * Title : Scaling a Bob
- Rem * Author : DBS-MB
- Rem * Date : 1st August 99
- rem ===================================================
- rem DARK BASIC EXAMPLE PROGRAM 5
- rem ===================================================
- rem This program will draw a scale a bob on screen
- rem ---------------------------------------------------
-
- rem Set the ink to white and paper color to black
- ink rgb(244,214,210),1
-
- rem Load a bitmap on to the screen
- load bitmap "face.bmp"
-
- rem Grab image 1 from bitmap
- get image 1,18,17,156,196
-
- rem clear the screen
- cls
-
- rem now we will make a bob and draw it off screen
- bob 1,100,100,1
-
- rem get bob width and find the middle of it going across
- rem get bob height and find the middle of it going down
- rem new offset for bob 1
-
- offset bob 1,(bob width(1)/2),(bob height(1)/2)
-
- rem the is were on screen bob will appear
- acrossscreen=(640/4)
- downscreen=(480/4)
-
- rem press left mouse button to quit
- rem move mouse left and right to resize bob
-
- repeat
-
- if returnkey()=1
- cls 0
- set cursor 0,0
- print "using the scale bob command"
- print "bob x ",bob x(1)
- print "bob y ",bob y(1)
- print "bob scale x ",bob scale x(1)
- print "bob scale y ",bob scale y(1)
- repeat:until returnkey()<>1
- cls
- endif
-
- rem draw the bob at the new position
- bob 1,acrossscreen,downscreen,1
-
- rem resize bob
- scale bob 1,mousex()
-
- until mouseclick()=1
-
- rem clear the screen
- cls
-
- rem remove the bob from memory
- delete bob 1
-
- rem remove image 1 from memory
- delete image 1
-
- rem End the program
- end
-