Download
(2 Kb)
Download
Updated: 04-24-12 07:43 PM
Updated:04-24-12 07:43 PM
Created:unknown
Downloads:208
Favorites:2
MD5:
LibFrameRecycler
Version: 1.2
by: doxxx [More]
LibFrameRecycler makes it easy to create frames and recycle them for re-use later. If you need to recreate frames on a regular basis, this library will make it easier to recycle the frames you create so that you don't stress the Rift API by creating and throwing away lots of frames.

Usage is quite simple:

-- Create a frame:
local frame = Library.LibFrameRecycler.CreateFrame(frameType, namePrefix, parent)

-- Recycle a frame:
Library.LibFrameRecycler.RecycleFrame(frame)

Recycling a frame will recycle all its child frames as well. So if you don't want that to happen, you must reparent the child frames, using frame:SetParent(newParent), before recycling the parent frame. Recycling a frame which was not created using the library's CreateFrame function will do nothing to that frame, but will try to recycle its children.

Once a frame has been recycled, if you call CreateFrame with the same frame type, it will reuse the recycled frame. Parent, all anchor points, width and height are cleared. Visibility, layer, strata, background color, mouse masking, mouseover unit, secure mode, font color, font size, text, enabled, skin, checked, orientation, range, position, thickness, selection, controller are reset to default values. Extra table members are removed.

If you want to see debug output of when new frames are created, frames are recycled and recycled frames are reused, turn on the library's debug flag:

Library.LibFrameRecycler.debug = true
v1.2 (24 April 2012)
- Clear extra table members when a frame is recycled.

v1.1 (24 April 2012)
- Clear event handlers when frame is recycled.
- Reset more properties when a frame is recycled.

v1.0.0 (19 April 2012)
- Initial release.
Archived Files (3)
File Name
Version
Size
Author
Date
1.1
2kB
doxxx
04-24-12 07:22 PM
1.0.0
2kB
doxxx
04-19-12 06:23 PM
0B
doxxx
04-19-12 06:23 PM


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



Category Jump: