The objective of this library is to make showing/hiding custom overlays easier, using the built in spell activation overlay addon made by Blizzard and introduced patch 4.0.3.
These are the API this library provides:
:Show(spellID, duration[, position][, scale][, texture][, r, g, b])
spellID = number, preferably a real spell ID
duration = between 1 and max int value
position = ["CENTER", "TOP", "BOTTOM", "LEFT", "RIGHT", "TOPLEFT", "TOPRIGHT", "BOTTOMLEFT", "BOTTOMRIGHT", "RIGHT (FLIPPED)", "BOTTOM (FLIPPED)", "LEFT + RIGHT (FLIPPED)", "TOP + BOTTOM (FLIPPED)"]
scale = number, .5 is half size, 2 is double size, e.g.
texture = string, path to a blp/tga file to use as a texture
r, g and b = color the texture, set to 255 to make it appear normal
spellID = number, hides the overlay by this spell ID
returns a table with positions that are available
Example addon (Mage)
Using the library to show a texture and make it turn more red the more stacks of Arcane Blast the player has.
Example addon using LibSpellOverlay-1.0 to create an overlay and
help track Arcane Blast debuff stacks.
-- Do not load if not a Mage
if select(2, UnitClass("player")) ~="MAGE"thenreturnend
-- Do not load if LibStub is missing
ifnot LibStub thenreturnend
-- Get the library
local LibSpellOverlay = LibStub:GetLibrary("LibSpellOverlay-1.0", 1)