auto sprite = Sprite::create("ID003_Western-Castle_noon.jpg");
if (sprite == nullptr)
{
problemLoading("'ID003_Western-Castle_noon.jpg'");
}
else
{
// position the sprite on the center of the screen
sprite->setPosition(Vec2(visibleSize.width/2 + origin.x, visibleSize.height/2 + origin.y));
// add the sprite as a child to this layer
this->addChild(sprite, 0);
}
auto scaleRate = visibleSize.height / sprite->getContentSize().height;
sprite->setScale(scaleRate);
auto str = String();
str.appendWithFormat("width %f height %f", sprite->getContentSize().width, sprite->getContentSize().height);
label->setString(str.getCString());