I would like to implement the effect that a short line segment revolving around a square (not knowing the exact effect name, it’s just like the one in war3 to indicate auto-cast spell or in fishingjoy to indicate equipped weapon). Any advise/hint is welcomed. Thanks!
Share
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( 640×960 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)