LibEffects-1.0

LibEffects

LibEffects is a library that can add effects to your addon.

Features

  1. Screen Shake
  2. Screen Flash
  3. 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]])

You must login to post a comment. Don't have an account? Register to get one!

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
  • B: beta1 for 3.0.3 on 05 Jan 2009
  • A: r3 for 3.0.3 on 27 Dec 2008
  • A: r2 for 3.0.3 on 27 Dec 2008

Authors

Relationships

Embedded library
LibStub