c# - 返回 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();
}
解决方案
更改 GraphicsDeviceManager 的设置时,请始终确保应用这些更改。在你的情况下 graphics.ApplyChanges();
推荐阅读
- android - 如何从文件夹运行 ./gradlew 命令?
- c++ - 找不到 Visual Studio 2008 (Platform Toolset = 'v90') 的构建工具
- python - Python。构建exe
- c# - 如何删除数组中的所有匹配项并将剩余部分向左移动?
- react-native - 导航组件/屏幕是否必须卸载?
- javascript - 如何使用java脚本设置数据表超出第一页的行数据?
- c# - 如果 JSON 字符串具有未闭合的 html 标签,如何使用 AntiXss
- angular - Angular 7 性能
- javascript - 如何使用键值从 Firebase 检索数据
- c# - 将选定的下拉列表项显示到指定的 gridview 列中