This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifdef SHELL | |
g++ -Wall -Werror -g -I../../cclib/rapidjson/include $0 && ./a.out | |
exit 0 | |
#endif | |
// Output is: | |
// {"project":"rapidjson","stars":11} | |
// {"Name":"XYZ","Rollnumer":2,"array":["hello","world"],"Marks":{"Math":"50","Science":"70","English":"50","Social Science":"70"}} | |
// {"FromEmail":"sender@gmail.com","FromName":"Sender's name","Subject":"My subject","Recipients":[{"Email":"recipient@gmail.com"}],"Text-part":"this is my text"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Size visibleSize = Director::getInstance()->getVisibleSize(); | |
Vec2 origin = Director::getInstance()->getVisibleOrigin(); | |
auto bg = Sprite::create("menubg.png"); | |
bg->setPosition(Vec2(origin.x + visibleSize.width / 2, origin.y + visibleSize.height / 2)); | |
this->addChild(bg); | |
// To make the image fit the screen no matter what the resolution is, you need to scale the image. | |
// To scale the image to perfectly fit the screen: | |
bg->setScale(visibleSize.width / bg->getContentSize().width, visibleSize.height / bg->getContentSize().height); |