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