Example #1
0
 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.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.KeyDown        += new KeyEventHandler(XnaPanelMain_KeyDown);
     this.XnaPanelMain.KeyUp          += new KeyEventHandler(XnaPanelMain_KeyUp);
     this.XnaPanelMain.MouseDown      += new MouseEventHandler(XnaPanelMain_MouseDown);
     this.XnaPanelMain.MouseEnter     += new EventHandler(XnaPanelMain_MouseEnter);
     this.XnaPanelMain.MouseMove      += new MouseEventHandler(XnaPanelMain_MouseMove);
     this.XnaPanelMain.PreviewKeyDown += new PreviewKeyDownEventHandler(XnaPanelMain_PreviewKeyDown);
     this.spMain.Panel2.Controls.Add(this.XnaPanelMain);
     //this.Controls.Add(this.XnaPanelMain);
 }
Example #2
0
 public XnaPanel(ref Game.BaseGame g)
 {
     pl = new PointLight();
     game = g;
     PhysicsSystem = g.physicsManager.PhysicsSystem;
     gameObjects = g.gameObjects;
     newObjects = g.objectsToAdd;
 }
Example #3
0
 public XnaPanel(ref Game.BaseGame g)
 {
     pl            = new PointLight();
     game          = g;
     PhysicsSystem = g.physicsManager.PhysicsSystem;
     gameObjects   = g.gameObjects;
     newObjects    = g.objectsToAdd;
 }
Example #4
0
        public Server()
        {
            InitializeComponent();
            iLobbyPort = (int)numLobbyPort.Value;
            iBasePort = (int)numBasePort.Value;
            btnStopServer.Enabled = false;

            game = new RoboGame.RoboGame(true);
            game.ClientConnected += new Helper.Handlers.IntStringEH(game_ClientConnected);
            AddXnaPanel(ref game);

            bool autoStart = false;
            bool autoMinimize = false;
            if (autoStart)
                StartServer();

            if (autoMinimize)
                this.WindowState = FormWindowState.Minimized;
        }
Example #5
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 Game.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);
        }
Example #6
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 Game.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);
        }
Example #7
0
        public Server()
        {
            InitializeComponent();
            iLobbyPort            = (int)numLobbyPort.Value;
            iBasePort             = (int)numBasePort.Value;
            btnStopServer.Enabled = false;

            game = new RoboGame.RoboGame(true);
            game.ClientConnected += new Helper.Handlers.IntStringEH(game_ClientConnected);
            AddXnaPanel(ref game);

            bool autoStart    = false;
            bool autoMinimize = false;

            if (autoStart)
            {
                StartServer();
            }

            if (autoMinimize)
            {
                this.WindowState = FormWindowState.Minimized;
            }
        }