Game Development Reference
In-Depth Information
Batch drawing sprites
In Cocos2d-x, sprite sheets can be used in conjunction with a specialized node, called
SpriteBatchNode . This node can be used whenever you wish to use multiple sprites
that share the same source image inside the same node. So you could have multiple in-
stances of a Sprite class that uses a bullet.png texture for instance. And if the
source image is a sprite sheet, you can have multiple instances of sprites displaying as
many different textures as you could pack inside your sprite sheet.
With SpriteBatchNode , you can substantially reduce the number of calls during the
rendering stage of your game, which will help when targeting less powerful systems,
though not noticeably in more modern devices.
Let me show you how to create a SpriteBatchNode .
Search WWH ::




Custom Search