创建精灵的几种方式:有什么差别
赤芯木 2017-10-10 11:00:07 创建精灵的几种方式:
直接创建:
auto sprite = Sprite::create("HelloWorld.png");
this->addChild(sprite,0);
使用纹理来创建精灵
auto sprite1 = Sprite::createWithTexture(TextureCache::getInstance()->addImage("HelloWorld.png"));
this->addChild(sprite1, 0);
使用精灵帧来创建精灵
auto sprite2=Sprite::createWithSpriteFrameName("HelloWorld.png");
this->addChild(sprite2, 0);