Full Screen on Window Store App on 8.1 and 10

How do launch my game in full screen on WSA on Windows 8.1 or 10.

My set up.
Unity 5.1.2 or 5.2. Windows 10 + Visual Studio Community

  1. Create empty project.
  2. Build Windows Store App and launch in VS.
  3. Notice the game runs in Windowed and not full screen.

If you target Universal Windows 10 App, you can use this API - ApplicationView Class (Windows.UI.ViewManagement) - Windows UWP applications | Microsoft Learn, but overall you don’t have full control if your app should go fullscreen or not.

You can also use UnityEngine.Screen.SetResolution() API with fullscreen parameter set to true, but ultimately user can still get the application out of fullscreen - you cannot prevent it.

Or you can simply set Screen.fullScreen = true;

On the other hand, it seems that Microsoft wants Windows 10 games and apps to be able to run in windowed mode, so what you should probably do is add a ā€œfull screen on/offā€ button somewhere in your settings. Like in good old games :slight_smile:

You could maybe also make a screen blocking overlay, which says ā€œgo to full screenā€ (and a button that turns full screen on) if it’s not in full screen. But I’m not sure if Microsoft would approve this.

Hi,
Anyone integrate video interstitial ads which are released recently by Microsoft on windows 8.1 universal application?
if any one knows please reply to this one.

Is there any reason Unity doesn’t do this. Windows 10 Store games are now able to switch to full screen, like Fable Legends for example. It opens full screen window and then opens full screen, which I have tried to mimic what Fable Legends does, but it will always be small Window (or last set if already run previously) then switch to full window screen.

While I understand the logic behind what MS are trying to do, Unity 3D on the other hand is just making our lives harder.

There’s nothing preventing you from doing this in generated VS solution on startup:

ApplicationView.PreferredLaunchWindowingMode = ApplicationViewWindowingMode.FullScreen;

Let’s say, in App class constructor. It will make the app start up in fullscreen.

There’s one gotcha: if you have debugger attached, the window will still open up as windowed at first for a few seconds, while debugger is loading symbols and doing other stuff. That will not happen if you launch manually without a debugger.

But, wouldn’t it be nice for a check box in player settings that wrote that code for you! I prefer to see Unity be proactive in making simple things like this easier, rather than having to make changes to the code. Especially when one can simplay delete that and create from fresh.

I suppose it makes sense. I’ll see what we can do.

That would be great if something could be done.

Just out of curiosity, for the time being where in the generated D3D code do I stick what you suggested?

Inserting it as a first thing into Main function would do.

That’s why I asked and has anyone actually tried it? Because all I get is the ApplicationView is doesn’t exist in the current context.

I tried it. You need ā€œusing namespace Windows.UI.ViewManagementā€ - I thought VS would suggest you that.

It might do, just I am still getting the hang of VS. I spent most of my career in the Java space.

Anyway I did end up working it out, by googling it.

However, I ran into an issue that I can’t work out. If I modify the app.cs file and build from there I have no issues in it working in full screen, but if I rebuilt it from Unity the code is missing from the app.cs file. But it still compiles and runs in full screen mode as if the that snippet of code is there. This became problematic as I wanted to focus away from the full screen for now and couldn’t find how to bring it back to a window.

Is there some form of caching going on here that I may need to be aware of?

I actually don’t know, it might be the system remembering the application preference. You could do this to force it windowed:

ApplicationView.PreferredLaunchWindowingMode = ApplicationViewWindowingMode.PreferredLaunchViewSize;

I was thinking the same thing, so I made it a window while the game was running and then closed it down as normal behaviour is to then to open last window size. But it always opens full screen as if that code was being run to make it full screen.

I’ve experiemented with this recently, and found that all you really need to do is add:

ApplicationView.PreferredLaunchWindowingMode = ApplicationViewWindowingMode.FullScreen;

to app.xml.cs in the App() constructor.

this will launch in fullscreen mode; however, the user has the ability to change this and once it ā€˜has’ been changed, there is no simple way to force it back as this is controlled in the XAML front-end. You would need to use the bridge between Unity and XAML to provide an option in-game mode to switch it back if the user changes it. (which I have not done myself yet).

Not sure if this was directed at me or not, but I am not using the XAML compiling in any way shape or form.

You can switch to fullscreen at runtime using Screen.SetResolution unity API.

1 Like