当前位置:网站首页>Cocos progress bar progresstimer
Cocos progress bar progresstimer
2022-07-05 04:56:00 【Meteor spot】
Progress bar ProgressTimer,c++
Round progress bar
Sprite *bgSprite = Sprite::create("red.png");
addChild(bgSprite, 1, 1);
Sprite *hpSprite = Sprite::create("green.png");
progressTimer = ProgressTimer::create(hpSprite);
progressTimer->setType(ProgressTimer::Type::RADIAL);
progressTimer->setReverseProgress(true);
progressTimer->setPercentage(30);// Full value 100%
addChild(progressTimer, 0, 0);
Bar progress bar
Sprite *bgSprite = Sprite::create("box.png");
addChild(bgSprite, 1, 1);
Sprite *hpSprite = Sprite::create("hp.png");
progressTimer = ProgressTimer::create(hpSprite);
progressTimer->setType(ProgressTimer::Type::BAR);
///
// From left to right
progressTimer->setMidpoint(ccp(0, 0.5));
progressTimer->setBarChangeRate(ccp(1, 0));
// From right to left
// progressTimer->setMidpoint(ccp(1, 0.5));
// progressTimer->setBarChangeRate(ccp(1, 0));
// From top to bottom
// progressTimer->setMidpoint(ccp(0.5, 1));
// progressTimer->setBarChangeRate(ccp(0, 1));
// From bottom to top
// progressTimer->setMidpoint(ccp(0.5, 0));
// progressTimer->setBarChangeRate(ccp(0, 1));
///
progressTimer->setMidpoint(Point(0, 0.5));
progressTimer->setBarChangeRate(Point(1, 0));
progressTimer->setPercentage(30);// Full value 100%
addChild(progressTimer, 0, 0);
Progress bar ProgressTimer,Lua
Round progress bar :
self.ProgressFg = cc.ProgressTimer:create(cc.Sprite:create(""))
self.ProgressFg:setType(cc.PROGRESS_TIMER_TYPE_RADIAL) -- Set to bar type:cc.PROGRESS_TIMER_TYPE_RADIAL
self.ProgressFg:setReverseProgress(false) -- Set up
Anti-clockwise , clockwise
self.ProgressFg:setPercentage(0) -- Set the initial progress to 30
Strip shape
local vipProgressFg = cc.ProgressTimer:create(cc.Sprite:create(""))
vipProgressFg:setType(cc.PROGRESS_TIMER_TYPE_BAR) -- Set to bar type:cc.PROGRESS_TIMER_TYPE_RADIAL
vipProgressFg:setMidpoint(cc.p(0,0)) -- Set the starting point below the bar seat
vipProgressFg:setBarChangeRate(cc.p(1,0)) -- Set to vertical
vipProgressFg:setPercentage(0) -- Set the initial progress to 30
边栏推荐
- Inline built-in function
- 3dsmax2018 common operations and some shortcut keys of editable polygons
- Introduction to JVM principle and process
- AutoCAD - workspace settings
- China as resin Market Research and investment forecast report (2022 Edition)
- 计组笔记(1)——校验码、原补码乘除计算、浮点数计算
- 次小生成树
- Redis has four methods for checking big keys, which are necessary for optimization
- SQLServer 存储过程传递数组参数
- UE4/UE5 虚幻引擎,材质篇(三),不同距离的材质优化
猜你喜欢

2021 Higher Education Club Cup mathematical modeling national tournament ABCD problem - problem solving ideas

2022 thinking of Mathematical Modeling B problem of American college students / analysis of 2022 American competition B problem
![Rip notes [rip three timers, the role of horizontal segmentation, rip automatic summary, and the role of network]](/img/e7/f699ee982ea325b8d04f8bd467a559.jpg)
Rip notes [rip three timers, the role of horizontal segmentation, rip automatic summary, and the role of network]

AutoCAD - set layer

On-off and on-off of quality system construction

Solution of circular dependency

49 pictures and 26 questions explain in detail what is WiFi?

2021 higher education social cup mathematical modeling national tournament ABCD questions - problem solving ideas - Mathematical Modeling

Thinking of 2022 American College Students' mathematical modeling competition

PostgreSQL surpasses mysql, and the salary of "the best programming language in the world" is low
随机推荐
Out and ref functions of unity
2022 thinking of Mathematical Modeling B problem of American college students / analysis of 2022 American competition B problem
Unity synergy
JMeter -- distributed pressure measurement
Flink cluster configuration
2022 American College Students' mathematical modeling ABCDEF problem thinking /2022 American match ABCDEF problem analysis
Panel panel of UI
Pdf to DWG in CAD
MySQL audit log archiving
SQLServer 存储过程传递数组参数
Introduce Hamming distance and calculation examples
PostgreSQL 超越 MySQL,“世界上最好的编程语言”薪水偏低
#775 Div.1 B. Integral Array 数学
AutoCAD - graphic input and output
Unity get component
Function overloading
Detailed introduction of OSPF header message
Basic knowledge points of dictionary
中国针状焦行业发展研究与投资价值报告(2022版)
C4D simple cloth (version above R21)