home *** CD-ROM | disk | FTP | other *** search
- on drawit
- global x1, y1, x2, y2, lastx, lasty, pensize, clrsprite, lft, rgt, tp, btm, newcolor
- set clrsprite to 47
- puppetSprite(clrsprite, 1)
- set the foreColor of sprite clrsprite to newcolor
- if lastx > x1 then
- if lastx < x2 then
- if lasty > y1 then
- if lasty < y2 then
- set tp to lasty - pensize
- set lft to lastx - pensize
- set rgt to lastx + pensize
- set btm to lasty + pensize
- if lft < x1 then
- set lft to x1
- end if
- if btm > y2 then
- set btm to y2
- end if
- if tp < y1 then
- set tp to y1
- end if
- if rgt > x2 then
- set rgt to x2
- end if
- set the visible of sprite clrsprite to 1
- if pensize = 1 then
- set the locH of sprite clrsprite to lft
- set the locV of sprite clrsprite to tp
- else
- spriteBox(clrsprite, lft, tp, rgt, btm)
- end if
- set the castNum of sprite clrsprite to 45
- updateStage()
- set the locH of sprite clrsprite to -2000
- set the locV of sprite clrsprite to -2000
- end if
- end if
- end if
- end if
- puppetSprite(clrsprite, 1)
- end
-
- on exitFrame
- global lastx, lasty, thisx, thisy, newcolor, pensize
- set thisx to the mouseH
- set thisy to the mouseV
- if pensize > 0 then
- repeat while the mouseDown
- set thisx to the mouseH
- set thisy to the mouseV
- if (thisx <> lastx) or (thisy <> lasty) then
- if the mouseDown then
- set lastx to thisx
- set lasty to thisy
- drawit()
- end if
- end if
- end repeat
- end if
- set lastx to thisx
- set lasty to thisy
- go(the frame)
- end
-
- on mouseUp
- global x1, y1, x2, y2, thisx, thisy, pensize, clrsprite
- puppetSprite(2, 1)
- set the trails of sprite 2 to 1
- set the locH of sprite 2 to -1610
- set the locV of sprite 2 to -1610
- updateStage()
- if pensize = 0 then
- fillit()
- else
- set the ink of sprite 2 to 36
- set the visible of sprite 2 to 1
- spriteBox(2, x1, y1, x2, y2)
- updateStage()
- puppetSprite(2, 0)
- end if
- updateStage()
- end
-
- on mouseDown
- global lastx, lasty, thisx, thisy, pensize
- set thisx to the mouseH
- set thisy to the mouseV
- if pensize > 0 then
- set lastx to thisx
- set lasty to thisy
- drawit()
- end if
- end
-