DNESS / cocos2d-iphone

Automatically exported from code.google.com/p/cocos2d-iphone
1 stars 0 forks source link

kCCDirectorProjectionCustom/CCProjectionProtocol breaks CCMenu hit detection #1104

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Pass kCCDirectorProjectionCustom to the director
2. Use CCProjectionProtocol
3. Create a projection protocol with an x or y offset. here is what i am using:
glViewport(offset.x, offset.y, widthAspect, heightAspect);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
ccglOrtho(0, widthAspect, 0, heightAspect, -1024, 1024);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();

What is the expected output? What do you see instead?
Breaks mouse detection on CCMenu items. Mouse detection is offset because it 
doesnt factor in the projection matrix.

seems like CCProjectionProtocol should have a method to override:- (CGPoint) 
convertToLogicalCoordinates:(CGPoint)coords if protocol is set to 
kCCDirectorProjectionCustom

What cocos2d version / SVN revision are you using ?
99.5

What iPhoneSDK are you using ?
Mac

Debug or Release ?
Debug

Does this happens on device ? or on the simulator ? or on both ?
N/A

Please provide any additional information below.

Original issue reported on code.google.com by emable...@gmail.com on 4 Feb 2011 at 3:09

GoogleCodeExporter commented 9 years ago

Original comment by ricardoq...@gmail.com on 8 Feb 2011 at 12:56

GoogleCodeExporter commented 9 years ago
rescheduled for v1.1

Original comment by ricardoq...@gmail.com on 13 Jul 2011 at 9:44

GoogleCodeExporter commented 9 years ago
Thanks, fixed..

https://github.com/cocos2d/cocos2d-iphone/commit/79aee09e1cb696756f99ec5fe7197dc
3c8c467c6

Leaving it open for 2.x

Original comment by marcotil...@gmail.com on 16 Sep 2012 at 1:32

GoogleCodeExporter commented 9 years ago

Original comment by marcotil...@gmail.com on 19 Sep 2012 at 5:41