您的位置:首页 > Web前端 > Node.js

CCSpriteBatchNode使用限制

2014-08-22 11:47 281 查看
CCSpriteBatchNode islike a batch node: if it contains children, it will draw them in 1single OpenGL call (often known as "batch draw").

A CCSpriteBatchNode canreference one and only one texture (one image file, one textureatlas). Only the CCSprites that are contained in
that texture canbe added to the CCSpriteBatchNode.All CCSprites added to a CCSpriteBatchNode aredrawn
in one OpenGL ES draw call. If the CCSprites are not added toa CCSpriteBatchNode thenan OpenGL ES draw call will be needed for each one,
which is lessefficient.

Limitations:

The onlyobject that is accepted as child (or grandchild, grand-grandchild,etc...) is CCSprite or
anysubclass of CCSprite. eg: particles, labelsand layer can't be added to a CCSpriteBatchNode.
Either all its children areAliased or Antialiased. It can't be a mix. This is because "alias"is a property of the texture, and all the sprites share the sametexture.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: