bool HelloWorld::init()

{

    if ( !Layer::init() )

    {

        return false;

    }

    

    Size visibleSize = Director::getInstance()->getVisibleSize();

    Vec2 origin = Director::getInstance()->getVisibleOrigin();

 

    auto icon=Sprite::create("CloseSelected.png");

    //addChild(icon);

    icon->setPosition(visibleSize/2);

    

    auto size=icon->getContentSize();

    CCLOG("SIZE:%f %f",size.width,size.height);

    

    schedule([icon](float f){

        auto size=icon->getContentSize();

        CCLOG("SIZE:%f %f",size.width,size.height);

    },"test");

    

    icon->retain();

    

    return true;

}

 

posted on 2016-02-29 19:45  baraka  阅读(122)  评论(0编辑  收藏  举报