Environment: Cocos2d-x 3.17
Language: Lua
Radial progress indicators are commonly used for skill cooldowns:
1 | function createSkillCooldown(parent) |
setReverseDirection(true) reverses the radial direction. Animate the percentage from 100 to 0, or from 0 to 100 depending on the overlay artwork and desired visual:
1 | progress:runAction(cc.ProgressTo:create(cooldownSeconds, 0)) |
Keep a reference if the cooldown must be cancelled, reset, or synchronized with server state.