Class: GGLib::MouseDragEvent

Inherits:
Object
  • Object
show all
Defined in:
lib/mouse.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeMouseDragEvent

Returns a new instance of MouseDragEvent.



40
41
42
43
44
45
# File 'lib/mouse.rb', line 40

def initialize
  @start_x, @start_y = 0
  @end_x, @end_y = 0
  @inprogress = false
  @starting = false
end

Instance Attribute Details

#end_xObject (readonly)

Returns the value of attribute end_x.



39
40
41
# File 'lib/mouse.rb', line 39

def end_x
  @end_x
end

#end_yObject (readonly)

Returns the value of attribute end_y.



39
40
41
# File 'lib/mouse.rb', line 39

def end_y
  @end_y
end

#inprogressObject (readonly)

Returns the value of attribute inprogress.



39
40
41
# File 'lib/mouse.rb', line 39

def inprogress
  @inprogress
end

#start_xObject (readonly)

Returns the value of attribute start_x.



39
40
41
# File 'lib/mouse.rb', line 39

def start_x
  @start_x
end

#start_yObject (readonly)

Returns the value of attribute start_y.



39
40
41
# File 'lib/mouse.rb', line 39

def start_y
  @start_y
end

#startingObject (readonly)

Returns the value of attribute starting.



39
40
41
# File 'lib/mouse.rb', line 39

def starting
  @starting
end

Instance Method Details

#confirmStartObject



50
51
52
53
# File 'lib/mouse.rb', line 50

def confirmStart
  @starting = false
  @inprogress = true
end

#endObject



54
55
56
57
# File 'lib/mouse.rb', line 54

def end
  @end_x, @end_y = $window.mouse_x, $window.mouse_y
  @inprogress = false
end

#startObject



46
47
48
49
# File 'lib/mouse.rb', line 46

def start
  @start_x, @start_y = $window.mouse_x, $window.mouse_y
  @starting = true
end

#terminateObject



58
59
60
# File 'lib/mouse.rb', line 58

def terminate
  @inprogress, @starting = false
end