关于 AtlasSprite &  AtlasSpriteManager

1):AtlasSprite

AtlasSprite 可当作sprite

AtlasSprite has all the features from CocosNode with the following additions and limitations:

  • New features
    • It is MUCH faster than Sprite
    • supports flipX, flipY

 

  • Limitations
    • Their parent can only be an AtlasSpriteManager
    • They can't have children
    • Camera is not supported yet (eg: OrbitCamera action doesn't work)
    • GridBase actions are not supported (eg: Lens, Ripple, Twirl)
    • The Alias/Antialias property belongs to AtlasSpriteManager, so you can't individually set the aliased property.
    • The Blending function property belongs to AtlasSpriteManager, so you can't individually set the blending function property.
    • Parallax scroller is not supported, but can be simulated with a "proxy" sprite.

 2):AtlasSpriteManager

    我也不知道 。。。。。。。。

    字面意思 管理AtlasSprite用的

 

 3):效果

  

  

  中间三角形部分的效果可用此做出。

 4):用法

   1 先创建AtlasSpriteManager类对象 :

      AtlasSpriteManager *m_spriteManager = [AtlasSpriteManager spriteManagerWithFile:@"GradeColor.png"];

 

   2 创建CGRect变量 该变量用于从m_spriteManager 中截取对应的部分。

          CGRect rect = CGRectMake(<#CGFloat x#>, <#CGFloat y#>, <#CGFloat width#>, <#CGFloat height#>);

 

   3   从m_spriteManager中开始截取, 并且返回AtlasSprite类对象:

        AtlasSprite* sp = [AtlasSprite spriteWithRect:rect spriteManager:m_spriteManager];