mirror of https://github.com/axmolengine/axmol.git
label:fixed getter for font size and font name.
This commit is contained in:
parent
971b1dd557
commit
5f6fbc6a33
|
@ -35,7 +35,7 @@ NS_CC_BEGIN
|
|||
|
||||
const int FontAtlas::CacheTextureWidth = 1024;
|
||||
const int FontAtlas::CacheTextureHeight = 1024;
|
||||
const char* FontAtlas::EVENT_PURGE_TEXTURES = "FontAtlasPurgeTextures";
|
||||
const char* FontAtlas::EVENT_PURGE_TEXTURES = "__cc_FontAtlasPurgeTextures";
|
||||
|
||||
FontAtlas::FontAtlas(Font &theFont)
|
||||
: _font(&theFont)
|
||||
|
|
|
@ -1036,13 +1036,7 @@ void Label::setFontName(const std::string& fontName)
|
|||
|
||||
const std::string& Label::getFontName() const
|
||||
{
|
||||
switch (_currentLabelType)
|
||||
{
|
||||
case LabelType::TTF:
|
||||
return _fontConfig.fontFilePath;
|
||||
default:
|
||||
return _fontDefinition._fontName;
|
||||
}
|
||||
return _fontName;
|
||||
}
|
||||
|
||||
void Label::setFontSize(int fontSize)
|
||||
|
@ -1056,15 +1050,7 @@ void Label::setFontSize(int fontSize)
|
|||
|
||||
int Label::getFontSize() const
|
||||
{
|
||||
switch (_currentLabelType)
|
||||
{
|
||||
case LabelType::TTF:
|
||||
return _fontConfig.fontSize;
|
||||
case LabelType::STRING_TEXTURE:
|
||||
return _fontDefinition._fontSize;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
return _fontSize;
|
||||
}
|
||||
|
||||
///// PROTOCOL STUFF
|
||||
|
|
Loading…
Reference in New Issue