lua--弾枠にアイテムリストを表示
5347 ワード
-- ,
-- : , , ,
-- ,
function UIBagController:showDataBox( )
self.itemBoxNum = 0;
self.nBoxIndex = 0;
self.percent = 0
local tBoxOpen = ItemM:getBoxForOpen();
-- ScrollView
self.BoxScroll = tolua.cast(UIHelper:seekWidgetByName(self.panelBox, "ScrollView_BoxList"), "ScrollView");
-- 0.2 (self.percent, 100, )
self.BoxScroll:scrollToPercentVertical(self.percent, 0.2, false);
--local actFunc = CCCallFunc:create(self, callfunc_selector(UIBagController:callBackBox)) ;
--
local action = Transition.sequence({
CCDelayTime:create(0.3), -- 0.3
--
CCCallFunc:create(function ( )
print("=======UIBagController:callBackBox=======")
self.itemBoxNum = self.itemBoxNum + 1;
self.nBoxIndex = self.nBoxIndex + 1;
print("=======nBoxIndex=======" .. self.nBoxIndex)
if tBoxOpen[self.nBoxIndex] ~= nil then
self:showItemDataBox(tBoxOpen[self.nBoxIndex]);
else
return;
end
if self.nBoxIndex == 4 then
self.percent = 10;
elseif self.nBoxIndex == 7 then
self.percent = 20;
elseif self.nBoxIndex == 10 then
self.percent = 30;
end
self.BoxScroll:scrollToPercentVertical(self.percent, 0.2, false);
end)
})
-- 15
self.BoxScroll:runAction(CCRepeat:create(action, 15));
end