• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

iOS Touch Sprite Area?

Jason C.

Member
Is it possible to enable a touch event on a sprite, but only if touched with a specific area within the sprite itself? I don't want the event to fire if the player touches the sprite outside the allowed touch area.
 
K

kevins_office

Guest
Or... can you get the touch xy like mouse xy in a touch event?
Have the event fire if the object is touched anywhere, then inside that event check the xy location and if its outside of the area you want it to react with then exit the event without running the code you want for when they touch inside the correct area.
 

Jason C.

Member
Either change the collision mask or create a new object that fills this area.
Ok, so Collision Mask. I'm evaluating GM2, coming from Unity3D so I have this and other technical questions. Touch/Gesture Events can be peered with Collision Masks. I believe this is answer I needed. Same in Unity.
 
Top