Class: Core::States::IngameMenu
- Defined in:
- lib/states/menus/ingame.rb
Constant Summary
Constants included from Core
CURSOR_Z, DEFAULT_CONFIG, DEFAULT_FONT, FOG_Z, GUI_Z, HOME_PATH, LIBRARY_PATH, MAPOBJECT_Z, MAP_Z, PARTICLE_Z, RELEASE, Core::SAVE_DIR, VERSION
Instance Attribute Summary
Attributes inherited from State
Instance Method Summary collapse
- #draw ⇒ Object
-
#initialize(window, party) ⇒ IngameMenu
constructor
A new instance of IngameMenu.
- #update ⇒ 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 State
#draw_cursor, #finish, #update_cursor
Constructor Details
#initialize(window, party) ⇒ IngameMenu
Returns a new instance of IngameMenu.
7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/states/menus/ingame.rb', line 7 def initialize(window, party) super(window) @background = Core.sprite("menu/ingame_background") @w = Core::GUI::Window.new(0, 0, 1024, 768, Trans.(:menu)) @w.add(:items, Button.new(32, 32, 224, 32, Trans.(:items), lambda {})) @w.add(:equip, Button.new(32, 96, 224, 32, Trans.(:equipment), lambda { @window.advance(EquipMenu.new(@window, self, party)) })) @w.add(:skills, Button.new(32, 160, 224, 32, Trans.(:skills), lambda {})) @w.add(:alchemy, Button.new(32, 224, 224, 32, Trans.(:botany), lambda { @window.advance(AlchemyMenu.new(@window, self, party)) })) @w.add(:magic, Button.new(32, 284, 224, 32, Trans.(:magic), lambda { @window.advance(MagicMenu.new(@window, self, party)) })) @w.add(:save, Button.new(32, 552, 224, 32, Trans.(:save), lambda { Core.save_game })) @w.add(:load, Button.new(32, 616, 224, 32, Trans.(:load), lambda { Core.load_game })) @w.add(:options, Button.new(32, 680, 224, 32, Trans.(:options), lambda {})) end |
Instance Method Details
#draw ⇒ Object
27 28 29 30 31 |
# File 'lib/states/menus/ingame.rb', line 27 def draw @background.draw(0, 0, 0) @w.draw draw_cursor end |
#update ⇒ Object
20 21 22 23 24 25 26 |
# File 'lib/states/menus/ingame.rb', line 20 def update if @window.pressed?(Gosu::KbEscape) or @w.remove? @window.load end update_cursor @w.update end |