class Floating < Sprite
SWITCH_TO_ITEM = {
10 => 50,
11 => 51
}
def initialize(viewport = nil)
super(viewport)
self.bitmap = Bitmap.new(96, 32)
self.x = 640 - 96
self.z = 1000
update
end
def dispose
self.bitmap.dispose
super
end
def update
super
SWITCH_TO_ITEM.each_key { |i|
if $game_switches
id = SWITCH_TO_ITEM
number = $game_party.item_number(id)
if @item != id || @item_number != number
self.bitmap.clear
bitmap = RPG::Cache.icon($data_items[id].icon_name)
self.bitmap.blt(4, 4, bitmap, Rect.new(0, 0, 24, 24))
self.bitmap.draw_text(32, 4, 64, 32, sprintf("×%3d", number))
@item = id
@item_number = number
@sp = -1
end
return
end
}
sp = $game_party.actors[0].sp
if @sp != sp
self.bitmap.clear
self.bitmap.draw_text(4, 0, 88, 32, sprintf("SP:%5d", sp))
@sp = sp
@item = 0
@item_number = 0
end
end
end
欢迎光临 Project1 (https://rpg.blue/) | Powered by Discuz! X3.1 |