sharing the code
stage.align = StageAlign.TOP_LEFT;
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.displayState = StageDisplayState.NORMAL;
if (Application.isSupported) {
Application.service.display.setDisplayMode(DisplayMode.IMMERSIVE, LayoutMode.CUTOUT_SHORT_EDGES);
Application.service.setStage(stage);
screenWidth = Application.service.display.displayMetrics.screenWidth;
screenHeight = Application.service.display.displayMetrics.screenHeight;
}
private function onStageActive(e:flash.events.Event):void {
star.start();
if (stage) stage.quality = stage.quality;
}
private function onStageDeactivate(e:flash.events.Event):void {
star.stop(true);
}
NativeApplication.nativeApplication.addEventListener(flash.events.Event.ACTIVATE, onStageActive);
NativeApplication.nativeApplication.addEventListener(flash.events.Event.DEACTIVATE, onStageDeactivate);
Texture.asyncBitmapUploadEnabled = SystemUtil.isIOS;
//Starling.multitouchEnabled = true;
star = new Starling(Game, stage, viewPort, null, "auto", ["baselineExtended", "baseline"]);
CONFIG::DEV{
star.showStats = true;
}
star.supportHighResolutions = true;
star.skipUnchangedFrames = true;
star.antiAliasing = 1;
star.addEventListener(starling.events.Event.ROOT_CREATED, onRootCreated);
star.start();