Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Icons as mouse cursor #131

Closed
joehei opened this issue Jan 13, 2021 · 5 comments
Closed

Icons as mouse cursor #131

joehei opened this issue Jan 13, 2021 · 5 comments
Assignees

Comments

@joehei
Copy link

joehei commented Jan 13, 2021

Hi,

first of all, you have created a really cool lib, many thanks for that.

My question is, is there a easy way to convert any icon into a mouse cursor?

Cheers

@aalmiray aalmiray self-assigned this Jan 14, 2021
@aalmiray
Copy link
Collaborator

As far as I can tell this requires a subclass of https://openjfx.io/javadoc/11/javafx.graphics/javafx/scene/Cursor.html that can work with Ikon. There's no such class, yet. I hope that such class can be created, similar to https://openjfx.io/javadoc/11/javafx.graphics/javafx/scene/ImageCursor.html

@aalmiray
Copy link
Collaborator

Well the default constructor for javax.scene.Cursor is package private which means no additional subclasses can be made at this time. 😡

@joehei
Copy link
Author

joehei commented Jan 14, 2021

That is a great pity. That would have been a really cool feature.

Maybe it will work sometime in the future, however, thank you.

@aalmiray
Copy link
Collaborator

Indeed, there's no direct path to render an Ikon as a Cursor. However there may be a workaround: print the graphics of a FontIcon into an Image, pass that image to an ImageCursor, et voilà!

@joehei
Copy link
Author

joehei commented Jan 15, 2021

I will give it a try. Thanks.

@joehei joehei closed this as completed Jan 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants