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

MouseCusor for GShape #36

Closed
imiskolee opened this issue Sep 21, 2021 · 1 comment
Closed

MouseCusor for GShape #36

imiskolee opened this issue Sep 21, 2021 · 1 comment
Labels
not an issue issue does not have any bug report or feature request, so it does not qualify as a valid issue.

Comments

@imiskolee
Copy link

Hi:

as well as we know, We can set different mouse cursor for a child widget on flutter use MouseRegion, and I am not sure how to apply set mouse cursor on Shape region.

a solution is :
#1. a Stage level mouse move event handler, and use hittest for check which child already hit, then change mouse cursor ?
#2. configure mouse curosr for a shape.

@roipeker
Copy link
Owner

Sorry for the super late reply.
As GraphX was originally made to emulate ActionScript API, the only automatic cursor change available from any DisplayObject is basic and click:

var someShape = GShape();
someShape.useCursor = true ;

You can always change the mouse (SystemMouseCursors) yourself though, you have 2 (manual) options in GraphX:

through the stage:
stage?.pointer?.cursor = SystemMouseCursors.resizeDown;

globally (the old AS3 way):
GMouse.cursor = SystemMouseCursors.copy;

So, if you need custom mouse while hovering a GShape you can do this:

theShape.onMouseOver.add((_) {
  GMouse.cursor=SystemMouseCursors.alias;
  theShape.onMouseOut.addOnce((_) => GMouse.basic());
});

Hope it helps.

@roipeker roipeker added the not an issue issue does not have any bug report or feature request, so it does not qualify as a valid issue. label Feb 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
not an issue issue does not have any bug report or feature request, so it does not qualify as a valid issue.
Projects
None yet
Development

No branches or pull requests

2 participants