This commit is contained in:
carlo morgantini 2013-08-05 18:03:52 -07:00
parent c7c0b0e07a
commit 66c5721fc7
2 changed files with 7 additions and 1 deletions

View File

@ -28,12 +28,17 @@
NS_CC_BEGIN
const int FontDefinitionTTF::_DEFAUL_ATALS_TEXTURE_SIZE = 1024;
FontDefinitionTTF::FontDefinitionTTF():_textImages(0), _commonLineHeight(0)
{
}
FontDefinitionTTF* FontDefinitionTTF::create(Font *font, int textureSize)
{
if (textureSize == 0)
textureSize = _DEFAUL_ATALS_TEXTURE_SIZE;
FontDefinitionTTF *ret = new FontDefinitionTTF;
if(!ret)

View File

@ -39,7 +39,7 @@ class CC_DLL FontDefinitionTTF : public Object
{
public:
static FontDefinitionTTF* create(Font *font, int textureSize = DEFAULT_ATLAS_TEXTURE_SIZE);
static FontDefinitionTTF* create(Font *font, int textureSize = 0);
FontAtlas * createFontAtlas();
private:
@ -54,6 +54,7 @@ private:
TextImage * _textImages;
std::map<unsigned short, FontLetterDefinition> _fontLettersDefinitionUTF16;
float _commonLineHeight;
static const int _DEFAUL_ATALS_TEXTURE_SIZE;
};