Esempio n. 1
0
        public Client()
        {
            Mouse.WindowHandle = this.Handle;
            //Microsoft.Xna.Framework.Input.Keyboard.

            InitializeComponent();
            InitializeScene();
            sKey  = "";// System.Guid.NewGuid().ToString();
            iPort = (int)numLobbyPort.Value;
            tStatus.Start();
            btnDisconnect.Enabled = false;

            // Create an instance of the game
            game = new GameHelper.ExampleGame(false);
            //game.ClientDisconnected+=new Helper.Handlers.StringEH(game_ClientDisconnected);
            // Give the xna panel a reference to game.
            // Xna Panel will initialize the game with its graphicsDevice the moment it is ready.
            AddXnaPanel(ref game);
            Application.Idle += new EventHandler(Application_Idle);
        }
Esempio n. 2
0
 private void AddXnaPanel(ref GameHelper.GameBase game)
 {
     //
     // XnaPanelMain
     //
     this.XnaPanelMain = new XnaView.XnaPanel(ref game);
     //this.XnaPanelMain.Anchor = (System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Top                 | System.Windows.Forms.AnchorStyles.Bottom                | System.Windows.Forms.AnchorStyles.Left                     | System.Windows.Forms.AnchorStyles.Right);
     this.XnaPanelMain.Dock           = DockStyle.Fill;
     this.XnaPanelMain.Debug          = false;
     this.XnaPanelMain.DebugPhysics   = false;
     this.XnaPanelMain.DrawingEnabled = true;
     this.XnaPanelMain.Location       = new System.Drawing.Point(296, 3);
     this.XnaPanelMain.Name           = "XnaPanelMain";
     this.XnaPanelMain.PhysicsEnabled = true;
     this.XnaPanelMain.Size           = new System.Drawing.Size(596, 366);
     this.XnaPanelMain.TabIndex       = 46;
     this.XnaPanelMain.Text           = "XnaPanel";
     this.XnaPanelMain.MouseDown     += new System.Windows.Forms.MouseEventHandler(this.pnlMouseDown);
     this.XnaPanelMain.MouseEnter    += new System.EventHandler(this.pnlMouseEnter);
     this.XnaPanelMain.MouseMove     += new System.Windows.Forms.MouseEventHandler(this.pnlMouseMove);
     this.XnaPanelMain.MouseWheel    += new MouseEventHandler(XnaPanelMain_MouseWheel);
     this.spMain.Panel2.Controls.Add(this.XnaPanelMain);
     //this.Controls.Add(this.XnaPanelMain);
 }