Created
September 4, 2014 13:56
-
-
Save sag333ar/7c6610cebe06de6c4638 to your computer and use it in GitHub Desktop.
Create label in Cocos2d-x & set few properties
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
// create label with text, font and font size | |
auto label = LabelTTF::create("Wheel of Fortune", "Marker Felt", 20); | |
// get the size of the label | |
Size labelSize = label->getDimensions(); | |
// set the position of the label | |
label->setPosition(Vec2(20,20)); | |
// set the text color of the label | |
label->setColor(Color3B(255.0, 0.0, 0.0)); | |
// add the label to your scene-layer | |
this->addChild(label, 2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment