LibAvion-2.0
From WowAce Wiki
| Summary | |
|---|---|
| Lib: Avion-2.0 | |
| A library that triggers visual effects. | |
| TOC | 2.4 (20400) |
| Category | Libraries |
| Author | Sirow |
| Details | |
| Version | 2.0 |
| OptionalDeps | LibStub, LibSimpleTimer-1.0 |
| Links | |
| Betas | Ace SVN Zip |
| Changelog | FishEye |
Contents |
[edit]
LibAvion-2.0 - API Documentation
[edit]
Example addon
UNDER CONSTRUCTION
[edit]
:TriggerAnimation(triggerID, animationTable)
[edit]
Arguments
- triggerID
- string - a unique identifier, that allows to stop animation if needed.
- animationTable
- table - table that contains animations information, see extra section.
[edit]
Notes
- Will trigger the animation given by animationTable. As long as animation is still active it can be canceled with the given triggerID.
[edit]
Example
LibAvion:TriggerAnimation("HelloWorld", {...})
[edit]
:StopAnimation(triggerID, fadeOut)
[edit]
Arguments
- triggerID
- string - a unique identifier.
- fadeOut
- boolean - wether the frame should be smoothly faded out or just disappear.
[edit]
Notes
- Will cancel the given animation refered to by triggerID.
- If fadeOut is true, frame will (slowly) fade out. (Will have no effect when frame is allready fading)
[edit]
Example
LibAvion:StopAnimation("HelloWorld", true)
[edit]
:StopAllAnimations(fadeOut)
[edit]
Arguments
- fadeOut
- boolean - wether the frame should be smoothly faded out or just disappear.
[edit]
Notes
- Will cancel all animations.
- If fadeOut is true, frame will (slowly) fade out. (Will have no effect when frame is allready fading)
[edit]
Example
LibAvion:StopAllAnimations(false)
[edit]
:IsAnimationRunning(triggerID)
[edit]
Arguments
- triggerID
- string - a unique identifier.
[edit]
Returns
- isTrue
- boolean - returns true if there is allread an animation with this identifier
[edit]
Notes
- Will return if animation with given identifier is allready running
[edit]
Example
if (LibAvion:IsAnimationRunning("HelloWorld")) then
LibAvion:StopAnimation("HelloWorld", true)
end
[edit]
:Embed(target)
[edit]
Arguments
- target
- table - library or addon to embed LibAvion-2.0 in.
[edit]
Notes
- Embeds methods from LibAvion-2.0 into target table.
[edit]
Example
LibStub:GetLibrary("LibCooldown-Item-2.0"):Embed(MyAddon)
[edit]
AnimationTable format
Below you can see an overview of how the table needs to be formated, that is passed to ":TriggerAnimation(triggerID, animationTable)". You only should need to bother about this, when triggering an animation "by hand" without using all the neat addition in LibAvionEmbed-2.0.
{
alpha = Alpha value when its shown (number)
color = {
r = Red color when its shown (number)
g = Green color when its shown (number)
b = Blue color when its shown (number)
}
position = {
x = X-Position on screen when its shown (number)
y = Y-Position on screen when its shown (number)
}
size = {
width = Width when its shown (number)
height = Height when its shown (number)
}
rotation = Rotation of texture when its shown (number)
isAnimated = {
color = Should color be animated? (bool)
position = Should position be animated? (bool)
scale = Should scale be animated? (bool)
rotation = Should rotation be animated? (bool)
}
animation = {
color = {
r = Red color that is beeing animated to (number)
g = Greem color that is beeing animated to (number)
b = Blue color that is beeing animated to (number)
},
position = {
x = X-Position that is beeing animated to (number)
y = Y-Position that is beeing animated to (number)
},
scale = Scale that is beeing animated to (number)
rotation = Rotations of texture that is beeing animated to (number)
}
animationFunc = {
alpha = Smoothness/speed of alpha animation (function)
color = Smoothness/speed of color animation (function)
position = Smoothness/speed of position animation (function)
scale = Smoothness/speed of scale animation (function)
rotation = Smoothness/speed of rotation animation (function)
}
NOTE: All of this functions HAVE to be pointers to function with head
"function (param, rnd)", where <param> gonna be a value between 0 (start)
and 1 (end), depending on the time the animation is still running.
<rnd> is the value that can be set in the options dialogue under "Randomness",
its meant to add some random effect.
addRandom = {
alpha = Add some randomness to alpha animation (number)
color = Add some randomness to color animation (number)
position = Add some randomness to position animation (number)
scale = Add some randomness to scale animation (number)
rotation = Add some randomness to rotation animation (number)
}
fadeMode = How to fade the frame
NOTE: 0 means, just fading; 1 means fade and coninue animation,
2 means inverting animation when fading out
animationTime = The time the "animation" phase should take
fadeTime = The time it should take the frame to fade
out after completion (number)
waitTime = The time it should take from triggering the
animation until the actual animation should start
NOTE: Can be used to create difficult multi-animations. (number)
showWhileWait = Allready show the frame/animation while
"waitTime" is yet running (bool)
textureFile = Texture file (file link, no SharedMedia!) to
the texture that should be used (string)
soundFile = Sound file (file link, no SharedMedia!) to
the sound that is triggered as soon as the
animation starts (string)
mirror = {
x = Mirror texture on x-axis (bool)
y = Mirror texture on y-axis (bool)
}
noEnd = The animation won't fade when its finished, but
will rather need to be stopped with
LibAvion:StopAnimation(...) (bool)
}

