Class: Core::GUI::Draggable

Inherits:
Element show all
Defined in:
lib/gui/draggable.rb

Instance Attribute Summary

Attributes inherited from Element

#h, #w, #x, #xoff, #y, #yoff, #zoff

Instance Method Summary collapse

Methods inherited from Element

#remove?

Constructor Details

#initialize(x, y, w, h, type, sprite) ⇒ Draggable

Returns a new instance of Draggable.



5
6
7
8
9
# File 'lib/gui/draggable.rb', line 5

def initialize(x, y, w, h, type, sprite)
  super(x, y, w, h)
  @type = type
  @sprite = sprite
end

Instance Method Details

#drawObject



13
14
15
# File 'lib/gui/draggable.rb', line 13

def draw
  @sprite.img.draw(@x, @y, Core::GUI_Z + 20, @w/@sprite.width, @h/@sprite.height)
end

#update(window) ⇒ Object



10
11
12
# File 'lib/gui/draggable.rb', line 10

def update(window)
  super
end