Gamua / Starling-Framework

The Cross Platform Game Engine
http://www.starling-framework.org
Other
2.82k stars 821 forks source link

stage.nativeWindow.alwaysInFront = true; #1039

Closed king514jy closed 5 years ago

king514jy commented 5 years ago
stage.displayState = StageDisplayState.FULL_SCREEN;
stage.nativeWindow.alwaysInFront = true;
st = new Starling(StMain,stage);
st.start();

When I set the nativewindow property alwaysInFront, I get an error.

Error: Error #3780: Requested width of backbuffer is not in allowed range 32 to 2048. at flash.display3D::Context3D/configureBackBuffer() at starling.rendering::Painter/configureBackBuffer()[/Users/redge/Development/starling/starling/src/starling/rendering/Painter.as:248] at starling.core::Starling/updateViewPort()[/Users/redge/Development/starling/starling/src/starling/core/Starling.as:489] at starling.core::Starling/initialize()[/Users/redge/Development/starling/starling/src/starling/core/Starling.as:361] at starling.core::Starling/onContextCreated()[/Users/redge/Development/starling/starling/src/starling/core/Starling.as:601]

PrimaryFeather commented 5 years ago

What's the stage3D profile you're running the application in? The different profiles support differently sized back buffers.

Ideally, check Starling.context.maxBackBufferWidth/Height. What's the maximum size? Then start up Starling with the "auto" profile and check which profile is being used.

king514jy commented 5 years ago
stage.displayState = StageDisplayState.FULL_SCREEN;
stage.nativeWindow.alwaysInFront = true;
stage.focus = this;

var st3d:Stage3D = stage.stage3Ds[0];
st3d.addEventListener( Event.CONTEXT3D_CREATE, myContext3DHandler );
st3d.requestContext3D("auto",Context3DProfile.BASELINE_EXTENDED);

private function myContext3DHandler(e:flash.events.Event):void
{

    st = new Starling(StMain, stage,null,e.target as Stage3D);
    st.showStats = true;
    st.addEventListener(starling.events.Event.ROOT_CREATED, createComplete);
    st.start();
}

private function createComplete(e:starling.events.Event):void
{
    st.removeEventListener(starling.events.Event.ROOT_CREATED, createComplete);
    trace(Starling.context.maxBackBufferWidth);
    StMain(st.root).init();
}

[trace] 16384

When I set the nativewindow property alwaysInFront, I get an error. Error #2044: Unhandled ErrorEvent:. text=Error #3702: Context3D not available.

But if you don't set the nativewindow property alwaysInFront, you won't get an error.

PrimaryFeather commented 5 years ago

What's happening if you set that property later? E.g. after the context and Starling have already been successfully initiated?

Whatever the outcome, I'm afraid, though, that this is definitely nothing Starling can do anything about — it's a pure AIR issue. So you rather post it in the AIR Runtime Support tracker instead.

PrimaryFeather commented 5 years ago

Lacking any more information, and since this is clearly an AIR problem (best to be reported in the AIR Runtime Support tracker), I'll close this issue now.