Class ccui.Slider
- Defined in: UISlider.js
- Extends ccui.Widget
Constructor Attributes | Constructor Name and Description |
---|---|
Base class for ccui.Slider
|
Method Summary
Class Detail
ccui.Slider()
Base class for ccui.Slider
Field Detail
{Number}
percent
- The current progress of loadingbar
Method Detail
-
addEventListenerSlider(selector, target)add event listener
- Parameters:
- {Function} selector
- {Object} target
-
allocates and initializes a UISlider.
// example var uiSlider = ccui.Slider.create();
- Returns:
- {ccui.Slider}
-
{cc.Rect} getCapInsetBarRenderer()Get cap insets for slider.
- Returns:
- {cc.Rect}
-
{cc.Rect} getCapInsetProgressBarRenderer()Get cap insets for slider.
- Returns:
- {cc.Rect}
-
{cc.Size} getContentSize()override "getContentSize" method of widget.
- Returns:
- {cc.Size}
-
{string} getDescription()Returns the "class name" of widget.
- Returns:
- {string}
-
{number} getPercent()Gets the progress direction of slider.
- Returns:
- {number}
-
{number} getPercentWithBallPos(px)get percent with ballPos
- Parameters:
- {cc.Point} px
- Returns:
- {number}
-
{cc.Node} getVirtualRenderer()override "getContentSize" method of widget.
- Returns:
- {cc.Node}
-
ignoreContentAdaptWithSize(ignore)override "ignoreContentAdaptWithSize" method of widget.
- Parameters:
- {Boolean} ignore
-
{Boolean} isScale9Enabled()Get slider is using scale9 renderer or not.
- Returns:
- {Boolean}
-
loadBarTexture(fileName, texType)Load texture for slider bar.
- Parameters:
- {String} fileName
- {ccui.Widget.LOCAL_TEXTURE|ccui.Widget.PLIST_TEXTURE} texType
-
loadProgressBarTexture(fileName, texType)Load dark state texture for slider progress bar.
- Parameters:
- {String} fileName
- {ccui.Widget.LOCAL_TEXTURE|ccui.Widget.PLIST_TEXTURE} texType
-
loadSlidBallTextureDisabled(disabled, texType)Load dark state texture for slider ball.
- Parameters:
- {String} disabled
- {ccui.Widget.LOCAL_TEXTURE|ccui.Widget.PLIST_TEXTURE} texType
-
loadSlidBallTextureNormal(normal, texType)Load normal state texture for slider ball.
- Parameters:
- {String} normal
- {ccui.Widget.LOCAL_TEXTURE|ccui.Widget.PLIST_TEXTURE} texType
-
loadSlidBallTexturePressed(pressed, texType)Load selected state texture for slider ball.
- Parameters:
- {String} pressed
- {ccui.Widget.LOCAL_TEXTURE|ccui.Widget.PLIST_TEXTURE} texType
-
loadSlidBallTextures(normal, pressed, disabled, texType)Load textures for slider ball.
- Parameters:
- {String} normal
- {String} pressed
- {String} disabled
- {ccui.Widget.LOCAL_TEXTURE|ccui.Widget.PLIST_TEXTURE} texType
-
setCapInsetProgressBarRenderer(capInsets)Sets capinsets for slider, if slider is using scale9 renderer.
- Parameters:
- {cc.Rect} capInsets
-
setCapInsets(capInsets)Sets capinsets for slider, if slider is using scale9 renderer.
- Parameters:
- {cc.Rect} capInsets
-
setCapInsetsBarRenderer(capInsets)Sets capinsets for slider, if slider is using scale9 renderer.
- Parameters:
- {cc.Rect} capInsets
-
setPercent(percent)Changes the progress direction of slider.
- Parameters:
- {number} percent
-
setScale9Enabled(able)Sets if slider is using scale9 renderer.
- Parameters:
- {Boolean} able