Module: Mouse
- Defined in:
- docs/00000_Dependencies.rb
Overview
The buttons of the mouse are : :LEFT, :MIDDLE, :RIGHT, :X1, :X2
Constant Summary collapse
- BUTTON_MAPPING =
Mapping between button & symbols
{Sf::Mouse::LEFT => :LEFT, Sf::Mouse::RIGHT => :RIGHT, Sf::Mouse::Middle => :MIDDLE, Sf::Mouse::XButton1 => :X1, Sf::Mouse::XButton2 => :X2}
- BUTTON_ALIAS =
List of alias button
{left: :LEFT, right: :RIGHT, middle: :MIDDLE}
Class Attribute Summary collapse
-
.moved ⇒ Boolean
readonly
Get if the mouse moved since last frame.
-
.wheel ⇒ Integer
Mouse wheel position.
-
.wheel_delta ⇒ Integer
readonly
Mouse wheel delta.
-
.x ⇒ Integer
readonly
Get the mouse x position.
-
.y ⇒ Integer
readonly
Get the mouse y position.
Class Method Summary collapse
-
.in? ⇒ Boolean
Tell if the mouse is in the screen.
-
.press?(button) ⇒ Boolean
Tell if a button is pressed on the mouse.
-
.register_events(window)
Register event related to the mouse.
-
.released?(button) ⇒ Boolean
Tell if a button was released on the mouse.
-
.swap_states
Swap the state of the mouse.
-
.trigger?(button) ⇒ Boolean
Tell if a button was triggered on the mouse.
Class Attribute Details
.moved ⇒ Boolean (readonly)
Get if the mouse moved since last frame
496 497 498 |
# File 'docs/00000_Dependencies.rb', line 496 def moved @moved end |
.wheel ⇒ Integer
Mouse wheel position
484 485 486 |
# File 'docs/00000_Dependencies.rb', line 484 def wheel @wheel end |
.wheel_delta ⇒ Integer (readonly)
Mouse wheel delta
487 488 489 |
# File 'docs/00000_Dependencies.rb', line 487 def wheel_delta @wheel_delta end |
.x ⇒ Integer (readonly)
Get the mouse x position
490 491 492 |
# File 'docs/00000_Dependencies.rb', line 490 def x @x end |
.y ⇒ Integer (readonly)
Get the mouse y position
493 494 495 |
# File 'docs/00000_Dependencies.rb', line 493 def y @y end |
Class Method Details
.in? ⇒ Boolean
Tell if the mouse is in the screen
514 515 |
# File 'docs/00000_Dependencies.rb', line 514 def in? end |
.press?(button) ⇒ Boolean
Tell if a button is pressed on the mouse
500 501 |
# File 'docs/00000_Dependencies.rb', line 500 def press?() end |
.register_events(window)
Register event related to the mouse
521 522 |
# File 'docs/00000_Dependencies.rb', line 521 def register_events(window) end |
.released?(button) ⇒ Boolean
Tell if a button was released on the mouse
510 511 |
# File 'docs/00000_Dependencies.rb', line 510 def released?() end |
.swap_states
Swap the state of the mouse
517 518 |
# File 'docs/00000_Dependencies.rb', line 517 def swap_states end |
.trigger?(button) ⇒ Boolean
Tell if a button was triggered on the mouse
505 506 |
# File 'docs/00000_Dependencies.rb', line 505 def trigger?() end |