Beispiel #1
0
        private float zoomStep, panStep; // Snelheid van SpriteManager.Camera

        #endregion Fields

        #region Constructors

        public Game1(MPSForm form)
        {
            this.form = form;
            System.Windows.Forms.Form xnaWindow = (System.Windows.Forms.Form)System.Windows.Forms.Control.FromHandle((Window.Handle));
            xnaWindow.GotFocus += xnaWindow_GotFocus;
            form.Panel.Resize += Panel_Resize;
            graphics = new GraphicsDeviceManager(this);
            graphics.PreparingDeviceSettings += graphics_PreparingDeviceSettings;
            graphics.PreferredBackBufferWidth = form.Panel.Width;
            graphics.PreferredBackBufferHeight = form.Panel.Height;
            Content.RootDirectory = "Content";
        }
Beispiel #2
0
 static void Main()
 {
     Application.EnableVisualStyles();
     MPSForm form = new MPSForm();
     form.Disposed += form_Disposed;
     using (game = new Game1(form))
     {
         form.Show();
         form.TopMost = true;
         game.Run();
     }
 }