Hi ,
Iâve been trying to get my movie to do the following things with the script included
below. Basically, I want to display an image to the stage and mask it using a mask
image created by duplicating whatever sprite the mouse is clicked on at the time. The
resulting masked out image is then displayed to another sprite on the stage. The image
to be masked out also can be moved around and resized and this is/should be masked and
updated to the displaying sprite.
Problem 1: the image I use for the mask is a duplicate of the sprite member the mmouse
is clicked on (made using copypixels) but the resulting image is never resized and is
alwaysy a filled out rect (the original images are of irregular shape).
Problem 2: the resulting image is not masked out (madness!)
I hope that there arenât too many probs with the script and that it can be refined
(just not quite sure how myself).
Cheers
property spriteNum
global fname
on updateAper me
rPseudoRect = rect (the mouseH, the mouseV, the mouseH + 1, the mouseV + 1)
if intersect(sprite(spritenum).rect, rPseudoRect) <> rect(0, 0, 0, 0) then
apwidth = sprite(spritenum).width * 2
apheight = sprite(spritenum).height * 2
aprect200 = rect (0, 0, apwidth, apheight)
-- duplicate the selected aperture and display at 200% size (400% of original
thumbnail size)
aper = sprite(spritenum).member.image
sprite(spritenum).member.regpoint = point(0, 0)
member("aper prew mask").regPoint = point(0, 0)
member("aper prew mask").image.copyPixels(aper, aprect200, aper.rect) -- =
aper.duplicate()
updateStage
-- image showing aperture boundary
sprite(216).width = apwidth + 2
sprite(216).height = apheight + 2
-- duplicate the selected image and display at the same size as selected aperture
(image can be resized andd moved)
sprite(217).width = apwidth
sprite(217).height = apheight
apTempimg = member(fname).image
member("aper image").image.copyPixels(apTempimg, aprect200, apTempimg.rect)
updateStage
-- get the image mask area
maskImg = member("aper prew mask").image.createmask()
aperImg = member("aperture400%").image
img = sprite(217).member.image
aperImg.copyPixels(img, aperimg.rect, img.rect, [#maskImage: maskImg])
updateStage
-- update the page preview aperture with masked out image
member("aperture400%").regpoint = point(0, 0)
sprite(spritenum).member.image = member("aperture400%").image.duplicate()
sprite(spritenum).member.regpoint = point(0, 0)
sprite(spritenum).width = apwidth /2
sprite(spritenum).height = apheight /2
updateStage
end if
end updateAper
[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/lingo-l.cgi To post messages to the list, email [EMAIL
PROTECTED] (Problems, email [EMAIL PROTECTED]). Lingo-L is for learning and helping
with programming Lingo. Thanks!]