Class: Ruby2D::Window::MouseEvent

Inherits:
Struct
  • Object
show all
Defined in:
lib/ruby2d/window.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#button ⇒ Object

Returns the value of attribute button

Returns:

  • (Object) —

    the current value of button



9
10
11
# File 'lib/ruby2d/window.rb', line 9

def button
  @button
end

#delta_x ⇒ Object

Returns the value of attribute delta_x

Returns:

  • (Object) —

    the current value of delta_x



9
10
11
# File 'lib/ruby2d/window.rb', line 9

def delta_x
  @delta_x
end

#delta_y ⇒ Object

Returns the value of attribute delta_y

Returns:

  • (Object) —

    the current value of delta_y



9
10
11
# File 'lib/ruby2d/window.rb', line 9

def delta_y
  @delta_y
end

#direction ⇒ Object

Returns the value of attribute direction

Returns:

  • (Object) —

    the current value of direction



9
10
11
# File 'lib/ruby2d/window.rb', line 9

def direction
  @direction
end

#type ⇒ Object

Returns the value of attribute type

Returns:

  • (Object) —

    the current value of type



9
10
11
# File 'lib/ruby2d/window.rb', line 9

def type
  @type
end

#x ⇒ Object

Returns the value of attribute x

Returns:

  • (Object) —

    the current value of x



9
10
11
# File 'lib/ruby2d/window.rb', line 9

def x
  @x
end

#y ⇒ Object

Returns the value of attribute y

Returns:

  • (Object) —

    the current value of y



9
10
11
# File 'lib/ruby2d/window.rb', line 9

def y
  @y
end

Instance Method Details

#button?(name) ⇒ Boolean

Returns:

  • (Boolean)


10
# File 'lib/ruby2d/window.rb', line 10

def button?(name) = button == name

#delta ⇒ Object



12
# File 'lib/ruby2d/window.rb', line 12

def delta         = [delta_x, delta_y]

#position ⇒ Object



11
# File 'lib/ruby2d/window.rb', line 11

def position      = [x, y]