cocos2d- AtlasSprite & AtlasSpriteManager

关于 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];

转载于:https://www.cnblogs.com/JustAlloc/archive/2013/02/26/2934193.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值