Skip to content

Commit 2c1e5dc

Browse files
committed
added a function to trigger basic full-screen support
1 parent 289486b commit 2c1e5dc

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

org/flixel/FlxG.as

+12
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,18 @@ package org.flixel
322322
_game._maxAccumulation = _game._step;
323323
}
324324

325+
/**
326+
* Switch to full-screen display.
327+
*/
328+
static public function fullscreen():void
329+
{
330+
FlxG.stage.displayState = "fullScreen";
331+
var fsw:uint = FlxG.width*FlxG.camera.zoom;
332+
var fsh:uint = FlxG.height*FlxG.camera.zoom;
333+
FlxG.camera.x = (FlxG.stage.fullScreenWidth - fsw)/2;
334+
FlxG.camera.y = (FlxG.stage.fullScreenHeight - fsh)/2;
335+
}
336+
325337
/**
326338
* Generates a random number. Deterministic, meaning safe
327339
* to use if you want to record replays in random environments.

0 commit comments

Comments
 (0)