首页 > 解决方案 > 返回 windows 桌面 MonoGame 时的错误

问题描述

我已经为 Windows 创建了一个 monogame 项目,但是当我使用 alt + tab 返回 Windows 桌面时,游戏屏幕变为白色并且图标消失。

我只将屏幕尺寸更改为 1920 x 1080,fullscreen = true 和 Windows.title = "The Last Dragon"

public Game1()
{
    graphics = new GraphicsDeviceManager(this);
    Content.RootDirectory = "Content";
    graphics.PreferredBackBufferWidth = 1920;
    graphics.PreferredBackBufferHeight = 1080;
    graphics.IsFullScreen = true;
}
protected override void Initialize()
{
     // TODO: Add your initialization logic here
    this.Window.Title = "The Last Dragon";

    base.Initialize();
}

标签: c#windowsmonogame

解决方案


更改 GraphicsDeviceManager 的设置时,请始终确保应用这些更改。在你的情况下 graphics.ApplyChanges();


推荐阅读