In this recipe, we will look at how textures are created and attached to sprites. We will also do some content change (that is, frame changing animations) with the help of textures.
To get started with textures to be animated, we should know about scenes, nodes, and sprites. As sprites are created with an image and are added on scene, which occupies more memory, textures should be a solution to this problem.
As the images are stored in
App Bundle, the simplest way to create a sprite with texture is to create the texture first and then the sprite using the same texture. At runtime, the images are loaded from the app bundle to become the texture and then the visible entity called sprite.
So in the ...