Class: Rubygame::MouseUpEvent
- Defined in:
- lib/rubygame/event.rb,
ext/rubygame/rubygame_event.c
Overview
Indicates that a mouse button was released.
See MouseDownEvent.
Instance Attribute Summary collapse
-
#button ⇒ Object
Returns the value of attribute button.
-
#pos ⇒ Object
Returns the value of attribute pos.
-
#string ⇒ Object
Returns the value of attribute string.
Instance Method Summary collapse
-
#initialize(pos, button) ⇒ MouseUpEvent
constructor
A new instance of MouseUpEvent.
Constructor Details
#initialize(pos, button) ⇒ MouseUpEvent
Returns a new instance of MouseUpEvent.
188 189 190 191 192 193 194 195 196 197 198 199 200 201 |
# File 'lib/rubygame/event.rb', line 188 def initialize(pos,) @pos = pos if .kind_of? Integer @button = @string = Rubygame::Mouse::MOUSE2STR[] #a string or nil elsif key.kind_of? String @button = Rubygame::Mouse::STR2MOUSE[key] if @button != nil @string = else raise(ArgumentError,"First argument of MouseUpEvent.new() must be an Integer Mouse button indentifier (like MOUSE_LEFT) or a String (like \"left\"). Got %s (%s)"%[,.class]) end end end |
Instance Attribute Details
#button ⇒ Object
Returns the value of attribute button.
187 188 189 |
# File 'lib/rubygame/event.rb', line 187 def @button end |
#pos ⇒ Object
Returns the value of attribute pos.
187 188 189 |
# File 'lib/rubygame/event.rb', line 187 def pos @pos end |
#string ⇒ Object
Returns the value of attribute string.
187 188 189 |
# File 'lib/rubygame/event.rb', line 187 def string @string end |