LabelTTF * LabelTTF::create() { LabelTTF * ret = new LabelTTF(); if (ret && ret->initWithString("", "assets/fonts/DroidSansFallback.ttf", 12, Size::ZERO, TextHAlignment::CENTER, TextVAlignment::TOP)) { ret->autorelease(); return ret; } CC_SAFE_DELETE(ret); return nullptr; }
LabelTTF* LabelTTF::create(const std::string& string, const std::string& fontName, float fontSize, const Size &dimensions, TextHAlignment hAlignment, TextVAlignment vAlignment) { LabelTTF *ret = new LabelTTF(); if(ret && ret->initWithString(string, fontName, fontSize, dimensions, hAlignment, vAlignment)) { ret->autorelease(); return ret; } CC_SAFE_DELETE(ret); return nullptr; }