iDev
cocos2d iphone to mac, touch to click
KraZYeom
2012. 6. 5. 08:10
반응형
터치와 클릭의 개념이 살짝 다르므로 몇몇만 수정해주면 그대로 사용가능함.
self.isTouchEnabled = YES;
self.isMouseEnabled = YES;
- (BOOL)ccTouchBegan:(UITouch *)touch withEvent:(UIEvent *)event{ CGPoint touchLocation = [touch locationInView:[touch view]]; touchLocation = [[CCDirector sharedDirector] convertToGL:touchLocation];}
- (BOOL)ccMouseDown:(NSEvent *)event{ CGPoint touchLocation = [[CCDirector sharedDirector] convertEventToGL:event]; }
반응형