int score = 35; float time = 0.03; char* name = "Michael"; char text[256]; sprintf(text,"name is %s, time is %.2f, score is %d", name, time, score); CCLabelTTF* label = CCLabelTTF::labelWithString(text,"Arial",20); this->addChild(label);
source share