Difference between revisions of "love.mouse.newCursor"

(Created page)
 
m (Added more description text)
Line 1: Line 1:
 
{{newin|[[0.9.0]]|090|type=function}}
 
{{newin|[[0.9.0]]|090|type=function}}
 
Creates a new hardware [[Cursor]] object.
 
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.
  
 
== Function ==
 
== Function ==

Revision as of 06:02, 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.

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