Dust Sweeping effect

Hey,

I was thinking if there’s a way to create a dust swipe-off effect.?

Let’s say you have an old book (1st layer) and dust over the book (2nd layer). Now i want to swipe off dust with my finger.
So i should create a mask on a dust layer where it was touched…but the problem is, i can only make one mask on 1 display object.

Any advice?
Thanks!

Nick [import]uid: 77183 topic_id: 21841 reply_id: 321841[/import]

By “swipe” do you mean you run your finger over the “dust” and it is removed, or that it is moved away from the finger?

Peach :slight_smile: [import]uid: 52491 topic_id: 21841 reply_id: 86790[/import]

the dust gets removed.

tnanks!

Nick [import]uid: 77183 topic_id: 21841 reply_id: 86848[/import]

I would probably spawn a number of circles or rounded squares to cover the screen and having them removed on touch - it would be one of the simpler ways of doing this.

You could even create a square imagine in Photoshop with a dust-like texture to it so it wouldn’t look jagged as though the user were removing squares.

Peach :slight_smile: [import]uid: 52491 topic_id: 21841 reply_id: 86861[/import]

That’s actually a great idea. I’ll try it out!

Thanks again Peach and Happy Valentine’s Day! :slight_smile:

Nick [import]uid: 77183 topic_id: 21841 reply_id: 86870[/import]

Thank you Nick - same to you :slight_smile: [import]uid: 52491 topic_id: 21841 reply_id: 86971[/import]

Hey Peach,

I’ve got one more question…

I spawned a number of “dust circles”, assigned them eventlisteners, but don’t know how to remove dust circles with a swipe.

I know i have to write a function that checks which dust was pressed (swiped over), remove that dust, and remove eventlistener of that dust…but don’t know how to remove object with swipe.?

I also don’t know how to recognize which dust was pressed (or swiped over)- I’m not using UI library and don’t know how to get event.id.?

Thank you Peach! [import]uid: 77183 topic_id: 21841 reply_id: 87893[/import]

Do they all need to be swiped or could they also be touched?

By that I mean is it OK to remove the dust where the touch starts as well as all those swiped over?

Let me know, we’ll work out the logic :slight_smile: [import]uid: 52491 topic_id: 21841 reply_id: 88003[/import]

Yes, it’s ok to remove the dust where the touch starts as well as all those swiped over.

So, just to confirm…

2 Options:
option A - if a person touches dust circles and than lifts his finger, dust circles that were pressed should be removed when touch started.

option B - person presses dust circles, they get removed(option A), then person doesn’t lift his finger, but swipes it across other dust circles. They get removed instantly when finger touches them.

Thanks Peach! [import]uid: 77183 topic_id: 21841 reply_id: 88064[/import]

You can use this code by croisened, fits perfectly per your requirement.

http://developer.anscamobile.com/code/corona-lottery-scratch-ticket

cheers,
Sid [import]uid: 7475 topic_id: 21841 reply_id: 88066[/import]

Hey Sid T,

It worked!

Thank you very much for this info!
And thanks to you too Paech! [import]uid: 77183 topic_id: 21841 reply_id: 88070[/import]

Oh, nice share! (I forgot all about that sample code.)

Good luck with your project optionniko :slight_smile: [import]uid: 52491 topic_id: 21841 reply_id: 88110[/import]