Class wl_cursor

A wl_cursor represents a given cursor state (loading, clicking etc) in a given cursor theme.

A wl_cursor is accessed through a wl_cursor_theme. You will access the wl_cursor_images from the cursor in question through the image property.

See also:

Fields

wl_cursor.image_count The number of images available
wl_cursor.image The images associated with the cursor
wl_cursor.name Name of the cursor

Methods

wl_cursor:frame (time) Find the frame for a given elapsed time in a cursor animation given time in the cursor animation
wl_cursor:frame_and_duration (time, duration) Find the frame for a given elapsed time in a cursor animation as well as the time left until next cursor change.


Fields

wl_cursor.image_count
The number of images available
wl_cursor.image
The images associated with the cursor
wl_cursor.name
Name of the cursor
  • string The name of the cursor.

Methods

wl_cursor:frame (time)
Find the frame for a given elapsed time in a cursor animation given time in the cursor animation

Parameters:

  • time integer Elapsed time in ms since the beginning of the animation

Returns:

    int The index of the image in the wl_cursor.image field that should be displayed for the given time in the cursor animation
wl_cursor:frame_and_duration (time, duration)
Find the frame for a given elapsed time in a cursor animation as well as the time left until next cursor change.

Parameters:

  • time integer Elapsed time in ms since the beginning of the animation
  • duration integer pointer to uint32_t to store time left for this image or zero if the cursor won't change.

Returns:

    int The index of the image in the wl_cursor.image field that should be displayed for the given time in the cursor animation
generated by LDoc 1.5.0 Last updated 2023-07-28 15:31:50