module
Crame::Mouse
Overview
The Mouse module contains all the functions that allow you to use your mouse in
your game (mainly #down?, #pressed? and #released?).
Extended Modules
Defined in:
crame/mouse.crInstance Method Summary
-
#down?(button : MouseButton) : Bool
Returns
trueif thebuttonis held down,falseotherwise. -
#position : Vector2
Retuns the position of the mouse relative to the window.
-
#pressed?(button : MouseButton) : Bool
Returns
trueif thebuttonhas just been pressed,falseotherwise. -
#released?(button : MouseButton) : Bool
Returns
trueif thebuttonhas just been released,falseotherwise.
Instance Method Detail
Retuns the position of the mouse relative to the window.
NOTE If the mouse exits the window, this method returns the latest position registered before the mouse got out of the window.
def pressed?(button : MouseButton) : Bool
#
Returns true if the button has just been pressed, false otherwise.
def released?(button : MouseButton) : Bool
#
Returns true if the button has just been released, false otherwise.