Skip to content
Browse files

added a function to trigger basic full-screen support

  • Loading branch information...
1 parent 289486b commit 2c1e5dc790e74b1ebeeb2ccd28a677a640c00f10 @AdamAtomic committed Oct 16, 2011
Showing with 12 additions and 0 deletions.
  1. +12 −0 org/flixel/FlxG.as
View
12 org/flixel/FlxG.as
@@ -323,6 +323,18 @@ package org.flixel
}
/**
+ * 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.
*

0 comments on commit 2c1e5dc

Please sign in to comment.
Something went wrong with that request. Please try again.