小编Ale*_*nov的帖子

改变CCAnimation的延迟

我想知道,我怎样才能改变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的速度,我做...

            [self.monstr stopAllActions];
            [self.monstr runAction:self.walkAction];
            [self.monstrAnim setDelay:1];
Run Code Online (Sandbox Code Playgroud)

但什么都没发生......

delay cocos2d-iphone

3
推荐指数
1
解决办法
1494
查看次数

cocos2d ccDrawPoly在CCSprite上

如何在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)

drawing z-index sprite cocos2d-iphone

1
推荐指数
1
解决办法
1758
查看次数

在GameConfig.h中存储CCLabelTTF颜色

如何在GameConfig.h中存储CCLabelTTF颜色,如:

#define kGameLabelColor ccc3(79,71,59);
Run Code Online (Sandbox Code Playgroud)

iphone label cocos2d-iphone ios

0
推荐指数
1
解决办法
256
查看次数

标签 统计

cocos2d-iphone ×3

delay ×1

drawing ×1

ios ×1

iphone ×1

label ×1

sprite ×1

z-index ×1