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.cr

Instance Method Summary

Instance Method Detail

def down?(button : MouseButton) : Bool #

Returns true if the button is held down, false otherwise.


def position : Vector2 #

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.