public override void Update(GameTime gameTime) { // Check if player Count has changed and update buttons if it has if (realPlayerCount != oldActivePlayersCount) { if (scrollbar != null) { scrollbar.Remove(); } buttonGrid.Clear(); AppendButtons(); buttonGrid.UpdateOrder(); } // Update oldActivePlayersCount oldActivePlayersCount = realPlayerCount; // Dynamic width/height Height.Set(20 + buttonGrid.GetTotalHeight(), 0); Width.Set(20 + buttonGrid.GetRowWidth(), 0); Left.Set(50 - MaxWidth.Pixels - Width.Pixels, 1); }