Exemplo n.º 1
0
 public MenuDemo()
 {
     graphics = new GraphicsDeviceManager(this);
     Content.RootDirectory = "DisplaySpring DemoContent";
     this.Components.Add(new GamerServicesComponent(this));
     updates = new UpdateEvent();
 }
Exemplo n.º 2
0
 public Game1()
 {
     graphics = new GraphicsDeviceManager(this);
     Window.AllowUserResizing = true;
     Content.RootDirectory = "Content";
     txtPos = new Vector2(5, 5);
     Window.ClientSizeChanged += new EventHandler<EventArgs>(Window_ClientSizeChanged);
     graphics.PreferredBackBufferHeight = 1000;
     graphics.PreferredBackBufferWidth = 1800;
     this.Components.Add(new GamerServicesComponent(this));
     updates = new UpdateEvent();
 }
Exemplo n.º 3
0
        /// <summary>
        /// Setup initial game values (such as setting the back buffer, etc...)
        /// </summary>
        /// <param name="graphics"></param>
        public static void Initialize(GraphicsDeviceManager graphics, UpdateEvent updates)
        {
            graphics.PreferredBackBufferWidth = (int)WorldWidth;
            graphics.PreferredBackBufferHeight = (int)WorldHeight;
            graphics.ApplyChanges();
            TitleSafeArea = graphics.GraphicsDevice.Viewport.TitleSafeArea;
            Controllers = new List<Controller>();
            Controllers.Add(new Controller(PlayerIndex.One, updates));
            Controllers.Add(new Controller(PlayerIndex.Two, updates));
            Controllers.Add(new Controller(PlayerIndex.Three, updates));
            Controllers.Add(new Controller(PlayerIndex.Four, updates));

            #if DEBUG
            PrimaryController = Controllers[1];
            #else
            PrimaryController = Controllers[0];
            #endif
        }
Exemplo n.º 4
0
 /// <summary>
 /// Create a new controller class
 /// </summary>
 public Controller(PlayerIndex currentPlayer, UpdateEvent update)
 {
     m_oldKeyboardState = new KeyboardState();
     m_oldGamePadState = new GamePadState();
     m_KeyboardState = new KeyboardState();
     m_GamePadState = new GamePadState();
     m_player = currentPlayer;
     update.AddEvent(Update);
 }