当前位置:网站首页>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
边栏推荐
- Leetcode word search (backtracking method)
- 669. Prune binary search tree ●●
- 2020-10-27
- C4D simple cloth (version above R21)
- Difference between singleton and factory pattern
- Chinese notes of unit particle system particle effect
- 【acwing】528. cheese
- 3dsmax scanning function point connection drawing connection line
- AutoCAD - Center zoom
- 【Leetcode】1352. 最后 K 个数的乘积
猜你喜欢
Minor spanning tree
Looking at Chinese science and technology from the Winter Olympics: what is the mystery of the high-speed camera that the whole people thank?
Number theoretic function and its summation to be updated
Flutter 小技巧之 ListView 和 PageView 的各种花式嵌套
Chinese notes of unit particle system particle effect
Thematic information | carbon, carbon neutrality, low carbon, carbon emissions - 22.1.9
Establish cloth effect in 10 seconds
[groovy] closure (closure parameter list rule | default parameter list | do not receive parameters | receive custom parameters)
"Measuring curve length" of CAD dream drawing
【Leetcode】1352. Product of the last K numbers
随机推荐
Flutter tips: various fancy nesting of listview and pageview
Research and forecast report on China's solution polymerized styrene butadiene rubber (SSBR) industry (2022 Edition)
Unity sends messages and blocks indecent words
[groovy] closure closure (customize closure parameters | customize a single closure parameter | customize multiple closure parameters | specify the default value of closure parameters)
Redis 排查大 key 的4种方法,优化必备
Judge the position of the monster in the role under unity3d
stm32Cubemx(8):RTC和RTC唤醒中断
775 Div.1 C. Tyler and strings combinatorial mathematics
2020-10-27
xss注入
Solution of circular dependency
Dotween usage records ----- appendinterval, appendcallback
GameObject class and transform class of unity
AutoCAD - command repetition, undo and redo
On-off and on-off of quality system construction
Unity parallax infinite scrolling background
AutoCAD - full screen display
Introduce Hamming distance and calculation examples
AutoCAD - continuous annotation
JVM 原理和流程简介