Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

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

No replies to this topic
[TOPIC CONTROLS]
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

jen.looper

[GLOBAL: userInfoPane.html]
jen.looper
  • 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:

 

http://coronalabs.com/blog/2013/11/01/snapshot-canvas-paint-brushes-trailing-object-effects-etc/

 

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?
 
Thanks, 
Jen
 
 



[topic_controls]
[/topic_controls]