TextAtlas* TextAtlas::create()
{
    TextAtlas* widget = new TextAtlas();
    if (widget && widget->init())
    {
        widget->autorelease();
        return widget;
    }
    CC_SAFE_DELETE(widget);
    return nullptr;
}
Example #2
0
TextAtlas* TextAtlas::create(const std::string &stringValue,
                             const std::string &charMapFile,
                             int itemWidth,
                             int itemHeight,
                             const std::string &startCharMap)
{
    TextAtlas* widget = new TextAtlas();
    if (widget && widget->init())
    {
        widget->autorelease();
        widget->setProperty(stringValue, charMapFile, itemWidth, itemHeight, startCharMap);
        return widget;
    }
    CC_SAFE_DELETE(widget);
    return nullptr;
}