PortalSprite* PortalSprite::createWithPortalSprite(const char* path)
{
    PortalSprite* sprite = new PortalSprite(path);
    if (sprite && sprite->init())
    {
        sprite->autorelease();
        sprite->playAnimate();
        return sprite;
    }
    CC_SAFE_DELETE(sprite);
    return NULL;
}
Exemple #2
0
void BgMap::initBgMapPassagewayImage()
{
    vector<struct PortalInformation>::iterator itr;
    for (itr=m_mapPassageway.begin(); itr!=m_mapPassageway.end(); itr++)
    {
        Point point = MapPoint((*itr).point).getCCPointValue();
        
        //生成传送门
        float value = BgMap::getZOrder(point);//z轴
        
        PortalSprite* sprite = PortalSprite::createWithPortalSprite("trans-");
        sprite->setPosition(point);
        this->addChild(sprite, value);
    }
}
Exemple #3
0
PortalSprite* PortalSprite::createWithID(int ID)
{
    PortalSprite* sp = new PortalSprite;

    if (sp && sp->initWithAnimation(ID, "open"))
    {
        sp->autorelease();
    }
    else
    {
        CC_SAFE_DELETE(sp);
    }

    return sp;
}