[view] add fullscreen button

This commit is contained in:
2020-03-23 17:38:13 +03:00
parent ee84cdf508
commit a1402d2a04
4 changed files with 25 additions and 0 deletions

View File

@@ -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;
}
}