代码拉取完成,页面将自动刷新
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);
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。