From 98a6558018e500350650f7dd339f03e09cdcf82e Mon Sep 17 00:00:00 2001 From: Liam Date: Mon, 21 Dec 2015 18:49:46 +0800 Subject: [PATCH] add interface for BMFont --- cocos/ui/UITextBMFont.cpp | 5 +++++ cocos/ui/UITextBMFont.h | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/cocos/ui/UITextBMFont.cpp b/cocos/ui/UITextBMFont.cpp index 0b4240857f..359b017271 100644 --- a/cocos/ui/UITextBMFont.cpp +++ b/cocos/ui/UITextBMFont.cpp @@ -195,6 +195,11 @@ ResourceData TextBMFont::getRenderFile() return rData; } +void TextBMFont::resetRender() +{ + this->removeProtectedChild(_labelBMFontRenderer); + this->initRenderer(); +} } NS_CC_END diff --git a/cocos/ui/UITextBMFont.h b/cocos/ui/UITextBMFont.h index 419b3a80e1..4ea0a164d6 100644 --- a/cocos/ui/UITextBMFont.h +++ b/cocos/ui/UITextBMFont.h @@ -98,6 +98,10 @@ public: ResourceData getRenderFile(); + /** + * reset TextBMFont inner label + */ + void resetRender(); protected: virtual void initRenderer() override; virtual void onSizeChanged() override;