Hi guys, I’m drawing a few blanks here and was wondering if anybody had a innovative way around this seemingly simple problem.
I’m making a coloring book app which uses several parts of an image packed onto a graphics sheet. If you imagine a dog for example, the head, body, each leg, and tale etc. would all be separate images but within the same overall image size. So imagine a massive transparent area with just a leg in one part of the whole area. To build the whole image I just call a loop that plonks each layer on top of the next and voila I have one whole dog.
I then add a touch listener to each separate part so I can change the fill color when it is touched. However the issue is, the transparent areas around the boundary of each individual image are also detecting the touch so any overlaps causes the top most layer to grab the event.
I tried masking each image but I then I got the opposite problem where the touch doesn’t fire on the transparent part but it also stops it firing on the non transparent part on lower layers.
The main objective is to solve the problem as simply as possible. I am trying to avoid having to have a configuration for the layer order of the images or any other configuration specific stuff going on as we have many images that we will be using.
The main problem to solve is how not to detect touches on transparent parts of images.
Has anyone come across this before? Did you get around it somehow? As always any advice is much appreciated