love.mouse.newCursor

Available since LÖVE 0.9.0
This function is not supported in earlier versions.

Creates a new hardware Cursor object.

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