Problem with masks?

Hi Folks,

Has anyone has any trouble with masks in build 2011.704?

I’m doing something like this:
global object =
local mask = graphics.newMask(maskFile)
object:setMask(mask)
object.isHitTestMasked = true
object:addEventListener(“touch”, listener)

Problem is: touch coverage is really patchy. Some pixels (within the mask!!) don’t receive touch events, while neighboring pixels do. Fortunately I don’t get any touch events outside the mask :slight_smile:

[I’m seeing this behaviour in the sim! haven’t tried on a test device yet]

My mask dims are multiples of 4 pixels (116x448) to be precise. Does scaling the mask affect anything??

And here’s the kicker… it works perfectly in build 2011.591. Anyone else seen any weird behaviour differences between .591 and .704?

Thanks anyone… [import]uid: 76436 topic_id: 20613 reply_id: 320613[/import]

I haven’t experienced that problem yet but I’m having a bit more serious issue with masks crashing the simulator reliably anytime I try to scroll past or near one. Have you ever had this happen to you? I’m not a subscriber at this point so I’m wondering if there is a bug fix checked in the newer builds for this. [import]uid: 119678 topic_id: 20613 reply_id: 97711[/import]

Hi Stu,

I haven’t seen that behaviour. When I was looking into Masks, I noticed that they were pretty tricky things and there are a bunch of caveats associated with them. For example, I seem to recall that your mask dimensions should be a multiple of 4 pixels in both the x and y dimensions.

So, all I can think is that there is some subtlety associated with using masks that is crashing the sim…

Sorry I can’t be more help. [import]uid: 76436 topic_id: 20613 reply_id: 97988[/import]

Thanks for the reply MaCai!

Yeah, I noticed there are a few caveats regarding masks as well. I tried loading the scene up on a device and it gave me a little hiccup where it would normally crash in the simulator but other than that it ran fine.

Sorry I couldn’t help you with your problem at this point but if I can in the future I’ll be sure to get back to you. [import]uid: 119678 topic_id: 20613 reply_id: 97998[/import]