Class cc.Component

Class Summary
Constructor Attributes Constructor Name and Description
 
The base class of component in CocoStudio

Method Summary

Class Detail

cc.Component()
The base class of component in CocoStudio

Method Detail

  • <static> {cc.Component} cc.Component.create()
    Allocates and initializes a component.
    Deprecated:
    since v3.0, please use new construction instead.
    Returns:
    {cc.Component}
  • ctor()
    Construction of cc.Component
  • {string} getName()
    Returns the name of cc.Component.
    Returns:
    {string}
  • {*} getOwner()
    Returns the owner of cc.Component.
    Returns:
    {*}
  • {boolean} init()
    Initializes a cc.Component.
    Returns:
    {boolean}
  • {boolean} isEnabled()
    Returns component whether is enabled.
    Returns:
    {boolean}
  • onEnter()
    The callback when a component enter stage.
  • onExit()
    The callback when a component exit stage.
  • serialize(reader)
    Serialize a component object.
    Parameters:
    reader
  • setEnabled(enable)
    Sets component whether is enabled.
    Parameters:
    enable
  • setName(name)
    Sets the name to cc.Component.
    Parameters:
    {String} name
  • setOwner(owner)
    Sets the owner to cc.Component.
    Parameters:
    owner
  • update(delta)
    The callback per every frame if it schedules update.
    Parameters:
    delta