fix!: Game.mouseCursor and Game.overlays can now be safely set during onLoad (#1498)

This commit is contained in:
Pasha Stetsenko
2022-05-20 12:49:29 -07:00
committed by GitHub
parent d67065e52d
commit 821d01c3fa
6 changed files with 274 additions and 275 deletions

View File

@ -46,12 +46,12 @@ class MouseCursorExample extends FlameGame with MouseMovementDetector {
if (hovering) {
if (!onTarget) {
//Entered
mouseCursor.value = SystemMouseCursors.grab;
mouseCursor = SystemMouseCursors.grab;
}
} else {
if (onTarget) {
// Exited
mouseCursor.value = SystemMouseCursors.move;
mouseCursor = SystemMouseCursors.move;
}
}
onTarget = hovering;