LibStickyFrames-2.0

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.

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

Table of contents

  1. 1 Groups
    1. 1.1 Examples
  2. 2 API
    1. 2.1 :SetGroup([group])
      1. 2.1.1 Args
      2. 2.1.2 Remarks
    2. 2.2 :GetGroup()
      1. 2.2.1 Returns
      2. 2.2.2 Remarks
  3. 3 Overlay Color API
    1. 3.1 Args & Returns
    2. 3.2 :SetColorEnabled([r][, g][, b][, a])
    3. 3.3 :GetColorEnabled()
    4. 3.4 :SetColorDisabled([r][, g][, b][, a])
    5. 3.5 :GetColorDisabled()
    6. 3.6 :SetColorHidden([r][, g][, b][, a])
    7. 3.7 :GetColorHidden()
    8. 3.8 :SetColorSnapEnabled([r][, g][, b][, a])
    9. 3.9 :GetColorSnapEnabled()
    10. 3.10 :GetColorSnapDisabled([r][, g][, b][, a])
    11. 3.11 :GetColorSnapDisabled()
    12. 3.12 :SetColorBorderEnabled([r][, g][, b][, a])
    13. 3.13 :GetColorBorderEnabled()
    14. 3.14 :GetColorBorderDisabled([r][, g][, b][, a])
    15. 3.15 :GetColorBorderDisabled()
  4. 4 Frame API
    1. 4.1 :RegisterFrame(frame)
      1. 4.1.1 Remarks
    2. 4.2 :IsRegisteredFrame(frame)
      1. 4.2.1 Returns
      2. 4.2.2 Returns
    3. 4.3 :UnregisterFrame(frame)
      1. 4.3.1 Returns
    4. 4.4 :AnchorFrame(frame)
      1. 4.4.1 Remarks
    5. 4.5 :SetFrameInsets(frame[, left][, top][, right][, bottom])
      1. 4.5.1 Args
      2. 4.5.2 Remarks
    6. 4.6 :GetFrameInsets(frame)
      1. 4.6.1 Returns
      2. 4.6.2 Remarks
    7. 4.7 :SetFrameGroup(frame[, group])
      1. 4.7.1 Args
      2. 4.7.2 Remarks
    8. 4.8 :GetFrameGroup(frame)
      1. 4.8.1 Returns
      2. 4.8.2 Remarks
    9. 4.9 :IsFrameGroup(frame, group)
      1. 4.9.1 Args
      2. 4.9.2 Returns
      3. 4.9.3 Remarks
    10. 4.10 :InFrameGroup(frame, group)
      1. 4.10.1 Args
      2. 4.10.2 Returns
      3. 4.10.3 Remarks
    11. 4.11 :SetFramePoints(frame[, point, relFrame, relPoint, x, y])
      1. 4.11.1 Args
      2. 4.11.2 Remarks
    12. 4.12 :GetFramePoints(frame)
      1. 4.12.1 Returns
      2. 4.12.2 Remarks
    13. 4.13 :GetFrameOverlay(frame[, noRetrieve])
      1. 4.13.1 Args
      2. 4.13.2 Returns
      3. 4.13.3 Remarks
    14. 4.14 :SetFrameText(frame[, text])
      1. 4.14.1 Args
      2. 4.14.2 Remarks
    15. 4.15 :GetFrameText(frame)
      1. 4.15.1 Returns
      2. 4.15.2 Remarks
    16. 4.16 :SetFrameEnabled(frame[, isEnabled])
      1. 4.16.1 Args
      2. 4.16.2 Remarks
    17. 4.17 :IsFrameEnabled(frame)
      1. 4.17.1 Returns
      2. 4.17.2 Remarks
    18. 4.18 :SetFrameHidden(frame[, isHidden])
      1. 4.18.1 Args
      2. 4.18.2 Remarks
    19. 4.19 :IsFrameHidden(frame)
      1. 4.19.1 Returns
      2. 4.19.2 Remarks
  5. 5 Moving API
    1. 5.1 :StartFrameMoving(frame)
      1. 5.1.1 Remarks
    2. 5.2 :IsFrameMoving(frame)
      1. 5.2.1 Returns
      2. 5.2.2 Remarks
    3. 5.3 :StopFrameMoving()
      1. 5.3.1 Remarks

Facts

Date created
Oct 30, 2008

Author