LibEffects
LibEffects is a library that can add effects to your addon.
Features
- Screen Shake
- Screen Flash
- Play Sounds
Implementing
Use the following code to implement LibEffects-1.0:
local Effects = LibStub("LibEffects-1.0")
or you could also use it as a mix in by doing:
MyAddon = LibStub("AceAddon-3.0"):NewAddon("MyAddon", "LibEffects-1.0")
Flash()
To make the screen border flash use the following code:
Effects:Flash()
Shake()
To make the screen shake use the following code:
Effects:Shake()
AddSound(unique name, location)
AddSound() adds a sound to the sounds array, making it easy to play sounds later on. To add a sound, use the following code:
Effects:AddSound("DoorOpen",[[Sound\Doodad\PVP_Lordaeron_Door_Open.wav]])
Remember, the name must be unique.
PlaySound(unique name)
PlaySound() plays the sound with the name specified, to do so use this code:
Effects:PlaySound("DoorOpen")
UpdateSound(unique name, location)
UpdateSound() updates the sound file location, like so:
Effects:UpdateSound("DoorOpen",[[Sound\Doodad\PortcullisActive_Closed.wav]])
Facts
- Date created
- 27 Dec 2008
- Category
- Last update
- 05 Jan 2009
- Development stage
- Beta
- Language
- enUS
- License
- Public Domain
- Curse link
- LibEffects-1.0
- Reverse relationships
- 2
- Recent files
Authors
Relationships
- Embedded library
- LibStub