animationArray = [[NSMutableArray alloc]initWithCapacity:0];
for (int i = 0; i < 52; i ++)
{
NSString *str;
if (i < 10)
{
str = [NSString stringWithFormat:@"hall_01000%d.png",i];
}
else
{
str = [NSString stringWithFormat:@"hall_0100%d.png",i];
}
[animationArray addObject:str];
}
starImage = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"hall_010004.png"]];
starImage.frame = CGRectMake(0, 0, 86/2, 79/2);
starImage.center = ccp(P_WIDTH-30,25);
[self addSubview:starImage];
starTimer = [NSTimer scheduledTimerWithTimeInterval:.1 target:self selector:@selector(transformImg) userInfo:nil repeats:YES];
}
- (void)transformImg
{
NSString *starImgName = [animationArray objectAtIndex:index];
starImage.image = [UIImage imageNamed:starImgName];
index = ++ index % 51;
}
for (int i = 0; i < 52; i ++)
{
NSString *str;
if (i < 10)
{
str = [NSString stringWithFormat:@"hall_01000%d.png",i];
}
else
{
str = [NSString stringWithFormat:@"hall_0100%d.png",i];
}
[animationArray addObject:str];
}
starImage = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"hall_010004.png"]];
starImage.frame = CGRectMake(0, 0, 86/2, 79/2);
starImage.center = ccp(P_WIDTH-30,25);
[self addSubview:starImage];
starTimer = [NSTimer scheduledTimerWithTimeInterval:.1 target:self selector:@selector(transformImg) userInfo:nil repeats:YES];
}
- (void)transformImg
{
NSString *starImgName = [animationArray objectAtIndex:index];
starImage.image = [UIImage imageNamed:starImgName];
index = ++ index % 51;
}