Started by G_G, March 04, 2009, 12:14:28 am
$game_temp.shop_goods
p $game_temp.shop_goods
$game_temp.shop_goods = something
[[x, y], [x, y], [x, y], [x, y]]
case xwhen 0 item is a $data_itemswhen 1 item is a $data_weaponswhen 2 item is a $data_armorsend
[[0, 1], [1, 1], [2, 1]]
Quote from: Ryexander on May 20, 2009, 11:24:19 pm$game_temp.shop_goods is an array that looks like this[[x, y], [x, y], [x, y], [x, y]]where x is the item typecase xwhen 0 item is a $data_itemswhen 1 item is a $data_weaponswhen 2 item is a $data_armorsendand y is the items IDso...[[0, 1], [1, 1], [2, 1]]would create a shop where you could buy a potion, bronze sword, and bronze shield in that orderhope this helps!
Quote from: legacyblade on May 20, 2009, 11:10:57 pmshort answerSpoiler: ShowHide$game_temp.shop_goods = somethingIt is most likely an array of the IDs of the items the shop will have.
n.times do |i| src_rect = Rect.new(0, 0, 24, 24) <bitmap_class_instance>.blt(<init_x_value> * i, y, RPG::Cache.icon(<icon_name>), src_rect)end
Quote from: Ryexander on May 23, 2009, 05:34:22 pmwhere n = <number_of_times_to_draw_icon>you can set n to 1, 2, 3, 4, or 5 with conditional branches or what ever
for i in item.rarity src_rect = Rect.new(0, 0, 24, 24) <bitmap_class_instance>.blt(<init_x_value> * i, y, RPG::Cache.icon(<icon_name>), src_rect)end
Quote from: Aqua on May 23, 2009, 06:04:17 pmQuote from: Ryexander on May 23, 2009, 05:34:22 pmwhere n = <number_of_times_to_draw_icon>you can set n to 1, 2, 3, 4, or 5 with conditional branches or what everYou could also do...for i in item.rarity src_rect = Rect.new(0, 0, 24, 24) <bitmap_class_instance>.blt(<init_x_value> * i, y, RPG::Cache.icon(<icon_name>), src_rect)endThis way you don't have to use conditions nor the n.
n.times do |i| src_rect = Rect.new(0, 0, 24, 24) self.contents.blt(<init_x_value> * i, y, RPG::Cache.icon(<icon_name>), src_rect)end
bitmap = Bitmap.new(width, height)n.times do |i| src_rect = Rect.new(0, 0, 24, 24) bitmap.blt(<init_x_value> * i, y, RPG::Cache.icon(<icon_name>), src_rect)end
src_rect = Rect.new(0, 0, 24, 24)