posts - 13, comments - 0, trackbacks - 0, articles - 0
  C++博客 :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理

CCSprite 改变图片的方法

Posted on 2013-03-18 10:36 午夜凉饭 阅读(406) 评论(0)  编辑 收藏 引用
在使用CCSpriteFrameCache 初始化的情况下更换sprite图片的方法。
p.s : 如果使用spriteWithFile 则使用setTexture.
CCSpriteFrameCache* cache = [CCSpriteFrameCache sharedSpriteFrameCache]; CCSpriteFrame* frame = [cache spriteFrameByName:name]; [sprite setDisplayFrame:frame];



只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理