コード例 #1
0
TextAtlas* TextAtlas::create()
{
    TextAtlas* widget = new TextAtlas();
    if (widget && widget->init())
    {
        widget->autorelease();
        return widget;
    }
    CC_SAFE_DELETE(widget);
    return nullptr;
}
コード例 #2
0
ファイル: UITextAtlas.cpp プロジェクト: 2276225819/Game
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;
}