Class: Core::GUI::ItemInfo
- Includes:
- Core
- Defined in:
- lib/gui/item_info.rb
Constant Summary
Constants included from Core
CURSOR_Z, DEFAULT_CONFIG, DEFAULT_FONT, FOG_Z, Core::GUI_Z, HOME_PATH, LIBRARY_PATH, MAPOBJECT_Z, MAP_Z, PARTICLE_Z, RELEASE, SAVE_DIR, VERSION
Instance Attribute Summary
Attributes inherited from Element
#h, #w, #x, #xoff, #y, #yoff, #zoff
Instance Method Summary collapse
- #draw ⇒ Object
-
#initialize(x, y) ⇒ ItemInfo
constructor
A new instance of ItemInfo.
- #item=(item) ⇒ Object
Methods included from Core
anim, animations, animations=, between?, config, exit, font, inside?, load_game, mouse_inside?, multiline, particles, particles=, save_game, silently, sprite, tiles, window, window=
Methods inherited from Element
Constructor Details
#initialize(x, y) ⇒ ItemInfo
Returns a new instance of ItemInfo.
6 7 8 9 10 11 12 13 |
# File 'lib/gui/item_info.rb', line 6 def initialize(x, y) super(x, y, 672, 160) @bg = Core.sprite("gui/iteminfo_background") @img = Core.sprite("items/none") @bigfont = Core.font(Core::DEFAULT_FONT, 32) @font = Core.font(Core::DEFAULT_FONT, 24) @item = nil end |
Instance Method Details
#draw ⇒ Object
22 23 24 25 26 27 28 29 30 |
# File 'lib/gui/item_info.rb', line 22 def draw super @bg.draw(@x, @y, Core::GUI_Z + 9, @w/@bg.width.to_f, @h/@bg.height.to_f) @img.draw(@x, @y, Core::GUI_Z + 10, @h/@img.width.to_f, @h/@img.height.to_f) if @item @bigfont.draw(Trans.item(@item.name), @x+@h+4, @y+4, Core::GUI_Z + 11, 1, 1, Gosu::Color::BLACK) @font.draw(Trans.item("#{@item.name}_desc"), @x+@h+4, @y+36, Core::GUI_Z + 11, 1, 1, Gosu::Color::BLACK) end end |