Hello.
i would write the animation app.but in documentation, i have to make a plist file.
is there anybody to write animation without plist files?
in some case, plist file is convenient. but other cases, it's not.
A fast, easy to use, free, and community supported 2D game engine
Hello.
i would write the animation app.but in documentation, i have to make a plist file.
is there anybody to write animation without plist files?
in some case, plist file is convenient. but other cases, it's not.
Yes you can. Small snippet from my game:
spritesheet = [CCSpriteSheet spriteSheetWithFile:@"player1.png"];
for (int i = 0; i < 50; i++) {
int x = i % 8;
int y = i / 8;
CCSpriteFrame* frame = [[CCSpriteFrame alloc] initWithTexture:spritesheet.texture rect:CGRectMake(x * 64, y * 64, 64, 64) offset:ccp(0,0)];
[[CCSpriteFrameCache sharedSpriteFrameCache] addSpriteFrame:frame name:[NSString stringWithFormat:@"playerFrame%d", i]];
[frame release];
}
sprite = [[CCSprite alloc] initWithSpriteFrameName:[NSString stringWithFormat:@"playerFrame%d", 0]];
[spritesheet addChild:sprite];
// Blink Animation
NSMutableArray* animFrames = [NSMutableArray array];
for (int i = 0; i < 4; i++) {
CCSpriteFrame* frame = [[CCSpriteFrameCache sharedSpriteFrameCache] spriteFrameByName:[NSString stringWithFormat:@"player%dFrame%d", player.key, i]];
[animFrames addObject:frame];
}
idleAnimation = [CCAnimation animationWithName:@"blink" frames:animFrames];You must log in to post.