Class: Gosu::Button

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ Button

Returns a new instance of Button.



6
7
8
9
10
11
12
13
14
15
# File 'lib/gosu_android/input/input.rb', line 6

def initialize(*args)
  case args.length
  when 0
    @id = NoButton
  when 1
    @id = args[0]
  else
    raise ArgumentError
  end
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



5
6
7
# File 'lib/gosu_android/input/input.rb', line 5

def id
  @id
end

Instance Method Details

#<(other) ⇒ Object



26
27
28
# File 'lib/gosu_android/input/input.rb', line 26

def < other
  self.id < other.id
end

#==(other) ⇒ Object

Tests whether two Buttons identify the same physical button.



18
19
20
# File 'lib/gosu_android/input/input.rb', line 18

def == other
  self.id == other.id
end

#>(other) ⇒ Object



22
23
24
# File 'lib/gosu_android/input/input.rb', line 22

def > other
  self.id > other.id
end