コード例 #1
0
	CCAtlasNode * CCAtlasNode::atlasWithTileFile(const char *tile, unsigned int tileWidth, unsigned int tileHeight, 
		unsigned int itemsToRender)
	{
		CCAtlasNode * pRet = new CCAtlasNode();
		if (pRet->initWithTileFile(tile, tileWidth, tileHeight, itemsToRender))
		{
			pRet->autorelease();
			return pRet;
		}
		CC_SAFE_DELETE(pRet);
		return NULL;
	}
コード例 #2
0
CCAtlasNode* CCAtlasNode::create ( const KDchar* szFilePath, KDuint uTileWidth, KDuint uTileHeight, KDuint uItemsToRender )
{
	CCAtlasNode*  pRet = new CCAtlasNode ( );

	if ( pRet && pRet->initWithTileFile ( szFilePath, uTileWidth, uTileHeight, uItemsToRender ) )
	{
		pRet->autorelease ( );
	}
	else
	{
		CC_SAFE_DELETE ( pRet );
	}

	return pRet;
}