Cocos2d-x  v4
RichElement Class Reference

Rich text element base class. More...

Inherits Ref.

Inherited by RichElementCustomNode, RichElementImage, RichElementNewLine, and RichElementText.

Public Types

enum  Type { TEXT, IMAGE, CUSTOM, NEWLINE }
 Rich element type. More...
 

Public Member Functions

 RichElement ()
 Default constructor. More...
 
virtual ~RichElement ()
 Default destructor. More...
 
bool init (int tag, const Color3B &color, uint8_t opacity)
 Initialize a rich element with different arguments. More...
 
- Public Member Functions inherited from Ref
void retain ()
 Retains the ownership. More...
 
void release ()
 Releases the ownership immediately. More...
 
Refautorelease ()
 Releases the ownership sometime soon automatically. More...
 
unsigned int getReferenceCount () const
 Returns the Ref's current reference count. More...
 
virtual ~Ref ()
 Destructor. More...
 

Additional Inherited Members

- Public Attributes inherited from Ref
unsigned int _ID
 object id, ScriptSupport need public _ID
 
int _luaID
 Lua reference id.
 
void * _scriptObject
 scriptObject, support for swift
 
bool _rooted
 When true, it means that the object was already rooted.
 

Detailed Description

Rich text element base class.

It defines the basic common properties for all rich text element.

Member Enumeration Documentation

◆ Type

enum Type
strong

Rich element type.

Enumerator
TEXT 

RichElementText.

IMAGE 

RichElementImage.

CUSTOM 

RichElementCustomNode.

NEWLINE 

RichElementNewLine.

Constructor & Destructor Documentation

◆ RichElement()

RichElement ( )
inline

Default constructor.

@js ctor @lua new

◆ ~RichElement()

virtual ~RichElement ( )
inlinevirtual

Default destructor.

@js NA @lua NA

Member Function Documentation

◆ init()

bool init ( int  tag,
const Color3B color,
uint8_t  opacity 
)

Initialize a rich element with different arguments.

Parameters
tagA integer tag value.
colorA color in
See also
Color3B.
Parameters
opacityA opacity value in GLubyte.
Returns
True if initialize success, false otherwise.

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