mirror of https://github.com/axmolengine/axmol.git
fix Text reader font name
This commit is contained in:
parent
60a791ac12
commit
fb3e499d9d
|
@ -49,6 +49,8 @@ namespace cocostudio
|
|||
|
||||
Text* label = static_cast<Text*>(widget);
|
||||
|
||||
std::string jsonPath = GUIReader::getInstance()->getFilePath();
|
||||
|
||||
|
||||
for (int i = 0; i < cocoNode->GetChildNum(); ++i) {
|
||||
std::string key = stChildArray[i].GetName(cocoLoader);
|
||||
|
@ -67,7 +69,8 @@ namespace cocostudio
|
|||
}else if(key == P_FontSize){
|
||||
label->setFontSize(valueToInt(value));
|
||||
}else if(key == P_FontName){
|
||||
label->setFontName(value);
|
||||
std::string fontFilePath = jsonPath.append(value);
|
||||
label->setFontName(fontFilePath);
|
||||
}else if(key == P_AreaWidth){
|
||||
label->setTextAreaSize(Size(valueToFloat(value), label->getTextAreaSize().height));
|
||||
}else if(key == P_AreaHeight){
|
||||
|
|
Loading…
Reference in New Issue