0
我遇到了monogame問題。目前,我看像這樣的解決方案:我繼續在我的項目上工作禁用Windows 10重新縮放xna/monogame
public Game1()
{
graphics = new GraphicsDeviceManager(this);
Content.RootDirectory = "Content";
gameState = new GameState(All_Textures, AllSpritefontTexts, oldState, oldMouse); //All textures have a key, with as return: texture, starting point, clickarea
}
protected override void Initialize()
{
base.Initialize();
oldState = Keyboard.GetState();
oldMouse = Mouse.GetState();
IsMouseVisible = true; //You can see the cursor
//graphics.IsFullScreen = true; //DISABLED FOR DEVELOPING REASONS
graphics.PreferredBackBufferHeight = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Height; //Set xna resolution height to curr screen resolution
graphics.PreferredBackBufferWidth = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width; //Set xna resolution width to curr screen resolution
graphics.ApplyChanges();
}
有了這個,最近開始測試在其他計算機上我的比賽。很多電腦都有一個窗口10放大,就像在圖像中看到的一樣。
這會導致我的monogame圖像和spritefonts被放錯地方並且相互重疊,更不用說我生成的hitboxes了。我的問題是:'如何在monogame中以編程方式禁用此放大倍數?'
如果您需要更多的代碼,看看之前你能回答我的問題,我的整個應用程序可以在這裏找到https://github.com/FireStormHR/SeriousGaming