Class ccui.RichText

Class Summary
Constructor Attributes Constructor Name and Description
 
The rich text control of Cocos UI.

Method Summary

Class Detail

ccui.RichText()
The rich text control of Cocos UI. It receives text, image, and custom node as its children to display.

Method Detail

  • <static> {RichText} ccui.RichText.create()
    create a rich text
    Deprecated:
    since v3.0, please use new ccui.RichText() instead.
    Returns:
    {RichText}
  • ctor()
    create a rich text Constructor of ccui.RichText. override it to extend the construction behavior, remember to call "this._super()" in the extended "ctor" function.
    var uiRichText = new ccui.RichTex();
  • formatRenderers()
    Formats richText's renderer.
  • formatText()
    Formats the richText's content.
  • {cc.Size} getContentSize()
    Gets the content size of ccui.RichText
    Returns:
    {cc.Size}
  • {string} getDescription()
    Returns the class name of ccui.RichText.
    Returns:
    {string}
  • {cc.Size} getVirtualRendererSize()
    Returns the renderer container's content size.
    Returns:
    {cc.Size}
  • ignoreContentAdaptWithSize(ignore)
    Ignore the richText's custom size, If ignore is true that richText will ignore it's custom size, use renderer's content size, false otherwise.
    Parameters:
    {Boolean} ignore
  • insertElement(element, index)
    Insert a element
    Parameters:
    {ccui.RichElement} element
    {Number} index
  • pushBackElement(element)
    Push a element
    Parameters:
    {ccui.RichElement} element
  • removeElement(element)
    Remove element
    Parameters:
    {ccui.RichElement} element
  • setAnchorPoint(pt)
    Sets anchor point
    Parameters:
    {cc.Point} pt
  • setVerticalSpace(space)
    Sets vertical space
    Parameters:
    {Number} space