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.



156
157
158
159
160
161
# File 'lib/mouse.rb', line 156

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.



155
156
157
# File 'lib/mouse.rb', line 155

def end_x
  @end_x
end

#end_yObject (readonly)

Returns the value of attribute end_y.



155
156
157
# File 'lib/mouse.rb', line 155

def end_y
  @end_y
end

#inprogressObject (readonly)

Returns the value of attribute inprogress.



155
156
157
# File 'lib/mouse.rb', line 155

def inprogress
  @inprogress
end

#start_xObject (readonly)

Returns the value of attribute start_x.



155
156
157
# File 'lib/mouse.rb', line 155

def start_x
  @start_x
end

#start_yObject (readonly)

Returns the value of attribute start_y.



155
156
157
# File 'lib/mouse.rb', line 155

def start_y
  @start_y
end

#startingObject (readonly)

Returns the value of attribute starting.



155
156
157
# File 'lib/mouse.rb', line 155

def starting
  @starting
end

Instance Method Details

#confirmStartObject



166
167
168
169
# File 'lib/mouse.rb', line 166

def confirmStart
  @starting = false
  @inprogress = true
end

#endObject



170
171
172
173
# File 'lib/mouse.rb', line 170

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

#startObject



162
163
164
165
# File 'lib/mouse.rb', line 162

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

#terminateObject



174
175
176
# File 'lib/mouse.rb', line 174

def terminate
  @inprogress, @starting = false
end