Difference between revisions of "love.mouse.newCursor"
m (Added the new object notice) |
m |
||
Line 29: | Line 29: | ||
{{param|Cursor|cursor|The new Cursor object.}} | {{param|Cursor|cursor|The new Cursor object.}} | ||
=== Notes === | === Notes === | ||
− | The | + | The "image" CursorType is not a valid argument. Use the other variant of this function to create a hardware cursor using a custom image. |
== See Also == | == See Also == |
Revision as of 07:28, 26 August 2013
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.
This function can be slow if it is called repeatedly, such as from love.update or love.draw. If you need to use a specific resource often, create it once and store it somewhere it can be reused! |
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 "image" CursorType is not a valid argument. Use the other variant of this function 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