axmol/extensions/fairygui/GLabel.h

52 lines
1.2 KiB
C
Raw Normal View History

2020-08-04 12:31:33 +08:00
#ifndef __GLABEL_H__
#define __GLABEL_H__
#include "cocos2d.h"
#include "FairyGUIMacros.h"
#include "GComponent.h"
NS_FGUI_BEGIN
class GTextField;
class GLabel : public GComponent
{
public:
GLabel();
virtual ~GLabel();
CREATE_FUNC(GLabel);
const std::string& getTitle() { return getText(); }
void setTitle(const std::string& value) { setText(value); };
virtual const std::string& getText() const override;
virtual void setText(const std::string& value) override;
virtual const std::string& getIcon() const override;
virtual void setIcon(const std::string& value) override;
axis::Color3B getTitleColor() const;
void setTitleColor(const axis::Color3B& value);
2020-08-04 12:31:33 +08:00
int getTitleFontSize() const;
void setTitleFontSize(int value);
GTextField* getTextField() const;
virtual axis::Value getProp(ObjectPropID propId) override;
virtual void setProp(ObjectPropID propId, const axis::Value& value) override;
2020-08-04 12:31:33 +08:00
protected:
virtual void constructExtension(ByteBuffer* buffer) override;
virtual void setup_afterAdd(ByteBuffer* buffer, int beginPos) override;
private:
GObject* _titleObject;
GObject* _iconObject;
};
NS_FGUI_END
#endif