cocos2d-x lua之创建剪切精灵


欢迎各位童鞋转载,转载请注明出处:http://blog.csdn.net/song_hui_xiang

作者新浪微博:http://weibo.com/u/3168848533

作者腾讯微博:http://t.qq.com/song_huixiang

local  spriteNormal = CCSprite:create(s_MenuItem, CCRectMake(0,23*2,115,23))
local  spriteSelected = CCSprite:create(s_MenuItem, CCRectMake(0,23*1,115,23))
local  spriteDisabled = CCSprite:create(s_MenuItem, CCRectMake(0,23*0,115,23))
local man = CCSprite:create("man.png")
man:setTextureRect(CCRectMake(0,0,50,50))

CCRectMake(x, y, width, height)   x ,y 为起始点坐标,图像的左上角为(0,0)点 ,向右x逐渐增大,向下y逐渐增大,width为正值则向右切,负值向左切;height为正值则向下切,为负值则向上切

你可能感兴趣的:(cocos2d-x lua之创建剪切精灵)