XNA Window Resize Invokes LoadContent

天大地大妈咪最大 提交于 2019-12-06 14:26:18

To stop the user resizing your window too much, set the MinimumSize property on the form associated with the game window.

Add the following references to your project:

System.Drawing
System.Windows.Forms

Add constants for your desired minimum size:

const int MIN_SIZE_X = 300;
const int MIN_SIZE_Y = MIN_SIZE_X;

Add the following to your constructor or Initialize function.

System.Windows.Forms.Form.FromHandle(Window.Handle).MinimumSize = new System.Drawing.Size(MIN_SIZE_X, MIN_SIZE_Y);
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!