Example #1
0
        protected void Window_ClientSizeChanged(object sender, EventArgs e)
        {
            Core.WindowSize = new Rectangle(0, 0, Window.ClientBounds.Width, Window.ClientBounds.Height);

            if (Core.CurrentScreen != null)
            {
                Core.CurrentScreen.SizeChanged();
                Screen.TextBox.PositionY = Core.WindowSize.Height - 160f;
            }
            BaseNetworkPlayer.ScreenRegionChanged();
        }
Example #2
0
        /// <summary>
        /// Internal method to add a player in the players list.
        /// </summary>
        /// <param name="player">The player to add</param>
        /// <param name="playerId">The assigned player id</param>
        protected void InternalAddPlayer(BaseNetworkPlayer player, int playerId)
        {
            this.lastPlayerId = Math.Max(this.lastPlayerId, playerId + 1);

            this.playersInRoom.Add(playerId, player);

            this.RefreshMasterClientId();

            player.Id   = playerId;
            player.Room = this;
        }
        private static void ToggleFullScreen()
        {
            if (Core.GraphicsManager.IsFullScreen == false)
            {
                if (GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width != System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width ||
                    GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Height != System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height)
                {
                    Core.GraphicsManager.PreferredBackBufferWidth  = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width;
                    Core.GraphicsManager.PreferredBackBufferHeight = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height;
                    Core.WindowSize = new Rectangle(0, 0, System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width, System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height);
                }
                else
                {
                    Core.GraphicsManager.PreferredBackBufferWidth  = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width;
                    Core.GraphicsManager.PreferredBackBufferHeight = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Height;
                    Core.WindowSize = new Rectangle(0, 0, GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width, GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Height);
                }

                //System.Windows.Forms.Application.VisualStyleState = Windows.Forms.VisualStyles.VisualStyleState.ClientAndNonClientAreasEnabled;

                Core.GraphicsManager.ToggleFullScreen();

                Core.GameMessage.ShowMessage(Localization.GetString("game_message_fullscreen_on"), 12, FontManager.MainFont, Color.White);
            }
            else
            {
                Core.GraphicsManager.PreferredBackBufferWidth  = 1200;
                Core.GraphicsManager.PreferredBackBufferHeight = 680;
                Core.WindowSize = new Rectangle(0, 0, 1200, 680);

                //System.Windows.Forms.Application.VisualStyleState = Windows.Forms.VisualStyles.VisualStyleState.ClientAndNonClientAreasEnabled;

                Core.GraphicsManager.ToggleFullScreen();

                Core.GameMessage.ShowMessage(Localization.GetString("game_message_fullscreen_off"), 12, FontManager.MainFont, Color.White);
            }

            Core.GraphicsManager.ApplyChanges();
            BaseNetworkPlayer.ScreenRegionChanged();
        }
Example #4
0
 private void DGame_Deactivated(object sender, EventArgs e)
 {
     BaseNetworkPlayer.ScreenRegionChanged();
 }
Example #5
0
        /// <summary>
        /// Internal method to add a player in the players list.
        /// </summary>
        /// <param name="player">The player to add</param>
        protected void InternalAddPlayer(BaseNetworkPlayer player)
        {
            var playerId = this.lastPlayerId++;

            this.InternalAddPlayer(player, playerId);
        }