Class ccui.LoadingBar

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

Method Summary

Class Detail

ccui.LoadingBar()
The LoadingBar control of Cocos UI.

Field Detail

{ccui.LoadingBar.TYPE_LEFT | ccui.LoadingBar.TYPE_RIGHT} direction
- The progress direction of loadingbar
{Number} percent
- The current progress of loadingbar
<static> <constant> ccui.LoadingBar.RENDERER_ZORDER
The zOrder value of ccui.LoadingBar's renderer.
<static> <constant> ccui.LoadingBar.TYPE_LEFT
The left direction of ccui.LoadingBar.
<static> <constant> ccui.LoadingBar.TYPE_RIGHT
The right direction of ccui.LoadingBar.

Method Detail

  • <static> {ccui.LoadingBar} ccui.LoadingBar.create(textureName, percentage)
    Allocates and initializes a UILoadingBar.
    Parameters:
    {string} textureName
    {Number} percentage
    Deprecated:
    since v3.0, please use new ccui.LoadingBar() instead.
    Returns:
    {ccui.LoadingBar}
  • ctor(textureName, percentage)
    allocates and initializes a UILoadingBar.
    Constructor of ccui.LoadingBar, override it to extend the construction behavior, remember to call "this._super()" in the extended "ctor" function.
    // example
    var uiLoadingBar = new ccui.LoadingBar;
    Parameters:
    {string} textureName
    {Number} percentage
  • {cc.Rect} getCapInsets()
    Returns cap insets for loadingBar.
    Returns:
    {cc.Rect}
  • {string} getDescription()
    Returns the "class name" of widget.
    Returns:
    {string}
  • {ccui.LoadingBar.TYPE_LEFT | ccui.LoadingBar.TYPE_RIGHT} getDirection()
    Returns the progress direction of LoadingBar.
    LoadingBarTypeLeft means progress left to right, LoadingBarTypeRight otherwise.
    Returns:
    {ccui.LoadingBar.TYPE_LEFT | ccui.LoadingBar.TYPE_RIGHT}
  • {number} getPercent()
    Returns the progress direction of LoadingBar.
    Returns:
    {number} percent value from 1 to 100.
  • {cc.Node} getVirtualRenderer()
    Returns the renderer of ccui.LoadingBar
    Returns:
    {cc.Node}
  • {cc.Size|*} getVirtualRendererSize()
    Returns the texture size of renderer.
    Returns:
    {cc.Size|*}
  • ignoreContentAdaptWithSize(ignore)
    Ignore the LoadingBar's custom size, if ignore is true that LoadingBar will ignore it's custom size, use renderer's content size, false otherwise.
    Parameters:
    {Boolean} ignore
  • {Boolean} isScale9Enabled()
    Returns LoadingBar is using scale9 renderer or not..
    Returns:
    {Boolean}
  • loadTexture(texture, texType)
    Loads texture for LoadingBar.
    Parameters:
    {String} texture
    {ccui.Widget.LOCAL_TEXTURE|ccui.Widget.PLIST_TEXTURE} texType
  • setCapInsets(capInsets)
    Sets capinsets for LoadingBar, if LoadingBar is using scale9 renderer.
    Parameters:
    {cc.Rect} capInsets
  • setContentSize(contentSize, height)
    Sets the contentSize of ccui.LoadingBar
    Parameters:
    {Number|cc.Size} contentSize
    {Number} height Optional
  • setDirection(dir)
    Changes the progress direction of LoadingBar.
    LoadingBarTypeLeft means progress left to right, LoadingBarTypeRight otherwise.
    Parameters:
    {ccui.LoadingBar.TYPE_LEFT | ccui.LoadingBar.TYPE_RIGHT} dir
  • setPercent(percent)
    The current progress of loadingBar
    Parameters:
    {number} percent
    percent value from 1 to 100.
  • setScale9Enabled(enabled)
    Sets if LoadingBar is using scale9 renderer.
    Parameters:
    {Boolean} enabled