bool HelloWorld::init()
{
if ( !Layer::init() )
{
return false;
}
Size visibleSize = Director::getInstance()->getVisibleSize();
Vec2 origin = Director::getInstance()->getVisibleOrigin();
//auto logo=Sprite::create("Saloon (10).png");
/*auto img=Director::getInstance()->getTextureCache()->addImage("Saloon (10).png");
auto logoSize=img->getContentSize();
CCLOG("logo size:%f %f",logoSize.width,logoSize.height);
auto logo=Sprite::createWithTexture(img);
logo->setPosition(visibleSize/2);
addChild(logo);
*/
auto layer1=Layer::create();
auto layer2=Layer::create();
auto layer3=Layer::create();
auto img1=Sprite::create("Saloon (1).png");
auto img2=Sprite::create("Saloon (2).png");
auto img3=Sprite::create("Saloon (11).png");
img1->setAnchorPoint(Vec2(0,0));
img2->setAnchorPoint(Vec2(0,0));
img3->setAnchorPoint(Vec2(0,0));
layer1->addChild(img1);
layer2->addChild(img2);
layer3->addChild(img3);
addChild(layer1);
addChild(layer2);
addChild(layer3);
layer1->setPosition(visibleSize/4);
layer2->setPosition(visibleSize/3);
layer3->setPosition(visibleSize/2);
schedule([visibleSize,this](float f){
auto scene2=Scene::create();
auto scene2Layer=Layer::create();
scene2->addChild(scene2Layer);
auto logo=Sprite::create("Saloon (10).png");
logo->setPosition(visibleSize/2);
scene2Layer->addChild(logo);
Director::getInstance()->replaceScene(scene2);
},3,"Test");
return true;
}