0

我想实现一个短线段围绕一个正方形旋转的效果(不知道确切的效果名称,就像war3中表示自动施法或fishingjoy中表示装备武器的效果一样)。欢迎任何建议/提示。谢谢!

4

1 回答 1

0

You have several variants. The first one, the easiest, to create frame animation of desired effect and run it on the empty CCSprite instance, that will be placed over your weapon icon. I think, 5 or 6 frames of animation will be enough. Big plus - you can create any desired effects on these frames in photoshop, and it is easy to add existing frames as animation to your project. Minus - it will take additional place in your texture cache, spriteframe cache and it will increase the size of your app. This is the good solution, if your square is quite small, because if your square will have large contentSize, it will take a lot of useless memory. For example, 6 frames of such animation with the size of screen( 640x960 pixels on retina screen ) wil take additional 16Mb of your memory.

The second variant, IMHO, much more interesting)) And it can help to save memory) This variant is to implement this animation with OpenGL) But it seems to be much more complicated)

于 2012-04-18T12:56:34.287 回答