>> Can some one help me get on the right track solving this problem
>>
>> 1) I have 2 images a "before" & "after" image
>> 2) I need a slider to move back and forth to reveal the image
>> "after" as I drag the slider
>
> Look at using the Mask ink effect on your sprites. Here, I just did a
> quick test (it's a DIR, you can open it from inside Director):
>
> http://staging.funnygarbage.com/staff/colin/worldwipe.dir
>
> It's a bit quick and sloppy, but you'll get the idea, I hope.
Sounds like a fun little exercise. I read your intent slightly differnetly
than did Colin. I was imagining an image blending into the other with the
slider movement, instead of wiping. So, I was going to suggest doing a
little imaging. A simple #blend copypixels of one image into another, then
set the image of your "display member" to the resultant image. Something
like:
--------------------------
on blendImages member1, member2, percentblend
tempImage1 = member1.image.duplicate()
tempImage2 = member2.image.duplicate()
--Assuming that the two images are the same size... and I prefer to work
in 16-bit
returnImage = image(tempImage1.width, tempImage1.height, 16)
returnImage.copypixels(tempImage1, tempImage1.rect, tempImage1.rect)
returnImage.copypixels(tempImage2, tempImage2.rect, tempImage2.rect,
[#blend:percentblend])
return returnImage
end
--------------------------
So, your slider script could call blendImages, pass the source image
members, and pass the slider's position (as a percentage of the slider's
length), and update the display member accordingly:
member("display").image = blendImages(member1, member2, percentage)
Pardon if the blending was not what you were after. I love imaging, so I
jumped on it. You could use imaging to get the effect that Colin did with
masks - copy the whole of one image, and just a part of the second image,
into your display image - just a matter of specifying the source rect and
destination rect in the copypixels to have a width equal to your slider's
width ratio.
Here's another opportunity for a benchmark test - sprites with masks vs one
sprite whose member is getting its image swapped out. I bet the imaging way
would win, but that's just a hunch. Not that a millisecond or 5 matters, but
I'm curious.
-Kurt
[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!]