Go to Page... |
Compatibility: | Live (1.0) |
Updated: | 04/10/14 10:24 PM |
Created: | 04/08/14 07:11 PM |
Monthly downloads: | 17 |
Total downloads: | 2,458 |
Favorites: | 10 |
MD5: |
## OptionalDependsOn: LibDragWin-1.0
## DependsOn: LibDragWin-1.0
local LDW = LibStub("LibDragWin-1.0"):Register(addonName, callbackFunc) -- addonName = string; a unique name for your addon registration -- callbackFunc = function; the function to call with new position|scaling data -- callbackFunc returns: frame, point, rel, relPoint, x, y, scale -- returns an instance of the library table
SampleAddon = {} local LDW = LibStub("LibDragWin-1.0"):Register("SampleAddon", self.SavePosition) function SampleAddon:SavePosition(frame, point, rel, relPoint, x, y, scale) self.savedVars[frame] = { point = point, rel = rel, relPoint = relPoint, x = x, y = y, scale = scale } end
local drag = LDW:Attach(targetFrame, label) -- targetFrame = frame; the frame to attach to for dragging|scaling -- label = string; a label to show on the overlay for this frame (default: "", optional) -- returns an instance of Attach owned by your library instance
LDW:Resync(targetFrame) -- targetFrame = frame; the frame to resync to
local LDW = LibStub("LibDragWin-1.0"):Retrieve(addonName) -- addonName = string; a unique name for your addon registraction -- returns an existing instance of the library table
local allDrag = LDW:GetAttachments() -- returns a table containing references to all attachments
LDW:ShowAll() --OR-- LDW:HideAll()
LDW:SnapToGrid(snap, gridSize) -- snap = boolean; whether or not frames should snap-to-grid -- gridSize = number; the size of the grid (default: 10, optional)
LDW:AllowScaling(allow) -- allow = boolean; whether frames can be scaled
local target = drag:GetTarget() -- returns the frame being moved by this overlay
drag:Show() --OR-- drag:Hide()
local overlay = drag:GetOverlay() -- returns a CT_BACKDROP control -- for use when you wish to change the overlay appearance --AND-- local label = drag:GetLabel() -- returns a CT_LABEL control -- for use when you wish to change the label appearance
drag:SetLabelText(text) -- text = string; text to display on overlay (default: "", optional)
There have been no comments posted to this file.
Be the first to add one. |