API

Groups

Groups allow you to only group to specific frames. Groups can be anything, true, false or nil will make your frame stick to all frames while anything else will only make frames with the same group sticky. If group is a table it can contain the other frames it can stick to but not part of the group like so. Alternativly if there is only 1 additional frame it can stick to, set the group as the frame

Examples

:SetFrameGroup(frame, true)
:SetFrameGroup(frame, "MyFrameGroup")
:SetFrameGroup(frame, 8764287648721)
:SetFrameGroup(frame, frame)
local group = { }
:SetFrameGroup(frame1, group)
:SetFrameGroup(frame2, group)
:SetFrameGroup(frame3, group)
:SetFrameGroup(parentFrame, "AddonName")
local group = { [parentFrame] = true }
:SetFrameGroup(childFrame1, group)
:SetFrameGroup(childFrame2, group)
:SetFrameGroup(childFrame3, group)

API

:SetGroup([group])

Args

group: See Groups

Remarks

true will enable all registered frames, false or nil will disable all registered frames while passing a group will only enable registered frames that are in or a part of the same group. Fires a callback when set.

:GetGroup()

Returns

group: See Groups

Remarks

Returns the current group. You can use :IsFrameGroup and :InFrameGroup to check frames

Overlay Color API

Args & Returns

r (number or nil): Red part of the color (1.0 for 100% intensity). nil is the same as 0
g (number or nil): Green part of new color (1.0 for 100% intensity). nil is the same as 0
b (number or nil): Blue part of new color (1.0 for 100% intensity). nil is the same as 0
a (number or nil): Alpha (transparency) value (0.0 for totally transparent, 1.0 for solid color). nil is the same as 1

:SetColorEnabled([r][, g][, b][, a])

:GetColorEnabled()

:SetColorDisabled([r][, g][, b][, a])

:GetColorDisabled()

:SetColorHidden([r][, g][, b][, a])

:GetColorHidden()

:SetColorSnapEnabled([r][, g][, b][, a])

:GetColorSnapEnabled()

:GetColorSnapDisabled([r][, g][, b][, a])

:GetColorSnapDisabled()

:SetColorBorderEnabled([r][, g][, b][, a])

:GetColorBorderEnabled()

:GetColorBorderDisabled([r][, g][, b][, a])

:GetColorBorderDisabled()

Frame API

The frames arg is required in all API in this section. It is simply the frame you are refering to.

:RegisterFrame(frame)

Remarks

Registers a frame.

:IsRegisteredFrame(frame)

Returns

isRegistered

Returns

Returns true if the frame is registered

:UnregisterFrame(frame)

Returns

Unregisters a frame and resets any settings

:AnchorFrame(frame)

Remarks

This can be called after :StopStickyMoving() to anchor the frame right back to the parent, so you can manipulate its children as a group (This is useful in WatchDog).

:SetFrameInsets(frame[, left][, top][, right][, bottom])

Args

left: If your frame has a transparent border around the entire frame (think backdrops with borders). This can be used to fine tune the edges when you are stickying groups. Refers to any offset on the LEFT edge of the frame being moved.
top: same as above
right: same as above
bottom: same as above

Remarks

Sets the insets for the frame.

:GetFrameInsets(frame)

Returns

left
top
right
bottom

Remarks

returns the insets for the frame. Will return 0 for any unset values

:SetFrameGroup(frame[, group])

Args

group: See Groups

Remarks

Sets the group for the frame.

:GetFrameGroup(frame)

Returns

group: See Groups

Remarks

returns the group for the frame

:IsFrameGroup(frame, group)

Args

group: The group to check against, see Groups

Returns

isGroup: true or nil

Remarks

Returns true if the frame is the same as the group or if group is true.

:InFrameGroup(frame, group)

Args

group: The group to check against, see Groups

Returns

inGroup: true or nil

Remarks

Returns true if the frame is the group or if the group is a table indexed by frames then the group will be checked to see if the frame is present.

:SetFramePoints(frame[, point, relFrame, relPoint, x, y])

Args

point: The point of the frame that is being stuck
relFrame: The frame to stick to
relPoint: The point of frameTo that is being stuck to
x: The x offset (the insets offset is automatically taken into account)
y: The y offset (the insets offset is automatically taken into account)

Remarks

Sets the frames points and shows the anchor. Works alot like frame:SetPoint

:GetFramePoints(frame)

Returns

point: The point of the frame that is being stuck
relFrame: The frame to stick to
relPoint: The point of frameTo that is being stuck to
x: The x offset (the insets offset is automatically taken into account)
y: The y offset (the insets offset is automatically taken into account)

Remarks

Returns the points of the frame

:GetFrameOverlay(frame[, noRetrieve])

Args

noRetrieve: doesn't retrieve the overlay if not already retrieved

Returns

overlay:

Remarks

Returns the overlay and creates it if it doesn't exist

:SetFrameText(frame[, text])

Args

text: a string

Remarks

Sets the text to be displayed on the overlay

:GetFrameText(frame)

Returns

text: The string that is being shown on the frame

Remarks

Returns the text displayed on the overlay If a frame isn't enabled you cannot drag the frame around even when the sticky group is set to true. It still allows frames to snap to it.

:SetFrameEnabled(frame[, isEnabled])

Args

isEnabled: nil or false will disable, anything else will enable

Remarks

Sets whether the frame is enabled or not. An enabled frame is allowed to be dragged.

:IsFrameEnabled(frame)

Returns

isEnabled: true or nil

Remarks

Returns whether the frame is enabled or not

:SetFrameHidden(frame[, isHidden])

Args

isHidden: nil or false will not hide, anything else will hide

Remarks

Set whether the frame should be hidden after llb:SetGroup(group) is called and the frame is not part of the group. This is automatically set if the frame isn't shown when :SetGroup(group) is called.

:IsFrameHidden(frame)

Returns

isHidden: true or nil

Remarks

Returns the hidden state. This is automatically cleared after :SetGroup(group) is called and the frame isn't in the group.

Moving API

:StartFrameMoving(frame)

Remarks

Sets a custom OnUpdate for the frame so it follows the mouse and snaps to the frames its grouped with.

This generally does not need to be called as it will be called when the overlay is dragged.

Only one frame can be moving at a time. A callback is fired when this is called.

:IsFrameMoving(frame)

Returns

isMoving: true or false

Remarks

Returns true if the frame is moving.

:StopFrameMoving()

Remarks

This stops the OnUpdate, leaving the frame at its last position. This will leave it anchored to the last frame it was able to attach to or the UIParent. You can call :AnchorFrame(frame) to anchor it back "TOPLEFT" of the UIParent.

This generally does not need to be called as it is automatically called when a frame has stopped being dragged or when :SetGroup is called which disables the frame being dragged.

A callback is fired when this is called.


Comments

Posts Quoted:
Reply
Clear All Quotes