Axmol Engine 2.4.0-258ceca
Loading...
Searching...
No Matches
RichElementText Class Reference

Rich element for displaying text. More...

#include <UIRichText.h>

Inherits RichElement.

Public Types

enum  {
  ITALICS_FLAG = 1 << 0 , BOLD_FLAG = 1 << 1 , UNDERLINE_FLAG = 1 << 2 , STRIKETHROUGH_FLAG = 1 << 3 ,
  URL_FLAG = 1 << 4 , OUTLINE_FLAG = 1 << 5 , SHADOW_FLAG = 1 << 6 , GLOW_FLAG = 1 << 7
}
 
- Public Types inherited from RichElement
enum class  Type { TEXT , IMAGE , CUSTOM , NEWLINE }
 Rich element type. More...
 

Public Member Functions

 RichElementText ()
 Default constructor.
 
bool init (int tag, const Color3B &color, uint8_t opacity, std::string_view text, std::string_view fontName, float fontSize, uint32_t flags, std::string_view url, const Color3B &outlineColor=Color3B::WHITE, int outlineSize=-1, const Color3B &shadowColor=Color3B::BLACK, const Vec2 &shadowOffset=Vec2(2.0, -2.0), int shadowBlurRadius=0, const Color3B &glowColor=Color3B::WHITE, std::string_view id=""sv)
 Initialize a RichElementText with various arguments.
 
- Public Member Functions inherited from RichElement
bool init (int tag, const Color3B &color, uint8_t opacity)
 Initialize a rich element with different arguments.
 
- Public Member Functions inherited from Object
void retain ()
 Retains the ownership.
 
void release ()
 Releases the ownership immediately.
 
Objectautorelease ()
 Releases the ownership sometime soon automatically.
 
unsigned int getReferenceCount () const
 Returns the Object's current reference count.
 
virtual ~Object ()
 Destructor.
 

Static Public Member Functions

static RichElementTextcreate (int tag, const Color3B &color, uint8_t opacity, std::string_view text, std::string_view fontName, float fontSize, uint32_t flags=0, std::string_view url="", const Color3B &outlineColor=Color3B::WHITE, int outlineSize=-1, const Color3B &shadowColor=Color3B::BLACK, const Vec2 &shadowOffset=Vec2(2.0, -2.0), int shadowBlurRadius=0, const Color3B &glowColor=Color3B::WHITE, std::string_view id=""sv)
 Create a RichElementText with various arguments.
 

Additional Inherited Members

- Public Attributes inherited from Object
unsigned int _ID
 object id, ScriptSupport need public _ID
 
int _luaID
 Lua reference id.
 

Detailed Description

Rich element for displaying text.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
ITALICS_FLAG 

italic text

BOLD_FLAG 

bold text

UNDERLINE_FLAG 

underline

STRIKETHROUGH_FLAG 

strikethrough

URL_FLAG 

url of anchor

OUTLINE_FLAG 

outline effect

SHADOW_FLAG 

shadow effect

GLOW_FLAG 

glow effect

Constructor & Destructor Documentation

◆ RichElementText()

RichElementText ( )
inline

Default constructor.

@js ctor @lua new

Member Function Documentation

◆ init()

bool init ( int tag,
const Color3B & color,
uint8_t opacity,
std::string_view text,
std::string_view fontName,
float fontSize,
uint32_t flags,
std::string_view url,
const Color3B & outlineColor = Color3B::WHITE,
int outlineSize = -1,
const Color3B & shadowColor = Color3B::BLACK,
const Vec2 & shadowOffset = Vec2(2.0, -2.0),
int shadowBlurRadius = 0,
const Color3B & glowColor = Color3B::WHITE,
std::string_view id = ""sv )

Initialize a RichElementText with various arguments.

Parameters
tagA integer tag value.
colorA color in Color3B.
opacityA opacity in GLubyte.
textContent string.
fontNameContent font name.
fontSizeContent font size.
flagsitalics, bold, underline, strikethrough, url, outline, shadow or glow
urluniform resource locator
outlineColorthe color of the outline
outlineSizethe outline effect size value
shadowColorthe shadow effect color value
shadowOffsetshadow effect offset value
shadowBlurRadiusthe shadow effect blur radius
glowColorglow color
idID of element
Returns
True if initialize success, false otherwise.

◆ create()

static RichElementText * create ( int tag,
const Color3B & color,
uint8_t opacity,
std::string_view text,
std::string_view fontName,
float fontSize,
uint32_t flags = 0,
std::string_view url = "",
const Color3B & outlineColor = Color3B::WHITE,
int outlineSize = -1,
const Color3B & shadowColor = Color3B::BLACK,
const Vec2 & shadowOffset = Vec2(2.0, -2.0),
int shadowBlurRadius = 0,
const Color3B & glowColor = Color3B::WHITE,
std::string_view id = ""sv )
static

Create a RichElementText with various arguments.

Parameters
tagA integer tag value.
colorA color in Color3B.
opacityA opacity in GLubyte.
textContent string.
fontNameContent font name.
fontSizeContent font size.
flagsitalics, bold, underline, strikethrough, url, outline, shadow or glow
urluniform resource locator
outlineColorthe color of the outline
outlineSizethe outline effect size value
shadowColorthe shadow effect color value
shadowOffsetshadow effect offset value
shadowBlurRadiusthe shadow effect blur radius
glowColorglow color
idID of element
Returns
RichElementText instance.

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