Class: SDL2::Mouse::Cursor
- Inherits:
-
Object
- Object
- SDL2::Mouse::Cursor
- Defined in:
- mouse.c,
mouse.c
Overview
This class represents mouse cursor shape, and have some class-methods for a mouse cursor.
Class Method Summary collapse
-
.hide ⇒ nil
Hide the mouse cursor.
-
.show ⇒ nil
Show the mouse cursor.
-
.shown? ⇒ Boolean
Return true if the mouse cursor is shown.
-
.warp(window, x, y) ⇒ nil
Move the mouse cursor to the given position within the window.
-
.warp_globally(x, y) ⇒ nil
Move the mouse cursor to the given position within the desktop.
Class Method Details
.hide ⇒ nil
Hide the mouse cursor.
177 178 179 180 181 |
# File 'mouse.c', line 177
static VALUE Cursor_s_hide(VALUE self)
{
HANDLE_ERROR(SDL_ShowCursor(SDL_DISABLE));
return Qnil;
}
|
.show ⇒ nil
Show the mouse cursor.
167 168 169 170 171 |
# File 'mouse.c', line 167
static VALUE Cursor_s_show(VALUE self)
{
HANDLE_ERROR(SDL_ShowCursor(SDL_ENABLE));
return Qnil;
}
|
.shown? ⇒ Boolean
Return true if the mouse cursor is shown.
186 187 188 189 |
# File 'mouse.c', line 186
static VALUE Cursor_s_shown_p(VALUE self)
{
return INT2BOOL(HANDLE_ERROR(SDL_ShowCursor(SDL_QUERY)));
}
|
.warp(window, x, y) ⇒ nil
200 201 202 203 204 |
# File 'mouse.c', line 200
static VALUE Cursor_s_warp(VALUE self, VALUE window, VALUE x, VALUE y)
{
SDL_WarpMouseInWindow(Get_SDL_Window(window), NUM2INT(x), NUM2INT(y));
return Qnil;
}
|
.warp_globally(x, y) ⇒ nil
216 217 218 219 220 |
# File 'mouse.c', line 216
static VALUE Cursor_s_warp_globally(VALUE self, VALUE x, VALUE y)
{
SDL_WarpMouseGlobal(NUM2INT(x), NUM2INT(y));
return Qnil;
}
|