hi im not very familiar with lingo and i am trying to use one sprite to erase another.. i have no idea even how to begin and would really apreciate any help anybody can offer. thanks
-- Put this script in your eraser sprite
property click
property base
property eraser
on beginSprite me
click = false
-- sprite to be erased
base = sprite(1)
-- eraser sprite
eraser = sprite(2)
base.member.image.fill(base.member.image.rect,rgb(0,0,0))
eraser.member.centerregPoint = true
end me
on mouseDown me
eraser.loc = the mouseLoc
click = true
end
on mouseUp me
click = false
end
on exitframe
if(click) then
eraser.loc = the mouseLoc
if sprite 2 intersects 1 then
bImage = base.member.image
eImage = eraser.member.image
eRect = eImage.rect
eOffsetX = eraser.member.image.width/2.0
eOffsetY = eraser.member.image.height/2.0
offset = point(the mouseLoc.locH - base.left, the mouseLoc.locV - base.top)
r = rect(offset[1]-eOffsetX,offset[2]-eOffsetY,offset[1]+eOffsetX,offset[2]+eOffsetY)
--bImage.copyPixels(eImage,r,eRect)
bImage.fill(r,rgb(255,255,255))
end if
end if
end
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.