Class: Ruby2D::Window::GamepadEvents::GamepadButtonData

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#buttonObject

Returns the value of attribute button

Returns:

  • (Object)

    the current value of button



21
22
23
# File 'lib/ruby2d/window/gamepad_events.rb', line 21

def button
  @button
end

#gamepadObject

Returns the value of attribute gamepad

Returns:

  • (Object)

    the current value of gamepad



21
22
23
# File 'lib/ruby2d/window/gamepad_events.rb', line 21

def gamepad
  @gamepad
end

Instance Method Details

#button?(name) ⇒ Boolean

Returns:

  • (Boolean)


23
# File 'lib/ruby2d/window/gamepad_events.rb', line 23

def button?(name)   = button == name

#gamepad?(other) ⇒ Boolean

Returns:

  • (Boolean)


22
# File 'lib/ruby2d/window/gamepad_events.rb', line 22

def gamepad?(other) = gamepad.equal?(other)