MouseCusor for GShape
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.
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.