diff --git a/org/flixel/FlxG.as b/org/flixel/FlxG.as index 13da44f9..b9c50ce7 100755 --- a/org/flixel/FlxG.as +++ b/org/flixel/FlxG.as @@ -322,6 +322,18 @@ package org.flixel _game._maxAccumulation = _game._step; } + /** + * Switch to full-screen display. + */ + static public function fullscreen():void + { + FlxG.stage.displayState = "fullScreen"; + var fsw:uint = FlxG.width*FlxG.camera.zoom; + var fsh:uint = FlxG.height*FlxG.camera.zoom; + FlxG.camera.x = (FlxG.stage.fullScreenWidth - fsw)/2; + FlxG.camera.y = (FlxG.stage.fullScreenHeight - fsh)/2; + } + /** * Generates a random number. Deterministic, meaning safe * to use if you want to record replays in random environments.