0
此代碼由場景中的精靈使用,以便拖動它們。我在嘗試弄清楚如何將此代碼轉換爲與cocos2d-mac模板兼容時遇到問題。我感謝任何幫助。有人可以幫助我轉換這個cocos2d-iphone特定的代碼,以與cocos2d-mac模板兼容嗎?
////////////////////////////////////////////////////
/////properties for touches moved
- (void)ccTouchMoved:(UITouch *)touch withEvent:(UIEvent *)event {
CGPoint touchLocation = [self convertTouchToNodeSpace:touch];
CGPoint oldTouchLocation = [touch previousLocationInView:touch.view];
oldTouchLocation = [[CCDirector sharedDirector] convertToGL:oldTouchLocation];
oldTouchLocation = [self convertToNodeSpace:oldTouchLocation];
CGPoint translation = ccpSub(touchLocation, oldTouchLocation);
[self panForTranslation:translation];
}
我收到「oldMouseLocation」範圍中未聲明。謝謝你這一點,但你認爲你能幫助我這個錯誤。 – Jeff 2011-03-03 15:07:14
對不起,我固定它。 – 2011-03-03 19:24:53