Masking interfering with touch mechanism

Hi all,

Recently I found a strange bug in Corona.

I’m making a group of image inside a border and I should be able to move that around.

It can be illustrated as the attached files.

The word “Some” outside the border should not be visible, so I make a mask image with white block in the middle.

The implementation is something like this:

local group = display.newGroup() group.x, group.y = 100, 100 local image = createImage() image.x, image.y = 0, 0 group:insert(image) local mask = graphics.newMask("mask.png") group:setMask(mask) local border = createBorder() border.x, border.y = 100, 100 image:addEventListener("touch", dragFunction)

The masking is just works fine, the problem is, the dragFunction is sometimes not working.

I think the mask is somehow blocking the touch event even though the image is still in visible area.

And I believe it’s not my implementation, because if I remove the mask, the dragFunction is working beautifully.

Is this a known issues? and is there any workaround for this?

Can I modify this with native (enterprise)?

Thanks.

Hi @dev979,

Did you try to set the hit masking on the group to false? It’s true by default, but you can swap it:

[lua]

group.isHitTestMasked = false

[/lua]

Let me know if that solves it for you,

Brent Sorrentino

ok, that works, thanks!

Hi @dev979,

Did you try to set the hit masking on the group to false? It’s true by default, but you can swap it:

[lua]

group.isHitTestMasked = false

[/lua]

Let me know if that solves it for you,

Brent Sorrentino

ok, that works, thanks!