创建QuickCell文件
local QuickCell = class("QuickCell", function()
return ccui.Widget:create()
end)
-- self._data.wid default 100
-- self._data.hei default 50
-- self._data.anchor default {x=0, y=0}
-- self._data.tick_interval default 0.02
-- self._data.activeEvent default inview
-- self._data.createCell default nil
function QuickCell:ctor()
self._entered = false
self._active = true
end
function QuickCell:Create( data )
local cell = QuickCell.new()
if cell and cell:Init( data ) then
return cell
end
return nil
end
function QuickCell:Init( data )
self._data = data
local wid = self._data.wid or 100
local hei = self._data.hei or 50
local anchor = self._data.anchor or {x=0, y=0}
self:setContentSize( {width = wid, height = hei} )
self:setAnchorPoint( anchor )
self:Active()
return true
end
function QuickCell:Update( data )
local createCell = data.createCell
self._data.createCell &