Class cc.ProgressTimer
Extends
cc.Node.
Defined in: CCProgressTimer.js.
Constructor Attributes | Constructor Name and Description |
---|---|
cc.Progresstimer is a subclass of cc.Node.
|
Method Attributes | Method Name and Description |
---|---|
<static> |
cc.ProgressTimer.create(sprite)
create a progress timer object with image file name that renders the inner sprite according to the percentage
|
ctor()
|
|
draw(ctx)
stuff gets drawn here
|
|
This allows the bar type to move the component at a specific rate
Set the component to 0 to make sure it stays at 100%.
|
|
getColor()
return color of sprite
|
|
Midpoint is used to modify the progress start position.
|
|
return Opacity of sprite
|
|
Percentages are from 0 to 100
|
|
The image to show the progress percentage, retain
|
|
getType()
Change the percentage to change progress
|
|
initWithSprite(sprite)
Initializes a progress timer with the sprite as the shape the timer goes through
|
|
setBarChangeRate(barChangeRate)
|
|
setColor(color)
set color of sprite
|
|
setMidpoint(mpoint)
Midpoint setter
|
|
setOpacity(opacity)
Opacity
|
|
setOpacityModifyRGB(bValue)
|
|
setPercentage(percentage)
from 0-100
|
|
setReverseDirection(reverse)
Reverse Progress setter
|
|
setSprite(sprite)
|
|
setType(type)
set Progress type of cc.ProgressTimer
|
- Methods borrowed from class cc.Node:
- addChild, cleanup, convertToNodeSpace, convertToNodeSpaceAR, convertTouchToNodeSpace, convertTouchToNodeSpaceAR, convertToWorldSpace, convertToWorldSpaceAR, description, getActionByTag, getActionManager, getAnchorPoint, getAnchorPointInPoints, getBoundingBox, getBoundingBoxToWorld, getCamera, getChildByTag, getChildren, getChildrenCount, getContentSize, getGLServerState, getGrid, getOrderOfArrival, getParent, getPosition, getPositionX, getPositionY, getRotation, getScale, getScaleX, getScaleY, getScheduler, getShaderProgram, getSkewX, getSkewY, getTag, getUserData, getUserObject, getVertexZ, getZOrder, ignoreAnchorPointForPosition, init, isIgnoreAnchorPointForPosition, isRunning, isVisible, nodeToParentTransform, nodeToWorldTransform, numberOfRunningActions, onEnter, onEnterTransitionDidFinish, onExit, onExitTransitionDidStart, parentToNodeTransform, pauseSchedulerAndActions, release, removeAllChildren, removeAllChildrenWithCleanup, removeChild, removeChildByTag, removeFromParent, removeFromParentAndCleanup, reorderChild, resumeSchedulerAndActions, retain, runAction, schedule, scheduleOnce, scheduleUpdate, scheduleUpdateWithPriority, setActionManager, setAnchorPoint, setContentSize, setGLServerState, setGrid, setNodeDirty, setOrderOfArrival, setParent, setPosition, setPositionX, setPositionY, setRotation, setScale, setScaleX, setScaleY, setScheduler, setShaderProgram, setSkewX, setSkewY, setTag, setUserData, setUserObject, setVertexZ, setVisible, setZOrder, sortAllChildren, stopAction, stopActionByTag, stopAllActions, transform, transformAncestors, unschedule, unscheduleAllCallbacks, unscheduleUpdate, update, updateTransform, visit, worldToNodeTransform
Class Detail
cc.ProgressTimer()
cc.Progresstimer is a subclass of cc.Node.
It renders the inner sprite according to the percentage.
The progress can be Radial, Horizontal or vertical.
It renders the inner sprite according to the percentage.
The progress can be Radial, Horizontal or vertical.
Method Detail
<static>
{cc.ProgressTimer}
cc.ProgressTimer.create(sprite)
create a progress timer object with image file name that renders the inner sprite according to the percentage
// Example var progress = cc.ProgressTimer.create('progress.png')
- Parameters:
- {cc.Sprite} sprite
- Returns:
- {cc.ProgressTimer}
ctor()
draw(ctx)
stuff gets drawn here
- Parameters:
- {CanvasContext} ctx
{cc.Point}
getBarChangeRate()
This allows the bar type to move the component at a specific rate
Set the component to 0 to make sure it stays at 100%.
For example you want a left to right bar but not have the height stay 100%
Set the rate to be cc.p(0,1); and set the midpoint to = cc.p(0,.5f);
- Returns:
- {cc.Point}
{cc.Color3B}
getColor()
return color of sprite
- Returns:
- {cc.Color3B}
{cc.Point}
getMidpoint()
Midpoint is used to modify the progress start position.
If you're using radials type then the midpoint changes the center point
If you're using bar type the the midpoint changes the bar growth
it expands from the center but clamps to the sprites edge so:
you want a left to right then set the midpoint all the way to cc.p(0,y)
you want a right to left then set the midpoint all the way to cc.p(1,y)
you want a bottom to top then set the midpoint all the way to cc.p(x,0)
you want a top to bottom then set the midpoint all the way to cc.p(x,1)
- Returns:
- {cc.Point}
{Number}
getOpacity()
return Opacity of sprite
- Returns:
- {Number}
{Number}
getPercentage()
Percentages are from 0 to 100
- Returns:
- {Number}
{cc.Sprite}
getSprite()
The image to show the progress percentage, retain
- Returns:
- {cc.Sprite}
Change the percentage to change progress
{Boolean}
initWithSprite(sprite)
Initializes a progress timer with the sprite as the shape the timer goes through
- Parameters:
- {cc.Sprite} sprite
- Returns:
- {Boolean}
isOpacityModifyRGB()
isReverseDirection()
setBarChangeRate(barChangeRate)
- Parameters:
- {cc.Point} barChangeRate
setColor(color)
set color of sprite
- Parameters:
- {cc.Color3B} color
setMidpoint(mpoint)
Midpoint setter
- Parameters:
- {cc.Point} mpoint
setOpacity(opacity)
Opacity
- Parameters:
- {Number} opacity
setOpacityModifyRGB(bValue)
- Parameters:
- bValue
setPercentage(percentage)
from 0-100
- Parameters:
- {Number} percentage
setReverseDirection(reverse)
Reverse Progress setter
- Parameters:
- {Boolean} reverse
setSprite(sprite)
- Parameters:
- {cc.Sprite} sprite
setType(type)
set Progress type of cc.ProgressTimer
- Parameters:
- {cc.PROGRESS_TIMER_TYPE_RADIAL|cc.PROGRESS_TIMER_TYPE_BAR} type