Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]

[RESOLVED] I can draw...but can I erase?
Started by jen.looper Feb 11 2014 03:28 PM

No replies to this topic
This topic has been archived. This means that you cannot reply to this topic.
[TOPIC: post.html]


[GLOBAL: userInfoPane.html]
  • Contributor

  • 164 posts
  • Corona SDK

update: looks like there is sample code with a nice snapshot eraser tool bundled right in with Corona...the trick is to make your painting layer in a snapshot and the picture that you're painting on a regular background as it's not manipulated.




I'm working on my Roomalyzr app and realize that I need to have an "erase" function that allows a user to delete the work they did earlier.


I basically followed this tutorial to create a painting simulation:




I create a snapshot here:


mySnap = display.newSnapshot( display.contentWidth-20, display.contentHeight-110 )
post a photo into that snapshot, then I am inserting my brush into a snapshot's canvas like this: 


mySnap.canvas:insert( brush )
mySnap:invalidate( "canvas" )
but I can't seem to figure out how to remove the brush via an eraser tool that is able to hitTest the brush. Anyone have ideas on how to get rid of elements inserted into snapshot?