How to convert a CCSpriteFrame to a CCTexture2D (Cocos2d)

后端 未结 2 1270
野趣味
野趣味 2021-01-26 16:35

Is it possible to convert a CCSpriteFrame that was taken from CCSpriteFrameCache, and convert it into a texture that can be set on a sprite texture pro

2条回答
  •  执笔经年
    2021-01-26 16:59

    Yes, it has a texture function:

    [[[CCSpriteFrameCache sharedSpriteFrameCache]spriteFrameByName:@"MyFrame"]texture];
    

    CCSprites have a method called setTexture or something.

提交回复
热议问题