随笔分类 -  cocos2d

cocos2d - CCParallaxNode 例子
摘要:CGSize winSize = [[CCDirector sharedDirector] winSize]; CCParallaxNode * node = [CCParallaxNodenode]; CCSprite * sp1 = [CCSprite spriteWithFile:@"bear1.png"]; sp1.position = ccp( winSize.width/2,winSize.height/2); CCSprite * sp2 = [CCSprite spriteWithFile:@"bear2.png"]; ... 阅读全文

posted @ 2014-03-07 19:22 景树园 阅读(190) 评论(0) 推荐(0)

cocos2d CCLayer 触摸相关
摘要:要让一个 CCLayer 能够接受触摸输入 需要进行如下设置:[selfsetTouchEnabled:YES];cocos2d-x提供了两种触摸事件处理机制, 分别是CCStandardTouchDelegate 和CCTargetedTouchDelegate。CCStandardTouchDelegate包含四个回调函数,分别如下: virtual void ccTouchesBegan(CCSet *pTouches, CCEvent *pEvent) 处理用户按下事件 virtual void ccTouchesMoved(CCSet *pTouches, CCEvent *p... 阅读全文

posted @ 2014-02-25 22:18 景树园 阅读(133) 评论(0) 推荐(0)

导航