An easy to use Button with a build in Progressbar and cooldown.
Overview
For an easy to use Button with a build in Progressbar and cooldown.
Demo File
Installation
To install this addon, simply copy the contents of either the Pretty or Minified CooldownButton JavaScript into your Story's JavaScript page, and the contents of the Stylesheet into your Story's Stylesheet.
Usage
<<cooldownButton "My Button">>
/* Your Code */
<</cooldownButton>>
Macros
<<cooldownButton>>
Syntax : <<cooldownButton Text [Duration] [Direction]>>
Arguments :
text
: The text that will be displayed on the Button. The Content's Text of the Button has to be the first argument.
duration
: (optional) How long the Button will be deactivated after being clicked. This argument can be a Number or a String. The following are valid examples for a 1 second cooldown duration: 1000, 1000ms, 1s A 3 Second cooldown is the Default.
direction
: (optional) Does determine the direction of the Progressbar, fill and fillup will let the bar fill the button from left to right, emtpy will start with a full bar and reduce it from right to left. Valid values are: fill
, fillup
, empty
. Empty is the Default Property value.
All of the above Properties can be a variable's name to dynamically alter any of those Properties.
Usage :
<<cooldownButton "My Button">>
...
<</cooldownButton>>
With variables:
<<cooldownButton "$MyVar" fill 1s>>
...
<</cooldownButton>>
Alternatively:
<<cooldownButton "$Name" "$Cooldown" "_Direction">>
...
<</cooldownButton>>
READ : Documentation
Live demo
Demo Twee code:
:: Start
<<cooldownButton "My Button">>
/* Your Code */
<</cooldownButton>>