diff --git a/cocos/2d/CCLabel.cpp b/cocos/2d/CCLabel.cpp index 4775fd2ae8..1802cf43e1 100644 --- a/cocos/2d/CCLabel.cpp +++ b/cocos/2d/CCLabel.cpp @@ -66,6 +66,12 @@ Label* Label::createWithTTF(const TTFConfig& ttfConfig, const std::string& text, } } +Label* Label::createWithTTF(const std::string& text, const std::string& fontFilePath, int fontSize, int lineSize /* = 0 */, TextHAlignment alignment /* = TextHAlignment::CENTER */, GlyphCollection glyphs /* = GlyphCollection::NEHE */, const char *customGlyphs /* = 0 */, bool useDistanceField /* = false */) +{ + TTFConfig ttfConfig(fontFilePath.c_str(),fontSize,glyphs,customGlyphs,useDistanceField); + return createWithTTF(ttfConfig,text,alignment,lineSize); +} + Label* Label::createWithBMFont(const std::string& bmfontFilePath, const std::string& text,const TextHAlignment& alignment /* = TextHAlignment::CENTER */, int lineSize /* = 0 */) { Label *ret = new Label(); diff --git a/cocos/2d/CCLabel.h b/cocos/2d/CCLabel.h index 4b8de8163e..f7b92e2021 100644 --- a/cocos/2d/CCLabel.h +++ b/cocos/2d/CCLabel.h @@ -77,6 +77,7 @@ class CC_DLL Label : public SpriteBatchNode, public LabelProtocol, public LabelT public: static Label* create(); + CC_DEPRECATED_ATTRIBUTE static Label* createWithTTF(const std::string& label, const std::string& fontFilePath, int fontSize, int lineSize = 0, TextHAlignment alignment = TextHAlignment::CENTER, GlyphCollection glyphs = GlyphCollection::NEHE, const char *customGlyphs = 0, bool useDistanceField = false); static Label* createWithTTF(const TTFConfig& ttfConfig, const std::string& text, TextHAlignment alignment = TextHAlignment::CENTER, int lineWidth = 0); static Label* createWithBMFont(const std::string& bmfontFilePath, const std::string& text,const TextHAlignment& alignment = TextHAlignment::CENTER, int lineWidth = 0); diff --git a/tools/tolua/cocos2dx.ini b/tools/tolua/cocos2dx.ini index e1b5611329..622b14aaf4 100644 --- a/tools/tolua/cocos2dx.ini +++ b/tools/tolua/cocos2dx.ini @@ -108,7 +108,6 @@ skip = Node::[setGLServerState description getUserObject .*UserData getGLServerS ccFontDefinition::[*], Object::[autorelease isEqual acceptVisitor update], UserDefault::[getInstance (s|g)etDataForKey], - Label::[getLettersInfo], EGLViewProtocol::[setTouchDelegate], EGLView::[end swapBuffers], NewTextureAtlas::[*],