Is it possible to add touch event to sprite to cocosSharp?
In main layout I have several sprites and need to add touch event for each of them .
I have found out CCTouch and added it to sprite action
but it isn't steel clear how to handle moving event?
Have you seen the Introduction to Game Development with CocosSharp
Here is the part about Moving the paddle with touch input
@kjpou1 thanks for answer . yeah I have seen , but here is defined move only one object - paddleSprite during touch, I need to detect which object (sprite) is touched and move this particular one .
Not sure exactly but maybe this will help you out. This of course would go inside your touch handler.
// sprite 1 is hit
else if (sprite2.BoundingBoxTransformedToWorld.ContainsPoint(touches.Location))
// sprite 2 is hit
@kjpou1 this exactly helped me . thanks
How to get multiple touch points on each layer? as this BoundingBoxTO parent or world method doesn't work for the multiple ccsprite touch at same time and gives touch of the first touch done on layer always
Xamarin Inc., as a wholly-owned Microsoft subsidiary acting as a separate legal entity, adheres to the Microsoft Privacy Statement: Privacy & cookies