love.mouse.newCursor
Available since LÖVE 0.9.0 |
This function is not supported in earlier versions. |
Creates a new hardware Cursor object.
Hardware cursors are framerate-independent and work the same way as normal operating system cursors. Unlike drawing an image at the mouse's current coordinates, hardware cursors never have visible lag between when the mouse is moved and when the cursor position updates, even at low framerates.
Contents
Function
Synopsis
cursor = love.mouse.newCursor( imageData, hotx, hoty )
Arguments
ImageData imageData
- The ImageData to use as a custom image for the new Cursor.
number hotx (0)
- The x-coordinate in the ImageData of the cursor's hot spot.
number hoty (0)
- The y-coordinate in the ImageData of the cursor's hot spot.
Returns
Cursor cursor
- The new Cursor object.
Notes
The hot spot is the point the operating system uses to determine what was clicked and at what position the mouse cursor is. For example, the normal arrow pointer normally has its hot spot at the top left of the image, but a crosshair cursor might have it in the middle.
Function
Synopsis
cursor = love.mouse.newCursor( ctype )
Arguments
CursorType ctype
- The type of cursor to create.
Returns
Cursor cursor
- The new Cursor object.
Notes
The CursorType "image" is not a valid argument. The other variant of this function is used to create a hardware cursor using a custom image.
See Also
Other Languages
Dansk –
Deutsch –
English –
Español –
Français –
Indonesia –
Italiano –
Lietuviškai –
Magyar –
Nederlands –
Polski –
Português –
Română –
Slovenský –
Suomi –
Svenska –
Türkçe –
Česky –
Ελληνικά –
Български –
Русский –
Српски –
Українська –
עברית –
ไทย –
日本語 –
正體中文 –
简体中文 –
Tiếng Việt –
한국어
More info