我可能只是遗漏了一些东西但是当我尝试使用:System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width
或graphicsDevice.PresentationParameters.BackBufferWidth;
时,我无法使用这些内容。
我可能会遗漏在内容加载器上调用它们的东西:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Storage;
using Microsoft.Xna.Framework.Content;
答案 0 :(得分:1)
您可以使用GraphicsDeviceManager更改它。
public Game1()
{
graphics = new GraphicsDeviceManager(this);
graphics.PreferredBackBufferHeight = 1080; //Height
graphics.PreferredBackBufferWidth = 1920; //Width
graphics.IsFullScreen = true; //Fullscreen On/off
graphics.ApplyChanges(); //Execute Changes!!!IMPORTANT!!!
//if you want use/change the PresentationParameters.BackBufferWidth, you could do it with the GraphicsDevice which could be found in the GraphicsDeviceManager Class
graphics.GraphicsDevice.PresentationParameters.BackBufferWidth;
}