123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169 |
- #ifndef __UILABELATLAS_H__
- #define __UILABELATLAS_H__
- #include "ui/UIWidget.h"
- #include "ui/GUIExport.h"
- NS_CC_BEGIN
- class Label;
- struct CC_DLL ResourceData;
- namespace ui {
-
- class CC_GUI_DLL TextAtlas : public Widget
- {
-
- DECLARE_CLASS_GUI_INFO
-
- public:
-
- TextAtlas();
-
-
- virtual ~TextAtlas();
-
-
- static TextAtlas* create();
-
-
- static TextAtlas* create(const std::string& stringValue,
- const std::string& charMapFile,
- int itemWidth,
- int itemHeight,
- const std::string& startCharMap);
-
-
-
- void setProperty(const std::string& stringValue,
- const std::string& charMapFile,
- int itemWidth,
- int itemHeight,
- const std::string& startCharMap);
-
-
- CC_DEPRECATED_ATTRIBUTE void setStringValue(const std::string& value){this->setString(value);}
- void setString(const std::string& value);
-
-
- CC_DEPRECATED_ATTRIBUTE const std::string& getStringValue() const{return this->getString();}
- const std::string& getString() const;
-
-
- ssize_t getStringLength()const;
-
-
- virtual Size getVirtualRendererSize() const override;
-
-
- virtual Node* getVirtualRenderer() override;
-
-
- virtual std::string getDescription() const override;
-
-
- virtual void adaptRenderers() override;
- ResourceData getRenderFile();
- protected:
- virtual void initRenderer() override;
- virtual void onSizeChanged() override;
-
- void labelAtlasScaleChangedWithSize();
- virtual Widget* createCloneInstance() override;
- virtual void copySpecialProperties(Widget* model) override;
- protected:
- Label* _labelAtlasRenderer;
- std::string _stringValue;
- std::string _charMapFileName;
- int _itemWidth;
- int _itemHeight;
- std::string _startCharMap;
- bool _labelAtlasRendererAdaptDirty;
- };
- }
- NS_CC_END
- #endif
|