My Project
Classes | Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Friends | List of all members
ParaEngine::Label Class Reference
Inheritance diagram for ParaEngine::Label:
ParaEngine::CRefCountedOne ParaEngine::CRefCounted

Classes

struct  LetterInfo
 

Public Types

enum  LabelType { TTF, BMFONT, CHARMAP, STRING_TEXTURE }
 

Public Member Functions

 Label (FontAtlas *atlas=nullptr, TextHAlignment hAlignment=TextHAlignment::LEFT, TextVAlignment vAlignment=TextVAlignment::TOP, bool useDistanceField=false, bool useA8Shader=false)
 
bool setTTFConfig (const TTFConfig &ttfConfig)
 
FontAtlasgetFontAtlas ()
 
virtual void setPosition (float x, float y)
 
void setWidth (unsigned int width)
 
unsigned int getWidth () const
 
void setHeight (unsigned int height)
 
unsigned int getHeight () const
 
void setDimensions (unsigned int width, unsigned int height)
 
const SizegetDimensions () const
 
int getStringLength () const
 
virtual void setScale (float scale)
 
virtual void setScaleX (float scaleX)
 
virtual void setScaleY (float scaleY)
 
virtual float getScaleX () const
 
virtual float getScaleY () const
 
void setContentSize (const Size &var)
 
void setAlignment (TextHAlignment hAlignment)
 
TextHAlignment getTextAlignment () const
 
void setAlignment (TextHAlignment hAlignment, TextVAlignment vAlignment)
 
void setHorizontalAlignment (TextHAlignment hAlignment)
 
TextHAlignment getHorizontalAlignment () const
 
void setVerticalAlignment (TextVAlignment vAlignment)
 
TextVAlignment getVerticalAlignment () const
 
bool computeHorizontalKernings (const std::u16string &stringToRender)
 
void computeStringNumLines ()
 
float getPositionX () const
 
float getPositionY () const
 
void setFontScale (float s)
 
bool recordPlaceholderInfo (int spriteIndex)
 
bool recordLetterInfo (const Vector2 &point, const FontLetterDefinition &letterDef, int spriteIndex)
 
- Public Member Functions inherited from ParaEngine::CRefCounted
void addref () const
 add reference count of the object. More...
 
bool delref () const
 decrease reference count of the object. More...
 
int GetRefCount () const
 get the reference count
 
virtual int Release ()
 
CRefCountedAddToAutoReleasePool ()
 addref and releases the ownership sometime soon automatically (usually at the end of the current frame). More...
 

Static Public Attributes

static const int DistanceFieldFontSize = 50
 

Protected Member Functions

void reset ()
 
void setFontAtlas (FontAtlas *atlas, bool distanceFieldEnabled=false, bool useA8Shader=false)
 

Protected Attributes

std::string _bmFontPath
 
bool _isOpacityModifyRGB
 
bool _contentDirty
 
bool _systemFontDirty
 
std::string _systemFont
 
float _systemFontSize
 
LabelType _currentLabelType
 
FontAtlas_fontAtlas
 
std::vector< LetterInfo_lettersInfo
 
TTFConfig _fontConfig
 
bool _compatibleMode
 
CCRect _reusedRect
 used for optimization
 
int _limitShowCount
 
float _additionalKerning
 
float _commonLineHeight
 
bool _lineBreakWithoutSpaces
 
int * _horizontalKernings
 
unsigned int _maxLineWidth
 
Size _labelDimensions
 
unsigned int _labelWidth
 
unsigned int _labelHeight
 
TextHAlignment _hAlignment
 
TextVAlignment _vAlignment
 
int _currNumLines
 
std::u16string _currentUTF16String
 
std::string _originalUTF8String
 
float _fontScale
 
bool _useDistanceField
 
bool _useA8Shader
 
Color4B _effectColor
 
Color4F _effectColorF
 
GLuint _uniformEffectColor
 
GLuint _uniformTextColor
 
bool _shadowDirty
 
bool _shadowEnabled
 
Size _shadowOffset
 
int _shadowBlurRadius
 
Color3B _shadowColor
 
float _shadowOpacity
 
int _outlineSize
 
Color4B _textColor
 
Color4F _textColorF
 
bool _clipEnabled
 
bool _blendFuncDirty
 
bool _insideBounds
 
Size _contentSize
 
Vector2 _position
 
float _scaleY
 
float _scaleX
 
- Protected Attributes inherited from ParaEngine::CRefCounted
int m_refcount
 

Friends

class LabelTextFormatter
 

The documentation for this class was generated from the following files: