Erasing parts of an image file

Ok well i suppose it’s not possible to achieve this but i want to touch the screen and erase the background image as i move my finger so that i leave a “trail” behind, i tried using masks for this but i think the only way to achieve this is by drawing a lot of tile images onscreen and erase every image one by one where i move my finger… am i right? or is there any way to erase an image/change its alpha value in some especific point?, please let me know, thanks in advance… [import]uid: 141404 topic_id: 26958 reply_id: 326958[/import]

What is behind the erased image? Just solid black?
You could just paint small solid black images over the top. [import]uid: 10389 topic_id: 26958 reply_id: 110400[/import]

Hi @erickpombo,

There isn’t a way to manipulate Corona images on a per-pixel basis, but Blue Bilby’s suggestion is very good (“erase” by drawing black or white shapes/images on top). Of course this would create a lot of display objects, perhaps even 100+, but if performance was suffering you could write a complex routine to combine the points (path drawn by the “eraser”) into one multi-line or polygon shape. Sort of like what Carlos did in his awesome bezeir curve fitting/simplifying code. Search for “bezeir” in the website and you should locate it.

Brent Sorrentino
[import]uid: 9747 topic_id: 26958 reply_id: 110402[/import]

Alternatively, if the background you have is not just plain black but an image, you could sort of do the opposite:

When touching the screen, make the background image appear on top, masked by a circle of about the size of a fingertip. This will look like the foreground is becoming transparent, letting the background show through. You will need to add this for several touchpoints (so do a check to make sure they are spaced apart a minimum amount of pixels), so it might get a bit heavy after a while, but I’m sure you can optimize this depending on the normal use circumstances for your app.

Good luck!
Thomas [import]uid: 70134 topic_id: 26958 reply_id: 110413[/import]