Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
WoW
Talk
English
Views
Read
Edit
History
More
Search
Navigation
Home
Random page
Help using wiki
Editions
for WoW
for WildStar
for Solar2D
Documentation
for WoW
for WildStar
Reference
WoW
⦁ FrameXML
⦁ AddOns
⦁ API
⦁ WoW Lua
WildStar
⦁ AddOns
⦁ API
⦁ WildStar Lua
Engine
Tools
What links here
Related changes
Special pages
Page information
Site
Recent Changes
Editing
WoW:API Cooldown SetCooldown
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{stub/API}} {{widgetmethod}} Set parameters for cooldown animation. Cooldown:SetCooldown(start, duration) start: GetTime() -- cooldown starts immediatelly (SetCooldown() uses your computer's uptime as 'now', not 0. Computer's Uptime is in ms and you can get it from GetTime().) GetTime()+4 -- cooldown will start after 4 seconds GetTime()-5 -- cooldown is in progress (if duration is 10 then it starts cd animation in the middle, as 5 seconds from 10sec cooldown already elapsed) duration: duration of your cooldown in seconds (number) Cooldown:SetCooldown(GetTime()-x*z, y*z) or Cooldown:SetCooldown(GetTime()-(x/y)*z, z) To start cooldown in the middle set x/y = 1/2 or 0,5 (x=1, y=2 in the fist example), to start at 9/10 set x/y = 9/10 etc. z can be used to reduce or increase speed of animation (cooldown length). Logically z-(x/y) gets you the duration of cooldown. When the cooldown expires, its texture gets lost.
Summary:
Please note that all contributions to AddOn Studio are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see
AddOn Studio Wiki:Copyrights
for details).
Submissions must be written by you, or copied from a public domain or similar free resource (see
AddOn Studio Wiki:Copyrights
for details).
Cancel
Editing help
(opens in new window)
Templates used on this page:
Template:Apinav
(
edit
)
Template:Editlink
(
edit
)
Template:Stub/API
(
edit
)
Template:Stub/Box
(
edit
)
Template:Tocright
(
edit
)
Template:Widget
(
edit
)
Template:Widgetmethod
(
edit
)