Rectangles with a setFillColor() with an alpha of zero are not drawn at all so don't receive touch events

One thing I use a fair amount for invisible hit tests are rectangles with a setFillColor() where the alpha is zero - so they are still there (and likely drawn too, but I can handle the speed hit for this), and receive touch events.

I found out now that this is no longer the case. I assume that somewhere along the pipeline anything with an alpha of zero gets dropped as in theory it doesn’t affect the screen. But these objects aren’t receiving touch events anymore, and this is indeed a big deal.

For now, solution = set the alpha to almost zero :slight_smile:

Are you setting .isHitTestable to true?

I errr wasn’t aware that existed (as I’d not needed to use it in the past). I shall report back :slight_smile:

.isHitTestable doesn’t fix that exact issue (alpha of zero but object is visible not receiving events), but since making it invisible but receive events makes more sense (and works with .isHitTestable) I shall grumble for a few seconds only, then go back to my work with a smile on my face.

Thanks!

Sounds exactly like:

http://forums.coronalabs.com/topic/38529-preliminary-results-converting-real-world-app/?p=201692

In which case this is the same bug.

Indeed it does. At least it has a work-around (more than that, having it invisible and ishittestable is simply better!).

Are you setting .isHitTestable to true?

I errr wasn’t aware that existed (as I’d not needed to use it in the past). I shall report back :slight_smile:

.isHitTestable doesn’t fix that exact issue (alpha of zero but object is visible not receiving events), but since making it invisible but receive events makes more sense (and works with .isHitTestable) I shall grumble for a few seconds only, then go back to my work with a smile on my face.

Thanks!

Sounds exactly like:

http://forums.coronalabs.com/topic/38529-preliminary-results-converting-real-world-app/?p=201692

In which case this is the same bug.

Indeed it does. At least it has a work-around (more than that, having it invisible and ishittestable is simply better!).