Class: Core::States::MagicMenu

Inherits:
State show all
Includes:
Core, GUI
Defined in:
lib/states/menus/magic.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

#window, #x, #y

Instance Method Summary collapse

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, previous, party) ⇒ MagicMenu

Returns a new instance of MagicMenu.



7
8
9
10
11
12
13
14
# File 'lib/states/menus/magic.rb', line 7

def initialize(window, previous, party)
  super(window)
  @previous = previous
  @party = party
  @background = Core.sprite("menu/ingame_background")
  @w = Core::GUI::Window.new(0, 0, 1024, 768, Trans.menu(:magic))
  @w.add(:charselect, CharSelector.new(32, 32, party))
end

Instance Method Details

#drawObject



24
25
26
27
28
# File 'lib/states/menus/magic.rb', line 24

def draw
  @background.draw(0, 0, 0)
  @w.draw
  draw_cursor
end

#updateObject



15
16
17
18
19
20
21
22
23
# File 'lib/states/menus/magic.rb', line 15

def update
  super
  if @window.pressed?(Gosu::KbEscape) or @w.remove?
    @window.advance(@previous)
  end
  @w.update
  if @w.get(:charselect).changed?
  end
end