无边框窗口monogame

时间:2013-02-07 08:45:47

标签: xna monogame borderless

我正在尝试将XNA游戏移植到MonoGame。我只想针对Windows平台。 我想在无边框窗口中显示游戏。我这样做,在我的XNA游戏中:

private void SetForm()
    {
        Form myForm = (Form)Form.FromHandle(this.Window.Handle);
        myForm.Name = "WIPForm";            
        int width = 1024;
        int height = 768;           
        IntPtr auxptr = (this.Window.Handle);
        SafeNativeMethods.MoveWindow(
            (int)auxptr,
            0,
            0,
            Properties.Settings.Default.width,
            Properties.Settings.Default.height,
            1);
        myForm.FormBorderStyle = FormBorderStyle.None;
        myForm.SetBounds(0, 0, width, height);
    }

当我在monogame版本myForm = null中测试此代码时。 有没有办法在monogame版本中绘制无边框窗口?

1 个答案:

答案 0 :(得分:7)

在MonoGame游戏类的构造函数中:

组:

Window.IsBorderless = true;

按照: https://monogame.codeplex.com/discussions/432292

相关问题