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
|
|
|
|
|
|
|
|
|
|
class FUILabel : public cocos2d::Label
|
|
|
|
|
{
|
|
|
|
|
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();
|
|
|
|
|
|
2020-09-08 19:15:28 +08:00
|
|
|
|
void setUnderlineColor(const cocos2d::Color3B& value);
|
|
|
|
|
|
2021-12-31 12:12:40 +08:00
|
|
|
|
virtual bool setBMFontFilePath(std::string_view bmfontFilePath, const cocos2d::Vec2& imageOffset = cocos2d::Vec2::ZERO, float fontSize = 0) override;
|
2020-08-04 12:31:33 +08:00
|
|
|
|
|
|
|
|
|
void setGrayed(bool value);
|
|
|
|
|
protected:
|
|
|
|
|
/*
|
|
|
|
|
ע<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><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>ָ<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><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><EFBFBD><EFBFBD>
|
|
|
|
|
*/
|
|
|
|
|
virtual void updateBMFontScale() override;
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
TextFormat* _textFormat;
|
|
|
|
|
std::string _fontName;
|
|
|
|
|
int _fontSize;
|
|
|
|
|
bool _bmFontCanTint;
|
|
|
|
|
bool _grayed;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
NS_FGUI_END
|
|
|
|
|
|
|
|
|
|
#endif
|