You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Kinc already allows to change the mouse cursor to common system cursors, but currently there is no way to set a custom cursor image. Kha's cursor API allows something a la mouse.setSystemCursor(MouseCursor.Custom(myCustomImage)), but because it's not implemented in Kinc this currently only takes effect on html5 (and maybe on some less commonly used targets as well) as far as I can see. However, it should be possible to implement a similar functionality also for the Kinc backends.
Describe the solution you'd like
Some functionality to set a custom cursor image, similar to Kha's API. Two ideas how this could look like:
Two separate functions:
// This function already exists, no change in functionality hereKINC_FUNCvoidkinc_mouse_set_cursor(intcursor);
// Calling this function will overwrite the cursor image with a custom image,// calling kinc_mouse_set_cursor() would go back to a non-custom cursor image.KINC_FUNCvoidkinc_mouse_set_cursor_custom(kinc_image_t*image);
A unified function that behaves differently based on the first parameter (this would be a breaking change):
// If cursor == -1 (or a special define for -1 like KINC_CUSTOM_CURSOR), use the custom image, else ignore it.// E.g.// kinc_mouse_set_cursor(1, NULL);// kinc_mouse_set_cursor(KINC_CUSTOM_CURSOR, myImage);KINC_FUNCvoidkinc_mouse_set_cursor(intcursor, kinc_image_t*image);
Additional context
Kinc images have different formats and might be compressed, so the image data first needs to be converted to some representation that's understood by the individual system API's which probably complicates the implementation of this feature request a bit.
In the win32 API, I think the more common way of implementing this would not to be using loaded images, but instead resources embedded in the executable or some dll. However, this would likely require a completely different approach to the API, so I guess using Kinc images is the better approach. Luckily, using raw buffers seems to be perfectly possible, but I think they first need to be converted to bitmap objects.
At least on Windows you can specify custom cursor hot spot coordinates (that's the point in the cursor image that's aligned with the actual cursor position), integrating this into the Kinc API and eventually also to the Kha API would be a nice to have :)
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
Kinc already allows to change the mouse cursor to common system cursors, but currently there is no way to set a custom cursor image. Kha's cursor API allows something a la
mouse.setSystemCursor(MouseCursor.Custom(myCustomImage))
, but because it's not implemented in Kinc this currently only takes effect on html5 (and maybe on some less commonly used targets as well) as far as I can see. However, it should be possible to implement a similar functionality also for the Kinc backends.Describe the solution you'd like
Some functionality to set a custom cursor image, similar to Kha's API. Two ideas how this could look like:
Additional context
The text was updated successfully, but these errors were encountered: