2 Star 4 Fork 0

half_tree/FullLeafFramework:为MonoGame框架的游戏搭建增添内容

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
MainGame.cs 1.27 KB
一键复制 编辑 原始数据 按行查看 历史
half_tree 提交于 1年前 . Merge branch 'dev'
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
namespace full_leaf_framework;
public class MainGame : Game
{
private GraphicsDeviceManager graphics;
private SpriteBatch spriteBatch;
// 窗口尺寸
public static int SCREEN_WIDTH = 800;
public static int SCREEN_HEIGHT = 600;
public MainGame() {
graphics = new GraphicsDeviceManager(this)
{
PreferredBackBufferWidth = SCREEN_WIDTH,
PreferredBackBufferHeight = SCREEN_HEIGHT
};
graphics.ApplyChanges();
Content.RootDirectory = "Content";
IsMouseVisible = true;
}
protected override void Initialize() {
base.Initialize();
}
protected override void LoadContent() {
spriteBatch = new SpriteBatch(GraphicsDevice);
}
protected override void Update(GameTime gameTime) {
if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed || Keyboard.GetState().IsKeyDown(Keys.Escape))
Exit();
base.Update(gameTime);
}
protected override void Draw(GameTime gameTime) {
GraphicsDevice.Clear(Color.CornflowerBlue);
spriteBatch.Begin();
spriteBatch.End();
base.Draw(gameTime);
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C#
1
https://gitee.com/half_tree/full-leaf-framework.git
git@gitee.com:half_tree/full-leaf-framework.git
half_tree
full-leaf-framework
FullLeafFramework:为MonoGame框架的游戏搭建增添内容
master

搜索帮助