Cocos2DXNA / cocos2d-xna

XNA Port of Cocos2d-X
www.cocos2dxna.com
227 stars 123 forks source link

Implement z-order bias for touch handling #396

Closed totallyeviljake closed 10 years ago

totallyeviljake commented 10 years ago

when touch handlers overlap on the screen the touch events are sent to all of them. the touch should be handled in a z-order fashion where the top most node gets to process the touches and discard them if they are not in the node.

totallyeviljake commented 10 years ago

Please implement this soon. We see this manifest always in some ccflash tests.

totallyeviljake commented 10 years ago

I have added support for this in the following commit:

https://github.com/Cocos2DXNA/cocos2d-xna/commit/11550368cb62c79827101527c2e45c78ab7eb8ac

You enable it by using the CCConfiguration class (CCConfiguration.UseGraphPriority)

totallyeviljake commented 10 years ago

My last commit https://github.com/Cocos2DXNA/cocos2d-xna/commit/5e0fb08162dccf6d17a5819bb26ac1646f42c442 is making the graph priority work more reliably. I still see some oddities in the graph dispatcher, but mostly this is working as expected. CCControl had some hard coded priority values (1) and overrode some behavior that did not make sense.

totallyeviljake commented 10 years ago

The first attempt at fixing this did not work properly. So I implemented read graph order indexing of the touch handlers.

https://github.com/Cocos2DXNA/cocos2d-xna/commit/ae5b6637f6cdb1db4c58527b1f2fe2da90db850d