[view] add fullscreen button
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
package ru.m;
|
||||
|
||||
import flash.display.StageDisplayState;
|
||||
import flash.Lib;
|
||||
|
||||
enum abstract Platform(String) from String to String {
|
||||
var ANDROID = "android";
|
||||
var LINUX = "linux";
|
||||
@@ -48,4 +51,15 @@ class Device {
|
||||
return false;
|
||||
#end
|
||||
}
|
||||
|
||||
public static var fullScreenSupport(get, never):Bool;
|
||||
|
||||
public static function get_fullScreenSupport():Bool {
|
||||
return Lib.current.stage.allowsFullScreenInteractive;
|
||||
}
|
||||
|
||||
public static function toggleFullScreen():Void {
|
||||
Lib.current.stage.displayState = Lib.current.stage.displayState == StageDisplayState.NORMAL ?
|
||||
StageDisplayState.FULL_SCREEN_INTERACTIVE : StageDisplayState.NORMAL;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user