I created a script which picks up alpha data from any png you give it and when you drag the red square with the mouse on to it it does a hit test detection based off the alpha data on that specified pixel. It works great in desktop, but i can’t figure out why on the ipad in hype reflect it offsets and it still works but its always offset. I dont get which one of my items is messing up on ipad.
i get the document offset with
i get the mouse position with
and all of these return the exact same value on ios(see all the output text boxes i have set up) and yet it offsets any suggestions on what’s causing this appreciated.
imagedata_v3.zip (101.0 KB)
Are you seeing the correct behavior in Mobile Safari?
I think it is working correctly for me:
Can you clarify what numbers you’re expecting see in different situations and what you are seeing?
Hey yeah I solved this now,
the bounding boxes weren’t giving me correct dimensions so i changed them to parseInt(image1.style.left)
And now i have a hit test detector for image alpha
imagedata_v4.zip (94.9 KB)