Ejemplo n.º 1
0
        /// <summary>
        /// Handles any operations that need to occur after the graphics device has been reset.
        /// </summary>
        protected virtual void OnGraphicsDeviceReset()
        {
            SetSpriteScale();

            Vector2 newDisplaySize = new Vector2(GraphicsDevice.Viewport.Width, GraphicsDevice.Viewport.Height);
            DisplaySizeEventArgs displaySizeEventArgs = new DisplaySizeEventArgs(DisplaySize, newDisplaySize);

            DisplaySize   = newDisplaySize;
            DisplayCenter = new Vector2(DisplaySize.X / 2.0f, DisplaySize.Y / 2.0f);

            if (DisplaySizeChanged != null)
            {
                DisplaySizeChanged(this, displaySizeEventArgs);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Handles any operations that need to occur after the graphics device has been reset.
        /// </summary>
        protected virtual void OnGraphicsDeviceReset()
        {
            SetSpriteScale();

            Vector2 newDisplaySize = new Vector2(GraphicsDevice.Viewport.Width, GraphicsDevice.Viewport.Height);
            DisplaySizeEventArgs displaySizeEventArgs = new DisplaySizeEventArgs(DisplaySize, newDisplaySize);
            DisplaySize = newDisplaySize;
            DisplayCenter = new Vector2(DisplaySize.X / 2.0f, DisplaySize.Y / 2.0f);

            if (DisplaySizeChanged != null)
            {
                DisplaySizeChanged(this, displaySizeEventArgs);
            }
        }