記事一覧

cocos2d - run animation on startup

I intended to run an animation at my app's startup, like my app's logo slides in. But it won't run at all, while direct changes to parameters (like sprite.opacity=100 etc.) work without problem.

I don't know the reason, but I set a timer to wait a bit before starting animation and it worked fine.
You have to notice that you should use NSTimer instead of CCNode's schedule: method.
CCNode's schedule method doesn't work maybe because of the same reason.


アプリのスタート時に、ロゴがスライドインしてくるようなアニメーションをさせたかったのだけど、どうも動いてくれない。パラメータを直接変更する(sprite.opacity=100 とか)は反映しているんだが。

理由はよくわからないが、タイマーを使ってちょっと待ってからスタートさせるようにしたらとりあえず動きました。
ただし注意なのが、NSTimer を使うという点。
CCNode の schedule: だとやはり動かないようです。何か共通した原因があるっぽい。