Cocos2d-x in order to reduce the development difficulty, for the realization of animation frame animation scheme. This means that the animation in the Cocos2d-x is a frame animation.
The principle of frame animation is familiar to everyone, that is, multiple images are played cyclically to achieve the animation effect.
A simple animation is implemented as follows:
Player = cc. sprite: create ("image/player.png") player: setPosition (-width/4, 0) local animation = cc. animation: create () animation: animation ("image/player.png") animation: animation ("image/player_2.png") Animation: addSpriteFrameWithFile ("image/player_3.png") animation: setDelayPerUnit (0.1) animation: setLoops (-1) local action = cc. animate: create (animation) player: runAction (action)This is a piece of lua code. It is not difficult to see from the code that every frame of the animation here is an image. In actual operations, such operations will bring a lot of performance loss, therefore, we usually organize all the images through plist to form a large image, in this way, each animation frame obtains the desired texture from the large image through the coordinate range information recorded in plist, thus improving the animation performance.
[Cocos2d-x development problems-3] cocos2dx Animation introduction