Fullscreen issue


in my project xml I have

</window width="3840" height="2160" orientation="landscape" fps="60" background="0xff0000" vsync="true" antialiasing="4" if="cpp/>

How can I scale the stage in developement to fullscreen on my small HD screen? I tried:

stage.align = StageAlign.TOP_LEFT;
stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE;
trace(Capabilities.screenResolutionX, Capabilities.screenResolutionY, Capabilities.screenDPI);


Lib.application.window.resize(1920, 1080);

the stage stays unscaled? why?



This looks like it is a regression in the recent release versions, since the Context3D refactor. We’ll try and look at this and dev and resolve it. In the meantime, openfl test html5 -Dcanvas appears to scale alright, and openfl test cpp -Dcairo might work for you. This doesn’t test the OpenGL renderer, but does test a window this large

thanks, the scaling of the native stage is OK, but I got Stage3d Context error when using starling. without the -dcairo the starling content is rendered, the scaling is gone.

by the way, where can I find some docs of these flags, /run/build/update/ although the whole cpp/window/neko. when to make a -clean build…

no ideas to have both scaling and 3d context in cpp & html5?

This is fixed in dev, so long as you also do <window resizable="false" />

When resizable is true, we dispatch stage resize events, and expect the application to handle the scaling itself. When false, the dev version properly restores our default behavior to scale and letterbox the content

what means dev? Should I update something.

Oh, by dev, I mean using OpenFL from Github: https://github.com/openfl/openfl :slight_smile:

thanks, works now and learned a lot about openfl.

now I’m lost in transformation.

I did the 4k classic stage and scaled it, works great.

if (jsonObject.fullscreen == true) {
			stage.scaleMode = StageScaleMode.SHOW_ALL; // NO_SCALE;
			var display = stage.window.display;
			stage.align = StageAlign.TOP_LEFT;
			stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE;


then I added _starling with a centered 4K TouchSprite from the demo:

var _sheet2:TouchSheet = new TouchSheet(_sprite2);
_sheet2.x = 1920;
_sheet2.y = 1080;

after starting _starling I did the resizing with a little delay, to see the difference.

haxe.Timer.delay(function () {
}, 2000);

here’s the resizing, works in 4k and HD target resolution. classic stage an the 4k image centered on the stage.

private function onResize(?e:openfl.events.Event):Void {
		var viewPort:Rectangle = RectangleUtil.fit( new Rectangle(0, 0, Constants.GameWidth, Constants.GameHeight), new Rectangle(0, 0, Capabilities.screenResolutionX, Capabilities.screenResolutionY));
		try {
			this._starling.viewPort = viewPort;
		} catch (error:Error) {}


when touching the starling sheet in HD it moves twice the distance I move the mouse. why?

1 Like

Let me look at using Stage3D resized, and see how it interacts with the new code, maybe a bug