#--------------------------------------------------------------------------
# ● 获取项目的绘制矩形
#--------------------------------------------------------------------------
def item_rect(index)
if $menu_open == false
rect = Rect.new
rect.width = item_width
rect.height = item_height
rect.x = index % col_max * (item_width + spacing)
rect.y = index / col_max * item_height
rect
else
if $rect_if == true
$rectm.dispose
end
$rectm = Sprite.new
$rectm.bitmap = Bitmap.new("Graphics/Menu/menurect1.png")
temp1 = index % col_max * (item_width)
temp2 = index / col_max * item_height
rect = Rect.new(temp1, temp2, $rectm.bitmap.width, $rectm.bitmap.height)
#self.contents.blt(temp1, temp2, rectm.bitmap, rect)
$rectm.x = temp1 + 2
$rectm.y = temp2 + 118
$rect_if = true
rect.x = temp1
rect.y = temp2
rect
end
end
#--------------------------------------------------------------------------
# ● 获取项目的绘制矩形
#--------------------------------------------------------------------------
def item_rect(index)
if $menu_open == false
rect = Rect.new
rect.width = item_width
rect.height = item_height
rect.x = index % col_max * (item_width + spacing)
rect.y = index / col_max * item_height
rect
else
if $rect_if == true
$rectm.dispose
end
$rectm = Sprite.new
$rectm.bitmap = Bitmap.new("Graphics/Menu/menurect1.png")
temp1 = index % col_max * (item_width)
temp2 = index / col_max * item_height
rect = Rect.new(temp1, temp2, $rectm.bitmap.width, $rectm.bitmap.height)
#self.contents.blt(temp1, temp2, rectm.bitmap, rect)
$rectm.x = temp1 + 2
$rectm.y = temp2 + 118
$rect_if = true
rect.x = temp1
rect.y = temp2
rect
end
end