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;
2022-08-08 18:02:17 +08:00
ax::Color3B getTitleColor() const;
void setTitleColor(const ax::Color3B& value);
2020-08-04 12:31:33 +08:00
int getTitleFontSize() const;
void setTitleFontSize(int value);
GTextField* getTextField() const;
2022-08-08 18:02:17 +08:00
virtual ax::Value getProp(ObjectPropID propId) override;
virtual void setProp(ObjectPropID propId, const ax::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