-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathLinePool.lua
More file actions
21 lines (18 loc) · 791 Bytes
/
LinePool.lua
File metadata and controls
21 lines (18 loc) · 791 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
---- LINE POOL ----
-- copy/pasta of TexturePoolMixin, just for lines
local LinePoolMixin = CreateFromMixins(ObjectPoolMixin)
local function LinePoolFactory(linePool)
return linePool.parent:CreateLine(nil, linePool.layer, linePool.textureTemplate, linePool.subLayer)
end
function LinePoolMixin:OnLoad(parent, layer, subLayer, textureTemplate, resetterFunc)
ObjectPoolMixin.OnLoad(self, LinePoolFactory, resetterFunc)
self.parent = parent
self.layer = layer
self.subLayer = subLayer
self.textureTemplate = textureTemplate
end
--[[ global ]] function CreateLinePool(parent, layer, subLayer, textureTemplate, resetterFunc)
local linePool = CreateFromMixins(LinePoolMixin)
linePool:OnLoad(parent, layer, subLayer, textureTemplate, resetterFunc or FramePool_Hide)
return linePool
end