CCLabelAtlas* CCLabelAtlas::create(const char *string, const char *charMapFile, unsigned int itemWidth, int unsigned itemHeight, unsigned int startCharMap)
{
    CCLabelAtlas *pRet = new CCLabelAtlas();
    if(pRet && pRet->initWithString(string, charMapFile, itemWidth, itemHeight, startCharMap))
    {
        pRet->autorelease();
        return pRet;
    }
    CC_SAFE_DELETE(pRet);
    return NULL;
}
Exemple #2
0
//CCLabelAtlas - Creation & Init
CCLabelAtlas * CCLabelAtlas::labelWithString(const char *label, StreamSource* charMapSource, unsigned int itemWidth, int unsigned itemHeight, unsigned char startCharMap)
{
	CCLabelAtlas *pRet = new CCLabelAtlas();
	if(pRet && pRet->initWithString(label, charMapSource, itemWidth, itemHeight, startCharMap))
	{
		pRet->autorelease();
		return pRet;
	}
	CC_SAFE_DELETE(pRet)
	return NULL;
}
Exemple #3
0
	bool CCMenuItemAtlasFont::initFromString(const char *value, const char *charMapFile, int itemWidth, int itemHeight, char startCharMap, SelectorProtocol* target, SEL_MenuHandler selector)
	{
		NSAssert( value != NULL && strlen(value) != 0, "value length must be greater than 0");
		CCLabelAtlas *label = new CCLabelAtlas();
		label->initWithString(value, charMapFile, itemWidth, itemHeight, startCharMap);
		label->autorelease();
		if (CCMenuItemLabel::initWithLabel(label, target, selector))
		{
			// do something ?
		}
		return true;
	}
NS_CC_BEGIN

//CCLabelAtlas - Creation & Init
CCLabelAtlas * CCLabelAtlas::labelWithString(const char *label, const char *charMapFile, unsigned int itemWidth, int unsigned itemHeight, unsigned char startCharMap)
{
    CCLabelAtlas *pRet = new CCLabelAtlas();
    if(pRet && pRet->initWithString(label, charMapFile, itemWidth, itemHeight, startCharMap))
    {
        pRet->autorelease();
        return pRet;
    }
    CC_SAFE_DELETE(pRet);
    return NULL;
}
CCLabelAtlas* CCLabelAtlas::create(const char *string, const char *fntFile)
{    
    CCLabelAtlas *ret = new CCLabelAtlas();
    if (ret)
    {
        if (ret->initWithString(string, fntFile))
        {
            ret->autorelease();
        }
        else 
        {
            CC_SAFE_RELEASE_NULL(ret);
        }
    }
    
    return ret;
}
NS_CC_BEGIN

//CCLabelAtlas - Creation & Init

CCLabelAtlas * CCLabelAtlas::create(const char *string, const char *charMapFile, unsigned int itemWidth, unsigned int itemHeight, unsigned int startCharMap, float space)
{
    CCLabelAtlas *pRet = new CCLabelAtlas();
    if(pRet)
    {
        pRet->m_space = space;
        pRet->initWithString(string, charMapFile, itemWidth, itemHeight, startCharMap);
        pRet->autorelease();
        return pRet;
    }
    CC_SAFE_DELETE(pRet);
    return NULL;
}