def cache_items
@cached_items = Gosu.render(MAIN_X + MAIN_WIDTH, MAIN_Y+MAIN_HEIGHT) do
count = 0
@items_array[@first_item..@first_item+3].each do |elem|
elem['img'].draw(MAIN_X + OFFSET_X,
MAIN_Y + OFFSET_Y + 100*count,
3)
Gosu::Image.new(Gosu::Image.from_markup("<c=FF0000>#{elem['txt']}</c>", 25, bold: true))
.draw(MAIN_X + OFFSET_X + 100,
MAIN_Y + OFFSET_Y + 100*count + 25,
3)
count+=1
end
end
end
@first_item
will be decreased/increased and i re-cache the items.
Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill