Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

lingo help erase sprites

Status
Not open for further replies.

rachbry

Programmer
Feb 23, 2005
1
GB
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
 
This may be what u are looking for:

-- 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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top