Exemple #1
0
        public static void Draw(SpriteBatch spriteBatch, Display display)
        {
            display.device.Clear(Color.Black);

            spriteBatch.Begin();

            spriteBatch.Draw(
                texture,
                display.Center,
                null,
                Color.White,
                0f,
                textureCenter,
                1f,
                SpriteEffects.None,
                0f
            );

            spriteBatch.End();
        }
Exemple #2
0
 public World(string name, Display display)
 {
     Name = name;
     screenWidth = display.Width;
     screenHeight = display.Height;
 }
Exemple #3
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            // Set options
            display = new Display(this, graphics, GraphicsDevice);
            display.Width = 1280;
            display.Height = 720;
            display.Fullscreen = false;
            display.WindowTitle = "Sandbox";
            display.ShowFrameRate = true;

            base.Initialize();
        }