public frmClient(ref BaseGame bg) { game = bg; Mouse.WindowHandle = this.Handle; InitializeComponent(); sKey = "";// System.Guid.NewGuid().ToString(); //this.FormBorderStyle = FormBorderStyle.None; //this.WindowState = FormWindowState.Maximized; // 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); game.Stopped += new Helper.Handlers.voidEH(game_Stopped); Application.Idle += new EventHandler(Application_Idle); }
private void AddXnaPanel(ref Game.BaseGame 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.Anchor = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top; this.XnaPanelMain.Dock = DockStyle.Fill; this.XnaPanelMain.Debug = false; this.XnaPanelMain.DebugPhysics = false; this.XnaPanelMain.DrawingEnabled = true; this.XnaPanelMain.Name = "XnaPanelMain"; this.XnaPanelMain.PhysicsEnabled = true; //RepositionXnaPanel(); 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.Controls.Add(this.XnaPanelMain); }
private void CreateGame() { game = new RoboGame(false); game.OtherClientConnectedToServer += new Helper.Handlers.ClientConnectedEH(game_ConnectedToServer); game.ThisClientDisconnectedFromServer += new Helper.Handlers.voidEH(game_ThisClientDiconnectedFromServer); }