我想知道,我怎样才能改变CCAnimation的延迟?
_monstrAnim = [CCAnimation animationWithFrames:monstrAnimFrames delay:0.1f];
self.monstr = [CCSprite spriteWithSpriteFrameName: [NSString stringWithFormat:@"monstr_%d_1.png", currentLevel]];
self.walkAction = [CCRepeatForever actionWithAction:[CCAnimate actionWithAnimation:_monstrAnim restoreOriginalFrame:NO]];
[self.monstr runAction:self.walkAction];
[monstrSpriteSheet addChild:self.monstr z:1];
Run Code Online (Sandbox Code Playgroud)
这工作正常,但我应该改变FPS的速度,我做...
Run Code Online (Sandbox Code Playgroud)[self.monstr stopAllActions]; [self.monstr runAction:self.walkAction]; [self.monstrAnim setDelay:1];
但什么都没发生......
如何在cocos2d 1.1中设置z-index到ccDrawPoly()来在场景中的所有CCSprite上面绘制?
-(void)draw
{
CGSize screenSize = [[CCDirector sharedDirector] winSize];
glEnable(GL_LINE_SMOOTH);
glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
glColor4ub(0, 0, 255, 255);
glLineWidth(2);
CGPoint vertices2[] = { ccp(0,0), ccp(0,screenSize.height*0.5), ccp(screenSize.width*0.5,screenSize.height*0.5), ccp(screenSize.width*0.5,0) };
ccDrawPoly(vertices2, 4, YES);
}
Run Code Online (Sandbox Code Playgroud) 如何在GameConfig.h中存储CCLabelTTF颜色,如:
#define kGameLabelColor ccc3(79,71,59);
Run Code Online (Sandbox Code Playgroud)