Download
(5Kb)
Download
Updated: 04-10-24 07:49 PM
Compatibility:
Plunderstorm (10.2.6)
Updated:04-10-24 07:49 PM
Created:03-18-24 08:11 AM
Downloads:24
Favorites:0
MD5:

LibFramePool

Version: 1.1
by: AgentRG [More]

# LibFramePool-1.0
### about:
Creates a table containing _n_ amount of frames of the same type with optional argument to predefine the frames. Since
a table is being returned on creation, the created variable can be looped using a loop of your choice to make changes
to the frames, or individual frames called upon based on their index position.

### Usage:
local lib = LibStub("LibFramePool-1.0")

pool = lib:CreateFramePool(20, "CheckButton", {nil, parentFrame, "ChatConfigCheckButtonTemplate"})

lib:SetOnClickScript(pool, function() print("Hello world!") end)

### Available functions:
* `CreateFramePool(numOfFrames, frameType[, frameArgs])`
* `DeleteFramePool(Pool)`
* `IncrementallyChangeXForAllFrames(Pool, point, initialOffsetX, incrementalOffsetX[, frames])`
* `IncrementallyChangeYForAllFrames(Pool, point, initialOffsetY, incrementalOffsetY[, frames])`
* `SetOnClickScript(Pool, script[, frames])`
* `SetOnEventScript(Pool, script[, frames])`
* `HideFrames(Pool[, frames])`
* `ShowFrames(Pool[, frames])`

Since the object returned by `CreateFramePool` is a table, it can also be iterated to run other WoW functions on them:

for i = 1, #pool do
if r == 3 then
y = y - 20
x = 8
r = 0
end
pool[i].frame:SetPoint("TOPLEFT", x, y)
x = x + 200
r = r + 1
end

The previous for loop will move the frames to look like this:

x x x
x x x
x x x

Optional Files (0)


Archived Files (1)
File Name
Version
Size
Author
Date
1.0
5kB
AgentRG
03-18-24 08:11 AM


There have been no comments posted to this file.
Be the first to add one.



Category Jump: