mask query

Danny,

does that mean I can’t use a mask to do what I want to do?

ie…
All i want is to have a normal colorful image (image1), that has a hazzy effect applied to it… so I can see image1 but it looks hazzy… but if the user touches a point on the image… the hazzness goes away at the touch location…

Hope that makes sense

Thanks

Vik [import]uid: 67619 topic_id: 33361 reply_id: 132809[/import]

I don’t think you’re going to be able to do that very easily, though if you want a hackish way, consider this:

mygroup = display.newImageGroup()
image1 = display.newImageRect(“image1.png”, w, h)
mygroup:insert(image1)
haze1 = display.newImageRect(“haze1.png”, w, h) – the image with the haze covering everything
mygroup:insert(haze1)
haze2 = display.newImageRect(“haze2.png”, w, h) – the haze with the hole in it.
haze2. isVisible = false
mygroup:insert(haze2)
Then set your touch handler to set haze1.isVisible to false on event.phase == “began” and set haze2.isVisible to true and set haze2’s x, y to the event x, y. Then on event.phase == “ended” set the visibilities to the opposite. Then I would make haze2 bigger than the whole group and through a mask on the group so that haze2 doesn’t flow out of the group when it moves and it’s big enough to continue to cover things up.

The other idea I had was not anywhere close to what you’re trying to do. [import]uid: 199310 topic_id: 33361 reply_id: 132998[/import]

Rob,

Thanks for that… I had a similar idea… but was hoping I would not have to use it… but my idea is the same as yours… without using a mask… my second image would already have a transparent image cut out at a particular location… which I would move as a whole image… just means the second image would be a lot larger… (also thought about maybe tiling so that it don’t such a big image… but need to do a bit more calculations…)

if I add a mask to any image… it just turns that image black…

much appreciated for your help

any thing in the pipe line at the head office about making the mask transparent? :stuck_out_tongue:

Vik [import]uid: 67619 topic_id: 33361 reply_id: 133065[/import]

I don’t think you’re going to be able to do that very easily, though if you want a hackish way, consider this:

mygroup = display.newImageGroup()
image1 = display.newImageRect(“image1.png”, w, h)
mygroup:insert(image1)
haze1 = display.newImageRect(“haze1.png”, w, h) – the image with the haze covering everything
mygroup:insert(haze1)
haze2 = display.newImageRect(“haze2.png”, w, h) – the haze with the hole in it.
haze2. isVisible = false
mygroup:insert(haze2)
Then set your touch handler to set haze1.isVisible to false on event.phase == “began” and set haze2.isVisible to true and set haze2’s x, y to the event x, y. Then on event.phase == “ended” set the visibilities to the opposite. Then I would make haze2 bigger than the whole group and through a mask on the group so that haze2 doesn’t flow out of the group when it moves and it’s big enough to continue to cover things up.

The other idea I had was not anywhere close to what you’re trying to do. [import]uid: 199310 topic_id: 33361 reply_id: 132998[/import]

You will probably need to post a request in the Feature Request forum. I’ll ask if its on the radar or not. It may be an limitation.

Rob [import]uid: 199310 topic_id: 33361 reply_id: 133145[/import]

Thanks Rob… much appreciated [import]uid: 67619 topic_id: 33361 reply_id: 133159[/import]

Rob,

Thanks for that… I had a similar idea… but was hoping I would not have to use it… but my idea is the same as yours… without using a mask… my second image would already have a transparent image cut out at a particular location… which I would move as a whole image… just means the second image would be a lot larger… (also thought about maybe tiling so that it don’t such a big image… but need to do a bit more calculations…)

if I add a mask to any image… it just turns that image black…

much appreciated for your help

any thing in the pipe line at the head office about making the mask transparent? :stuck_out_tongue:

Vik [import]uid: 67619 topic_id: 33361 reply_id: 133065[/import]

You will probably need to post a request in the Feature Request forum. I’ll ask if its on the radar or not. It may be an limitation.

Rob [import]uid: 199310 topic_id: 33361 reply_id: 133145[/import]

Thanks Rob… much appreciated [import]uid: 67619 topic_id: 33361 reply_id: 133159[/import]

Rob & Danny,

I posted about adding images to try and find another way to do this… but ended up with a mask… I got to a stage where it is working thanks to horacebury… but it corona doesn’t seem to apply the mask properly for inverted images…

have a look at this thread… I have submitted as a bug… any thoughts from you guys?

https://developer.coronalabs.com/forum/2012/11/29/it-possible-add-two-images-together [import]uid: 67619 topic_id: 33361 reply_id: 133826[/import]

Rob & Danny,

I posted about adding images to try and find another way to do this… but ended up with a mask… I got to a stage where it is working thanks to horacebury… but it corona doesn’t seem to apply the mask properly for inverted images…

have a look at this thread… I have submitted as a bug… any thoughts from you guys?

https://developer.coronalabs.com/forum/2012/11/29/it-possible-add-two-images-together [import]uid: 67619 topic_id: 33361 reply_id: 133826[/import]