1
对不起,新手问题,但三天后,我需要帮助。有人能帮助我吗?Cocos2d CCProgressTimer图像未绘制。为什么?
我尝试使用CCProgressTimer
作为我的课,我尝试将游戏的图像预加载到CCTextureCache
。我试图创建最简单的代码:
- 创建
NSArray
与图像'pathes。 - 添加该数组中的每个图像并同时更新进度栏。
但我的进度条没有更新之前成为100%。我加NSLog
跟踪到-(void)setPercentage:(float) percentage
,它看起来像:
NSLog(@"percentage %f", percentage);
if(percentage_ != percentage) {
percentage_ = clampf(percentage, 0, 100);
[self updateProgress];
}
我看到消息将每个图像:
...
percentage 25
percentage 30
percentage 35
...
但进度条(图像)的更新只有它变成100.我认为[self updateProgress]
应在每次调用setPercentage
时更新进度图像。
我的错误在哪里?
谢谢Steffen! – alexg