Thursday, July 18, 2013

Hide Flixel Mouse and Show System Cursor

I combine my Flixel games with a UI layer on TOP of the Flixel Game Sprite. Because of this, it is necessary to use the system cursor, so that the UI layer is not drawn on top of my cursor. One way to do it: myFlxGameInstance.useSystemCursor = true; //set to true to make sure FlxG does not undo your changes when you switch states. FlxG.mouse.hide(); //Hide the Flixel mouse. flash.ui.Mouse.show(); //Show the standard system cursor Or: You can specify to use the system cursor in the constructor of your FlxGame instance. But if for some reason you want to change things later. The above is how you would do it.

No comments:

Post a Comment