axmol/extensions/fairygui/display/TextFormat.h

51 lines
1.1 KiB
C
Raw Normal View History

2020-08-04 12:31:33 +08:00
#ifndef __TEXTFORMAT_H__
#define __TEXTFORMAT_H__
#include "cocos2d.h"
#include "FairyGUIMacros.h"
NS_FGUI_BEGIN
class TextFormat
{
public:
TextFormat();
TextFormat(const TextFormat & other);
TextFormat &operator =(const TextFormat & other);
void setFormat(const TextFormat& format);
void enableEffect(int effectFlag) { effect |= effectFlag; }
void disableEffect(int effectFlag) { effect &= ~effectFlag; }
bool hasEffect(int effectFlag) const { return (effect & effectFlag) != 0; }
static const int OUTLINE = 1;
static const int SHADOW = 2;
static const int GLOW = 4;
std::string face;
float fontSize;
2022-08-08 18:02:17 +08:00
ax::Color3B color;
2020-08-04 12:31:33 +08:00
bool bold;
bool italics;
bool underline;
int lineSpacing;
int letterSpacing;
2022-08-08 18:02:17 +08:00
ax::TextHAlignment align;
ax::TextVAlignment verticalAlign;
2020-08-04 12:31:33 +08:00
int effect;
2022-08-08 18:02:17 +08:00
ax::Color3B outlineColor;
2020-08-04 12:31:33 +08:00
int outlineSize;
2022-08-08 18:02:17 +08:00
ax::Color3B shadowColor;
ax::Size shadowOffset;
2020-08-04 12:31:33 +08:00
int shadowBlurRadius;
2022-08-08 18:02:17 +08:00
ax::Color3B glowColor;
2020-08-04 12:31:33 +08:00
//internal use
bool _hasColor;
};
NS_FGUI_END
#endif