-按键又忘了~~~
local max_num = 10
local col = ui.math_div(max,2) --列数
local row = 0 --行数
for i = 1,max do
<span style="white-space:pre"> </span>-------处理行-------------
<span style="white-space:pre"> </span>row = ui.math_mod(i,col)
<span style="white-space:pre"> </span>if row == 1 then
<span style="white-space:pre"> </span>--首
<span style="white-space:pre"> </span>elseif row == 0 then
<span style="white-space:pre"> </span>--尾
<span style="white-space:pre"> </span>else
<span style="white-space:pre"> </span>--中间
<span style="white-space:pre"> </span>end
end
--新手引导位置
function uiBag.getItemPos(itemIndex)
itemIndex = itemIndex - 1
local itemPos = nil
if uiEquip.isexist then
itemPos = {x=516,y=370,w=63,h=69}
else
itemPos = {x=516-195,y=370,w=63,h=69}
end
itemPos.x = itemPos.x + itemPos.w * math.mod(itemIndex,5)
itemPos.y = itemPos.y - itemPos.h * math.floor(itemIndex/5)
return itemPos
end