我正在制作一个简单的游戏作为最终项目.它将在窗口中显示一个.bmp框架,我无意在游戏运行时调整窗口大小,所以我想修复窗口的大小.问题是当我运行在visual studio 2012中选择monogame游戏创建的项目时,它以全屏模式启动.我尝试使用此代码修复它:
_graphics.IsFullScreen = false;
_graphics.PreferredBackBufferWidth = 640;
_graphics.PreferredBackBufferHeight = 480;
_graphics.Applychanges();
Run Code Online (Sandbox Code Playgroud)
我把它放在主游戏类的构造函数和初始化函数中,但它什么也没做.我正在使用monogame 3.0.
我看到这个答案正在研究解决我的问题/sf/answers/588498431/,但是,它仅适用于 stdscreen。我实现了这个:
#include <ncurses.h>
int main(void)
{
int i = 2, height, width;
WINDOW *new;
initscr();
getmaxyx(stdscr, height, width);
new = newwin(height - 2, width - 2, 1, 1);
scrollok(new,TRUE);
while(1)
{
mvwprintw(new, i, 2, "%d - lots and lots of lines flowing down the terminal", i);
++i;
wrefresh(new);
}
endwin();
return 0;
}
Run Code Online (Sandbox Code Playgroud)
但它不滚动。怎么了?