Lore archive · Warcraft Wiki, 2023 dump
API Cooldown SetCooldown
Last wiki revision 2021-08-09
Shows a cooldown animation on a cooldown frame. obj:SetCooldown(start, duration[, modRate])
- start: Number - The time when the cooldown started (as returned by GetTime). Zero if no cooldown.
- duration: Number - Cooldown duration in seconds. Zero if no cooldown.
- modRate : Number - The rate at which the animation should be updated.
- Calling this method will automatically show/hide the Cooldown widget. The widget, unless the animation is reversed, will also hide itself automatically when the animation completes.
First we create a container frame, a texture and a cooldown frame to work with:
Then we display a 10s cooldown animation on the cooldown frame:
To display a 20s cooldown animation which started 5s ago:
To reset the cooldown animation and trigger the "cooldown finished" bling:
To set the animation according to a cooldown of a spell in the spellbook we use:
Source
https://warcraft.wiki.gg/wiki/API_Cooldown_SetCooldown · retrieved 2023-11-13 · CC BY-SA 4.0
Converted from wikitext with templates, tables and images removed, so some sentences may be missing values.
This archive predates WoW: Forever. For collected gameplay facts see the Forever database. Search the archive.