2020-08-04 12:31:33 +08:00
|
|
|
|
#ifndef __FUILABEL_H__
|
|
|
|
|
#define __FUILABEL_H__
|
|
|
|
|
|
|
|
|
|
#include "cocos2d.h"
|
|
|
|
|
#include "FairyGUIMacros.h"
|
|
|
|
|
#include "TextFormat.h"
|
|
|
|
|
|
|
|
|
|
NS_FGUI_BEGIN
|
|
|
|
|
|
2022-07-11 17:50:21 +08:00
|
|
|
|
class FUILabel : public axis::Label
|
2020-08-04 12:31:33 +08:00
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
FUILabel();
|
|
|
|
|
virtual ~FUILabel();
|
|
|
|
|
|
|
|
|
|
CREATE_FUNC(FUILabel);
|
|
|
|
|
|
2021-12-01 03:35:34 +08:00
|
|
|
|
std::string_view getText() const { return getString(); }
|
|
|
|
|
void setText(std::string_view value);
|
2020-08-04 12:31:33 +08:00
|
|
|
|
|
|
|
|
|
TextFormat* getTextFormat() const { return _textFormat; }
|
|
|
|
|
void applyTextFormat();
|
|
|
|
|
|
2022-07-11 17:50:21 +08:00
|
|
|
|
void setUnderlineColor(const axis::Color3B& value);
|
2020-09-08 19:15:28 +08:00
|
|
|
|
|
2022-07-11 17:50:21 +08:00
|
|
|
|
virtual bool setBMFontFilePath(std::string_view bmfontFilePath, const axis::Vec2& imageOffset = axis::Vec2::ZERO, float fontSize = 0) override;
|
2020-08-04 12:31:33 +08:00
|
|
|
|
|
|
|
|
|
void setGrayed(bool value);
|
|
|
|
|
protected:
|
|
|
|
|
/*
|
2022-07-11 17:50:21 +08:00
|
|
|
|
ע<EFBFBD>⣡<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˱<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD>cocos2d<EFBFBD><EFBFBD>Դ<EFBFBD>룬<EFBFBD>ļ<EFBFBD>2d/CCLabel.h<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Լ<EFBFBD><EFBFBD>672<EFBFBD>У<EFBFBD>ΪupdateBMFontScale<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>virtual<EFBFBD><EFBFBD><EFBFBD>η<EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
<EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD><EFBFBD>ΪFontFnt<EFBFBD><EFBFBD><EFBFBD>͵Ĵ<EFBFBD><EFBFBD>룬<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Dz<EFBFBD>ʹ<EFBFBD><EFBFBD>FontFnt<EFBFBD><EFBFBD>FontFntֻ֧<EFBFBD>ִ<EFBFBD><EFBFBD>ⲿ<EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ã<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>BMFontConfiguration<EFBFBD>Ƕ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>cpp<EFBFBD><EFBFBD>ġ<EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD>д<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2020-08-04 12:31:33 +08:00
|
|
|
|
*/
|
|
|
|
|
virtual void updateBMFontScale() override;
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
TextFormat* _textFormat;
|
|
|
|
|
std::string _fontName;
|
|
|
|
|
int _fontSize;
|
|
|
|
|
bool _bmFontCanTint;
|
|
|
|
|
bool _grayed;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
NS_FGUI_END
|
|
|
|
|
|
|
|
|
|
#endif
|