auto scene = Scene::create(); auto sprite = Sprite::create("image.png"); scene->addChild(sprite);
auto scene = Scene::create(); auto label = Label::createWithTTF("Hello, World!", "fonts/arial.ttf", 24); label->setPosition(Vec2(100, 100)); scene->addChild(label);This example creates a new scene, creates a new label with a font file and text content, sets the label's position, and adds the label as a child node to the scene using the addChild method. Package/library: cocos2d-x.