Quantcast
Channel: Cocos中文社区 - 最新主题
Viewing all articles
Browse latest Browse all 88737

大神们怎么更换精灵帧的图片?

$
0
0

@ycdiv 写道:

看一下代码吧:
SpriteBatchNode* batch = SpriteBatchNode::create("puke.png", 44);
addChild(batch, 1);
SpriteFrameCache::getInstance()->addSpriteFramesWithFile("puke.plist");

auto sprite1 = Sprite::createWithSpriteFrameName("paimian_Z.png");
auto sprite1X = paimian->getContentSize().width;
auto sprite1Y = paimian->getContentSize().height;
auto spriteNumber = Sprite::createWithSpriteFrameName(*(pokerNumber+Number));
spriteNumber->setPosition(25,sprite1 -30);
sprite1>addChild(spriteNumber);
auto spriteNumber2 = Sprite::createWithSpriteFrameName(*(pokerNumber+Number));
spriteNumber2->setPosition(sprite1X - 25, 30);
spriteNumber2->setFlippedY(true);
spriteNumber2->setFlippedX(true);
sprite1->addChild(spriteNumber2);
addChild(sprite1);
请问怎么更改上面两个spriteNumber的帧!
我这做的是一张合图,希望各位大神看看我这么做对吗???

帖子: 2

参与者: 1

阅读整个主题


Viewing all articles
Browse latest Browse all 88737

Trending Articles