TGC Codebase Backup



Mouse by Mark Garrett

10th Jul 2005 21:03
Summary

You draw with mouse and then it is multi-pasted into a design.



Description

Uses copy to bitmap, flip bitmap and mirror bitmap



Code
                                    ` This code was downloaded from The Game Creators
                                    ` It is reproduced here with full permission
                                    ` http://www.thegamecreators.com
                                    
                                    rem mouse-paster




startagain:
rem setup variables etc.
set display mode 1024,768,16
ink rgb(255,0,255),1
line 0,384, 1022,384 : rem horizontal
line 512,0,  512,768 : rem vertical line
create bitmap 1, 512,384: rem used as paster
set current bitmap 0
position mouse 600,400
flag = 0




rem main loop
do

rem determine where the mouse pointer is
mx = mousex():my = mousey():mc = mouseclick()

rem keep mouse in bottom right square-
if mx < 512 then mx = 516: position mouse mx,my 
if my < 384 then my = 388 : position mouse mx,my

rem use mouse to draw a circle
if mc = 1 then circle mx,my,2:circleflag = 1

rem see if mouse is realeased, if so goto bitmap paster
if mc = 0 and circleflag = 1 then gosub paster 

rem if left mouse button is pressed then start program over
if mc = 2 then goto startagain

loop





paster:

rem copy off lower right square
copy bitmap 0,512,384,1023,767,1,0,0,511,383:       mirror bitmap 1 

rem paste onto lower left square
copy bitmap 1,0,0,511,383,0,1,384,512,767:          flip bitmap 1

rem paste onto upper left square
copy bitmap 1,0,0,511,383,0,1,1,512,384:            mirror bitmap 1

rem paste onto upper right square
copy bitmap 1,0,0,511,383,0,512,1,1023,384:         circleflag = 0

return