private void ClampMouse()
 {
     if (m_MousePos.X < 0)
     {
         m_MousePos.X = 0;
     }
     if (m_MousePos.Y < 0)
     {
         m_MousePos.Y = 0;
     }
     if (m_MousePos.X > GraphicsManager.Get().Width)
     {
         m_MousePos.X = GraphicsManager.Get().Width - GlobalDefines.iMouseCursorSize / 4;
     }
     if (m_MousePos.Y > GraphicsManager.Get().Height)
     {
         m_MousePos.Y = GraphicsManager.Get().Height - GlobalDefines.iMouseCursorSize / 4;
     }
 }
Beispiel #2
0
 public void SpawnGameObject(GameObject o)
 {
     o.Load();
     m_GameObjects.AddLast(o);
     GraphicsManager.Get().AddGameObject(o);
 }
Beispiel #3
0
 /// <summary>
 /// LoadContent will be called once per game and is the place to load
 /// all of your content.
 /// </summary>
 protected override void LoadContent()
 {
     GraphicsManager.Get().LoadContent();
     SoundManager.Get().LoadContent(Content);
 }
Beispiel #4
0
        /// <summary>
        /// This is called when the game should draw itself.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Draw(GameTime gameTime)
        {
            GraphicsManager.Get().Draw((float)gameTime.ElapsedGameTime.TotalSeconds);

            base.Draw(gameTime);
        }