Class: Core::Game::OSD::Magic

Inherits:
Core::GUI::Window show all
Defined in:
lib/game/osd/magic.rb

Instance Attribute Summary

Attributes inherited from Core::GUI::Window

#close, #h, #parent, #state, #w, #x, #xoff, #y, #yoff, #zoff

Instance Method Summary collapse

Methods inherited from Core::GUI::Window

#[], #add, #close!, #draw, #empty, #get, #include?, #remove?, #save_pos, #title=, #update

Constructor Details

#initialize(x, y, caster = Core::Game.party.player, target = nil) ⇒ Magic

Returns a new instance of Magic.



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/game/osd/magic.rb', line 6

def initialize(x, y, caster=Core::Game.party.player, target=nil)
  if x + 640 > 1024
    x = 386
  elsif x < 0
    x = 0
  end
  if y + 480 > 768
    y = 264
  elsif y < 0
    y = 0
  end
  super(x, y, 640, 480, Core::Trans.menu(:magic), true, "osd/magic_bg", true)
  @caster, @target = caster, target
  add(:char, Core::GUI::CharSelector.new(16, 16, @state.party))
end