2 using System.Collections.Generic;
4 using Microsoft.Xna.Framework;
5 using Microsoft.Xna.Framework.Audio;
6 using Microsoft.Xna.Framework.Content;
7 using Microsoft.Xna.Framework.GamerServices;
8 using Microsoft.Xna.Framework.Graphics;
9 using Microsoft.Xna.Framework.Input;
10 using Microsoft.Xna.Framework.Media;
11 using Microsoft.Xna.Framework.Net;
12 using Microsoft.Xna.Framework.Storage;
17 /// This is the main type for your game
19 public class Game1 : Microsoft.Xna.Framework.Game
21 GraphicsDeviceManager graphics;
22 SpriteBatch spriteBatch;
28 graphics = new GraphicsDeviceManager(this);
29 Content.RootDirectory = "Content";
30 Components.Add(new GamerServicesComponent(this));
34 /// Allows the game to perform any initialization it needs to before starting to run.
35 /// This is where it can query for any required services and load any non-graphic
36 /// related content. Calling base.Initialize will enumerate through any components
37 /// and initialize them as well.
39 protected override void Initialize()
41 // TODO: Add your initialization logic here
42 graphics.PreferredBackBufferWidth = 800;
43 graphics.PreferredBackBufferWidth = 600;
44 lbGui = new lobbyGUI();
49 /// LoadContent will be called once per game and is the place to load
50 /// all of your content.
52 protected override void LoadContent()
54 // Create a new SpriteBatch, which can be used to draw textures.
55 spriteBatch = new SpriteBatch(GraphicsDevice);
56 lbGui.LoadContent(Content, graphics);
61 /// UnloadContent will be called once per game and is the place to unload
64 protected override void UnloadContent()
66 // TODO: Unload any non ContentManager content here
70 /// Allows the game to run logic such as updating the world,
71 /// checking for collisions, gathering input, and playing audio.
73 /// <param name="gameTime">Provides a snapshot of timing values.</param>
74 protected override void Update(GameTime gameTime)
76 // Allows the game to exit
77 if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
80 // TODO: Add your update logic here
81 lbGui.Update(gameTime);
83 base.Update(gameTime);
87 /// This is called when the game should draw itself.
89 /// <param name="gameTime">Provides a snapshot of timing values.</param>
90 protected override void Draw(GameTime gameTime)
92 GraphicsDevice.Clear(Color.CornflowerBlue);
93 spriteBatch.Begin(SpriteBlendMode.AlphaBlend);
95 lbGui.Draw(spriteBatch);