CCProgressTimer is a subclass of CCNode. It renders the inner sprite according to the percentage. The progress can be Radial, Horizontal or vertical.
Class CCProgressTimer
#include <Geode/cocos/misc_nodes/CCProgressTimer.h>
Examples0
Public static methods1
staticcocos2d::CCProgressTimer*create()
Creates a progress timer with the sprite as the shape the timer goes through
Public member functions20
cocos2d::CCProgressTimerTypegetType()
Change the percentage to change progress.
floatgetPercentage()
Percentages are from 0 to 100
cocos2d::CCSprite*getSprite()
The image to show the progress percentage, retain
boolinitWithSprite()
Initializes a progress timer with the sprite as the shape the timer goes through
voidsetSprite(cocos2d::CCSprite*pSprite)
voidsetType()
virtualvoiddraw()
voidsetAnchorPoint(cocos2d::CCPointanchorPoint)
virtualvoidsetColor()
virtualcocos2d::ccColor3Bconst&getColor()const
virtual_::GLubytegetOpacity()const
virtualvoidsetOpacity(_::GLubyteopacity)
boolisReverseDirection()
virtualcocos2d::CCPointgetMidpoint()
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 ccp(0,y) you want a right to left then set the midpoint all the way to ccp(1,y) you want a bottom to top then set the midpoint all the way to ccp(x,0) you want a top to bottom then set the midpoint all the way to ccp(x,1)
virtualvoidsetMidpoint()
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 ccp(0,y) you want a right to left then set the midpoint all the way to ccp(1,y) you want a bottom to top then set the midpoint all the way to ccp(x,0) you want a top to bottom then set the midpoint all the way to ccp(x,1)
virtualcocos2d::CCPointgetBarChangeRate()const
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 ccp(0,1); and set the midpoint to = ccp(0,.5f);
virtualvoidsetBarChangeRate()
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 ccp(0,1); and set the midpoint to = ccp(0,.5f);
Fields1
boolm_bReverseDirection;
Protected member functions7
cocos2d::ccTex2FtextureCoordFromAlphaPoint(cocos2d::CCPointalpha)
cocos2d::ccVertex2FvertexFromAlphaPoint(cocos2d::CCPointalpha)
voidupdateProgress()
voidupdateBar()
voidupdateRadial()
voidupdateColor()
cocos2d::CCPointboundaryTexCoord(charindex)
Protected fields7
cocos2d::CCProgressTimerTypem_eType;
floatm_fPercentage;
cocos2d::CCSprite*m_pSprite;
intm_nVertexDataCount;
cocos2d::ccV2F_C4B_T2F*m_pVertexData;
cocos2d::CCPointm_tMidpoint;
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 ccp(0,y) you want a right to left then set the midpoint all the way to ccp(1,y) you want a bottom to top then set the midpoint all the way to ccp(x,0) you want a top to bottom then set the midpoint all the way to ccp(x,1)
cocos2d::CCPointm_tBarChangeRate;
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 ccp(0,1); and set the midpoint to = ccp(0,.5f);