继承精灵
bool CPlayerOne::init()
{
if (!Sprite::initWithSpriteFrameName("Plane0_0.png")) //Image/Plane.plist里面的精灵帧
{
return false;
}
return true;
}
继承节点:节点不能承载图片,要创建一张图片
CC_SYNTHESIZE_READONLY(Sprite*, m_pPic, Pic);
bool CPlayer::init()
{
if (!Node::init())
{
return false;
}
m_pPic = Sprite::createWithSpriteFrameName("Plane0_0.png");
this->addChild(m_pPic);
}