From 8711ab1cf70ca244fe8c0dcc0c298daa000d6a1b Mon Sep 17 00:00:00 2001 From: Victor Chelaru Date: Wed, 4 Nov 2026 06:10:30 -0700 Subject: [PATCH 1/2] Bump Gum to 2026.11.2.1 --- .../DungeonSlime/DungeonSlime.csproj | 2 +- .../20-Implementing-UI-With-Gum/DungeonSlime/Game1.cs | 5 ++--- .../DungeonSlime/Scenes/GameScene.cs | 7 ++++--- .../DungeonSlime/Scenes/TitleScene.cs | 1 - .../DungeonSlime/DungeonSlime.csproj | 2 +- .../src/21-Customizing-Gum-UI/DungeonSlime/Game1.cs | 5 ++--- .../DungeonSlime/Scenes/GameScene.cs | 1 - .../DungeonSlime/Scenes/TitleScene.cs | 1 - .../DungeonSlime/UI/AnimatedButton.cs | 4 ++-- .../DungeonSlime/UI/OptionsSlider.cs | 10 ++++++---- .../DungeonSlime/DungeonSlime.csproj | 2 +- .../src/22-Snake-Game-Mechanics/DungeonSlime/Game1.cs | 5 ++--- .../DungeonSlime/Scenes/GameScene.cs | 1 - .../DungeonSlime/Scenes/TitleScene.cs | 1 - .../DungeonSlime/UI/AnimatedButton.cs | 4 ++-- .../DungeonSlime/UI/OptionsSlider.cs | 10 ++++++---- .../DungeonSlime/DungeonSlime.csproj | 2 +- .../src/23-Completing-The-Game/DungeonSlime/Game1.cs | 5 ++--- .../DungeonSlime/Scenes/GameScene.cs | 1 - .../DungeonSlime/Scenes/TitleScene.cs | 1 - .../DungeonSlime/UI/AnimatedButton.cs | 4 ++-- .../DungeonSlime/UI/GameSceneUI.cs | 1 - .../DungeonSlime/UI/OptionsSlider.cs | 10 ++++++---- .../src/24-Shaders/DungeonSlime/DungeonSlime.csproj | 2 +- .../src/24-Shaders/DungeonSlime/Game1.cs | 5 ++--- .../src/24-Shaders/DungeonSlime/Scenes/GameScene.cs | 1 - .../src/24-Shaders/DungeonSlime/Scenes/TitleScene.cs | 1 - .../src/24-Shaders/DungeonSlime/UI/AnimatedButton.cs | 4 ++-- .../src/24-Shaders/DungeonSlime/UI/GameSceneUI.cs | 1 - .../src/24-Shaders/DungeonSlime/UI/OptionsSlider.cs | 10 ++++++---- .../25-Packaging-Game/DungeonSlime/DungeonSlime.csproj | 2 +- .../src/25-Packaging-Game/DungeonSlime/Game1.cs | 5 ++--- .../25-Packaging-Game/DungeonSlime/Scenes/GameScene.cs | 1 - .../DungeonSlime/Scenes/TitleScene.cs | 1 - .../DungeonSlime/UI/AnimatedButton.cs | 4 ++-- .../25-Packaging-Game/DungeonSlime/UI/GameSceneUI.cs | 1 - .../25-Packaging-Game/DungeonSlime/UI/OptionsSlider.cs | 10 ++++++---- .../DungeonSlime/DungeonSlime.csproj | 2 +- .../src/26-Publish-To-Itch/DungeonSlime/Game1.cs | 5 ++--- .../DungeonSlime/Scenes/GameScene.cs | 1 - .../DungeonSlime/Scenes/TitleScene.cs | 1 - .../DungeonSlime/UI/AnimatedButton.cs | 4 ++-- .../26-Publish-To-Itch/DungeonSlime/UI/GameSceneUI.cs | 1 - .../DungeonSlime/UI/OptionsSlider.cs | 10 ++++++---- .../src/27-Conclusion/DungeonSlime/DungeonSlime.csproj | 2 +- .../src/27-Conclusion/DungeonSlime/DungeonSlimeGame.cs | 1 - .../DungeonSlime/Platforms/Android/DungeonSlime.csproj | 2 +- .../DungeonSlime/Platforms/Desktop/DungeonSlime.csproj | 2 +- .../Platforms/Windows/DungeonSlime.WindowsDX.csproj | 2 +- .../src/27-Conclusion/DungeonSlime/Scenes/GameScene.cs | 1 - .../27-Conclusion/DungeonSlime/Scenes/TitleScene.cs | 1 - .../src/27-Conclusion/DungeonSlime/UI/GameSceneUI.cs | 1 - .../src/27-Conclusion/DungeonSlime/UI/OptionsSlider.cs | 10 ++++++---- 53 files changed, 83 insertions(+), 96 deletions(-) diff --git a/Tutorials/learn-monogame-2d/src/20-Implementing-UI-With-Gum/DungeonSlime/DungeonSlime.csproj b/Tutorials/learn-monogame-2d/src/20-Implementing-UI-With-Gum/DungeonSlime/DungeonSlime.csproj index fb7a95fd..105b0bf0 100644 --- a/Tutorials/learn-monogame-2d/src/20-Implementing-UI-With-Gum/DungeonSlime/DungeonSlime.csproj +++ b/Tutorials/learn-monogame-2d/src/20-Implementing-UI-With-Gum/DungeonSlime/DungeonSlime.csproj @@ -23,7 +23,7 @@ - + diff --git a/Tutorials/learn-monogame-2d/src/20-Implementing-UI-With-Gum/DungeonSlime/Game1.cs b/Tutorials/learn-monogame-2d/src/20-Implementing-UI-With-Gum/DungeonSlime/Game1.cs index 552a1790..514ab0da 100644 --- a/Tutorials/learn-monogame-2d/src/20-Implementing-UI-With-Gum/DungeonSlime/Game1.cs +++ b/Tutorials/learn-monogame-2d/src/20-Implementing-UI-With-Gum/DungeonSlime/Game1.cs @@ -1,7 +1,6 @@ using DungeonSlime.Scenes; using Microsoft.Xna.Framework.Media; using MonoGameLibrary; -using MonoGameGum; using Gum.Forms; using Gum.Forms.Controls; @@ -49,12 +48,12 @@ private void InitializeGum() // Customize the tab reverse UI navigation to also trigger when the keyboard // Up arrow key is pushed. FrameworkElement.TabReverseKeyCombos.Add( - new KeyCombo() { PushedKey = Microsoft.Xna.Framework.Input.Keys.Up }); + new KeyCombo() { PushedKey = Gum.Forms.Input.Keys.Up }); // Customize the tab UI navigation to also trigger when the keyboard // Down arrow key is pushed. FrameworkElement.TabKeyCombos.Add( - new KeyCombo() { PushedKey = Microsoft.Xna.Framework.Input.Keys.Down }); + new KeyCombo() { PushedKey = Gum.Forms.Input.Keys.Down }); // The assets created for the UI were done so at 1/4th the size to keep the size of the // texture atlas small. So we will set the default canvas size to be 1/4th the size of diff --git a/Tutorials/learn-monogame-2d/src/20-Implementing-UI-With-Gum/DungeonSlime/Scenes/GameScene.cs b/Tutorials/learn-monogame-2d/src/20-Implementing-UI-With-Gum/DungeonSlime/Scenes/GameScene.cs index 84e836e8..aa3ee14d 100644 --- a/Tutorials/learn-monogame-2d/src/20-Implementing-UI-With-Gum/DungeonSlime/Scenes/GameScene.cs +++ b/Tutorials/learn-monogame-2d/src/20-Implementing-UI-With-Gum/DungeonSlime/Scenes/GameScene.cs @@ -6,7 +6,6 @@ using Microsoft.Xna.Framework.Audio; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input; -using MonoGameGum; using Gum.GueDeriving; using MonoGameLibrary; using MonoGameLibrary.Graphics; @@ -151,9 +150,11 @@ private void CreatePausePanel() _pausePanel.IsVisible = false; _pausePanel.AddToRoot(); - var background = new Gum.GueDeriving.ColoredRectangleRuntime(); + var background = new Gum.GueDeriving.RectangleRuntime(); + background.IsFilled = true; + background.StrokeWidth = 0; background.Dock(Dock.Fill); - background.Color = Color.DarkBlue; + background.FillColor = Color.DarkBlue; _pausePanel.AddChild(background); var textInstance = new Gum.GueDeriving.TextRuntime(); diff --git a/Tutorials/learn-monogame-2d/src/20-Implementing-UI-With-Gum/DungeonSlime/Scenes/TitleScene.cs b/Tutorials/learn-monogame-2d/src/20-Implementing-UI-With-Gum/DungeonSlime/Scenes/TitleScene.cs index 849f0f10..bd4e6eea 100644 --- a/Tutorials/learn-monogame-2d/src/20-Implementing-UI-With-Gum/DungeonSlime/Scenes/TitleScene.cs +++ b/Tutorials/learn-monogame-2d/src/20-Implementing-UI-With-Gum/DungeonSlime/Scenes/TitleScene.cs @@ -4,7 +4,6 @@ using Microsoft.Xna.Framework.Audio; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input; -using MonoGameGum; using Gum.GueDeriving; using MonoGameLibrary; using MonoGameLibrary.Scenes; diff --git a/Tutorials/learn-monogame-2d/src/21-Customizing-Gum-UI/DungeonSlime/DungeonSlime.csproj b/Tutorials/learn-monogame-2d/src/21-Customizing-Gum-UI/DungeonSlime/DungeonSlime.csproj index fb7a95fd..105b0bf0 100644 --- a/Tutorials/learn-monogame-2d/src/21-Customizing-Gum-UI/DungeonSlime/DungeonSlime.csproj +++ b/Tutorials/learn-monogame-2d/src/21-Customizing-Gum-UI/DungeonSlime/DungeonSlime.csproj @@ -23,7 +23,7 @@ - + diff --git a/Tutorials/learn-monogame-2d/src/21-Customizing-Gum-UI/DungeonSlime/Game1.cs b/Tutorials/learn-monogame-2d/src/21-Customizing-Gum-UI/DungeonSlime/Game1.cs index 552a1790..514ab0da 100644 --- a/Tutorials/learn-monogame-2d/src/21-Customizing-Gum-UI/DungeonSlime/Game1.cs +++ b/Tutorials/learn-monogame-2d/src/21-Customizing-Gum-UI/DungeonSlime/Game1.cs @@ -1,7 +1,6 @@ using DungeonSlime.Scenes; using Microsoft.Xna.Framework.Media; using MonoGameLibrary; -using MonoGameGum; using Gum.Forms; using Gum.Forms.Controls; @@ -49,12 +48,12 @@ private void InitializeGum() // Customize the tab reverse UI navigation to also trigger when the keyboard // Up arrow key is pushed. FrameworkElement.TabReverseKeyCombos.Add( - new KeyCombo() { PushedKey = Microsoft.Xna.Framework.Input.Keys.Up }); + new KeyCombo() { PushedKey = Gum.Forms.Input.Keys.Up }); // Customize the tab UI navigation to also trigger when the keyboard // Down arrow key is pushed. FrameworkElement.TabKeyCombos.Add( - new KeyCombo() { PushedKey = Microsoft.Xna.Framework.Input.Keys.Down }); + new KeyCombo() { PushedKey = Gum.Forms.Input.Keys.Down }); // The assets created for the UI were done so at 1/4th the size to keep the size of the // texture atlas small. So we will set the default canvas size to be 1/4th the size of diff --git a/Tutorials/learn-monogame-2d/src/21-Customizing-Gum-UI/DungeonSlime/Scenes/GameScene.cs b/Tutorials/learn-monogame-2d/src/21-Customizing-Gum-UI/DungeonSlime/Scenes/GameScene.cs index 9a810866..4c9df69f 100644 --- a/Tutorials/learn-monogame-2d/src/21-Customizing-Gum-UI/DungeonSlime/Scenes/GameScene.cs +++ b/Tutorials/learn-monogame-2d/src/21-Customizing-Gum-UI/DungeonSlime/Scenes/GameScene.cs @@ -8,7 +8,6 @@ using Microsoft.Xna.Framework.Audio; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input; -using MonoGameGum; using Gum.GueDeriving; using MonoGameLibrary; using MonoGameLibrary.Graphics; diff --git a/Tutorials/learn-monogame-2d/src/21-Customizing-Gum-UI/DungeonSlime/Scenes/TitleScene.cs b/Tutorials/learn-monogame-2d/src/21-Customizing-Gum-UI/DungeonSlime/Scenes/TitleScene.cs index 057ac45f..11a3f3be 100644 --- a/Tutorials/learn-monogame-2d/src/21-Customizing-Gum-UI/DungeonSlime/Scenes/TitleScene.cs +++ b/Tutorials/learn-monogame-2d/src/21-Customizing-Gum-UI/DungeonSlime/Scenes/TitleScene.cs @@ -5,7 +5,6 @@ using Microsoft.Xna.Framework.Audio; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input; -using MonoGameGum; using Gum.GueDeriving; using MonoGameLibrary; using MonoGameLibrary.Graphics; diff --git a/Tutorials/learn-monogame-2d/src/21-Customizing-Gum-UI/DungeonSlime/UI/AnimatedButton.cs b/Tutorials/learn-monogame-2d/src/21-Customizing-Gum-UI/DungeonSlime/UI/AnimatedButton.cs index 13a4a485..9c12a2dd 100644 --- a/Tutorials/learn-monogame-2d/src/21-Customizing-Gum-UI/DungeonSlime/UI/AnimatedButton.cs +++ b/Tutorials/learn-monogame-2d/src/21-Customizing-Gum-UI/DungeonSlime/UI/AnimatedButton.cs @@ -141,12 +141,12 @@ public AnimatedButton(TextureAtlas atlas) /// private void HandleKeyDown(object sender, KeyEventArgs e) { - if (e.Key == Keys.Left) + if (e.Key == Gum.Forms.Input.Keys.Left) { // Left arrow navigates to previous control HandleTab(TabDirection.Up, loop: true); } - if (e.Key == Keys.Right) + if (e.Key == Gum.Forms.Input.Keys.Right) { // Right arrow navigates to next control HandleTab(TabDirection.Down, loop: true); diff --git a/Tutorials/learn-monogame-2d/src/21-Customizing-Gum-UI/DungeonSlime/UI/OptionsSlider.cs b/Tutorials/learn-monogame-2d/src/21-Customizing-Gum-UI/DungeonSlime/UI/OptionsSlider.cs index a74cb164..76648e2a 100644 --- a/Tutorials/learn-monogame-2d/src/21-Customizing-Gum-UI/DungeonSlime/UI/OptionsSlider.cs +++ b/Tutorials/learn-monogame-2d/src/21-Customizing-Gum-UI/DungeonSlime/UI/OptionsSlider.cs @@ -18,7 +18,7 @@ public class OptionsSlider : Slider private Gum.GueDeriving.TextRuntime _textInstance; // Reference to the rectangle that visually represents the current value - private Gum.GueDeriving.ColoredRectangleRuntime _fillRectangle; + private Gum.GueDeriving.RectangleRuntime _fillRectangle; /// /// Gets or sets the text label for this slider. @@ -128,7 +128,9 @@ public OptionsSlider(TextureAtlas atlas) middleBackground.AddChild(trackInstance); // Create the fill rectangle that visually displays the current value - _fillRectangle = new Gum.GueDeriving.ColoredRectangleRuntime(); + _fillRectangle = new Gum.GueDeriving.RectangleRuntime(); + _fillRectangle.IsFilled = true; + _fillRectangle.StrokeWidth = 0; _fillRectangle.Dock(Gum.Wireframe.Dock.Left); _fillRectangle.Width = 90f; // Default to 90% - will be updated by value changes _fillRectangle.WidthUnits = DimensionUnitType.PercentageOfParent; @@ -178,7 +180,7 @@ public OptionsSlider(TextureAtlas atlas) offBackground.Color = unfocusedColor; middleBackground.Color = unfocusedColor; maxBackground.Color = unfocusedColor; - _fillRectangle.Color = unfocusedColor; + _fillRectangle.FillColor = unfocusedColor; }; sliderCategory.States.Add(enabled); @@ -193,7 +195,7 @@ public OptionsSlider(TextureAtlas atlas) offBackground.Color = focusedColor; middleBackground.Color = focusedColor; maxBackground.Color = focusedColor; - _fillRectangle.Color = focusedColor; + _fillRectangle.FillColor = focusedColor; }; sliderCategory.States.Add(focused); diff --git a/Tutorials/learn-monogame-2d/src/22-Snake-Game-Mechanics/DungeonSlime/DungeonSlime.csproj b/Tutorials/learn-monogame-2d/src/22-Snake-Game-Mechanics/DungeonSlime/DungeonSlime.csproj index fb7a95fd..105b0bf0 100644 --- a/Tutorials/learn-monogame-2d/src/22-Snake-Game-Mechanics/DungeonSlime/DungeonSlime.csproj +++ b/Tutorials/learn-monogame-2d/src/22-Snake-Game-Mechanics/DungeonSlime/DungeonSlime.csproj @@ -23,7 +23,7 @@ - + diff --git a/Tutorials/learn-monogame-2d/src/22-Snake-Game-Mechanics/DungeonSlime/Game1.cs b/Tutorials/learn-monogame-2d/src/22-Snake-Game-Mechanics/DungeonSlime/Game1.cs index 552a1790..514ab0da 100644 --- a/Tutorials/learn-monogame-2d/src/22-Snake-Game-Mechanics/DungeonSlime/Game1.cs +++ b/Tutorials/learn-monogame-2d/src/22-Snake-Game-Mechanics/DungeonSlime/Game1.cs @@ -1,7 +1,6 @@ using DungeonSlime.Scenes; using Microsoft.Xna.Framework.Media; using MonoGameLibrary; -using MonoGameGum; using Gum.Forms; using Gum.Forms.Controls; @@ -49,12 +48,12 @@ private void InitializeGum() // Customize the tab reverse UI navigation to also trigger when the keyboard // Up arrow key is pushed. FrameworkElement.TabReverseKeyCombos.Add( - new KeyCombo() { PushedKey = Microsoft.Xna.Framework.Input.Keys.Up }); + new KeyCombo() { PushedKey = Gum.Forms.Input.Keys.Up }); // Customize the tab UI navigation to also trigger when the keyboard // Down arrow key is pushed. FrameworkElement.TabKeyCombos.Add( - new KeyCombo() { PushedKey = Microsoft.Xna.Framework.Input.Keys.Down }); + new KeyCombo() { PushedKey = Gum.Forms.Input.Keys.Down }); // The assets created for the UI were done so at 1/4th the size to keep the size of the // texture atlas small. So we will set the default canvas size to be 1/4th the size of diff --git a/Tutorials/learn-monogame-2d/src/22-Snake-Game-Mechanics/DungeonSlime/Scenes/GameScene.cs b/Tutorials/learn-monogame-2d/src/22-Snake-Game-Mechanics/DungeonSlime/Scenes/GameScene.cs index 72f8f9e6..674bb59b 100644 --- a/Tutorials/learn-monogame-2d/src/22-Snake-Game-Mechanics/DungeonSlime/Scenes/GameScene.cs +++ b/Tutorials/learn-monogame-2d/src/22-Snake-Game-Mechanics/DungeonSlime/Scenes/GameScene.cs @@ -8,7 +8,6 @@ using Microsoft.Xna.Framework.Audio; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input; -using MonoGameGum; using Gum.GueDeriving; using MonoGameLibrary; using MonoGameLibrary.Graphics; diff --git a/Tutorials/learn-monogame-2d/src/22-Snake-Game-Mechanics/DungeonSlime/Scenes/TitleScene.cs b/Tutorials/learn-monogame-2d/src/22-Snake-Game-Mechanics/DungeonSlime/Scenes/TitleScene.cs index 057ac45f..11a3f3be 100644 --- a/Tutorials/learn-monogame-2d/src/22-Snake-Game-Mechanics/DungeonSlime/Scenes/TitleScene.cs +++ b/Tutorials/learn-monogame-2d/src/22-Snake-Game-Mechanics/DungeonSlime/Scenes/TitleScene.cs @@ -5,7 +5,6 @@ using Microsoft.Xna.Framework.Audio; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input; -using MonoGameGum; using Gum.GueDeriving; using MonoGameLibrary; using MonoGameLibrary.Graphics; diff --git a/Tutorials/learn-monogame-2d/src/22-Snake-Game-Mechanics/DungeonSlime/UI/AnimatedButton.cs b/Tutorials/learn-monogame-2d/src/22-Snake-Game-Mechanics/DungeonSlime/UI/AnimatedButton.cs index 13a4a485..9c12a2dd 100644 --- a/Tutorials/learn-monogame-2d/src/22-Snake-Game-Mechanics/DungeonSlime/UI/AnimatedButton.cs +++ b/Tutorials/learn-monogame-2d/src/22-Snake-Game-Mechanics/DungeonSlime/UI/AnimatedButton.cs @@ -141,12 +141,12 @@ public AnimatedButton(TextureAtlas atlas) /// private void HandleKeyDown(object sender, KeyEventArgs e) { - if (e.Key == Keys.Left) + if (e.Key == Gum.Forms.Input.Keys.Left) { // Left arrow navigates to previous control HandleTab(TabDirection.Up, loop: true); } - if (e.Key == Keys.Right) + if (e.Key == Gum.Forms.Input.Keys.Right) { // Right arrow navigates to next control HandleTab(TabDirection.Down, loop: true); diff --git a/Tutorials/learn-monogame-2d/src/22-Snake-Game-Mechanics/DungeonSlime/UI/OptionsSlider.cs b/Tutorials/learn-monogame-2d/src/22-Snake-Game-Mechanics/DungeonSlime/UI/OptionsSlider.cs index a74cb164..76648e2a 100644 --- a/Tutorials/learn-monogame-2d/src/22-Snake-Game-Mechanics/DungeonSlime/UI/OptionsSlider.cs +++ b/Tutorials/learn-monogame-2d/src/22-Snake-Game-Mechanics/DungeonSlime/UI/OptionsSlider.cs @@ -18,7 +18,7 @@ public class OptionsSlider : Slider private Gum.GueDeriving.TextRuntime _textInstance; // Reference to the rectangle that visually represents the current value - private Gum.GueDeriving.ColoredRectangleRuntime _fillRectangle; + private Gum.GueDeriving.RectangleRuntime _fillRectangle; /// /// Gets or sets the text label for this slider. @@ -128,7 +128,9 @@ public OptionsSlider(TextureAtlas atlas) middleBackground.AddChild(trackInstance); // Create the fill rectangle that visually displays the current value - _fillRectangle = new Gum.GueDeriving.ColoredRectangleRuntime(); + _fillRectangle = new Gum.GueDeriving.RectangleRuntime(); + _fillRectangle.IsFilled = true; + _fillRectangle.StrokeWidth = 0; _fillRectangle.Dock(Gum.Wireframe.Dock.Left); _fillRectangle.Width = 90f; // Default to 90% - will be updated by value changes _fillRectangle.WidthUnits = DimensionUnitType.PercentageOfParent; @@ -178,7 +180,7 @@ public OptionsSlider(TextureAtlas atlas) offBackground.Color = unfocusedColor; middleBackground.Color = unfocusedColor; maxBackground.Color = unfocusedColor; - _fillRectangle.Color = unfocusedColor; + _fillRectangle.FillColor = unfocusedColor; }; sliderCategory.States.Add(enabled); @@ -193,7 +195,7 @@ public OptionsSlider(TextureAtlas atlas) offBackground.Color = focusedColor; middleBackground.Color = focusedColor; maxBackground.Color = focusedColor; - _fillRectangle.Color = focusedColor; + _fillRectangle.FillColor = focusedColor; }; sliderCategory.States.Add(focused); diff --git a/Tutorials/learn-monogame-2d/src/23-Completing-The-Game/DungeonSlime/DungeonSlime.csproj b/Tutorials/learn-monogame-2d/src/23-Completing-The-Game/DungeonSlime/DungeonSlime.csproj index fb7a95fd..105b0bf0 100644 --- a/Tutorials/learn-monogame-2d/src/23-Completing-The-Game/DungeonSlime/DungeonSlime.csproj +++ b/Tutorials/learn-monogame-2d/src/23-Completing-The-Game/DungeonSlime/DungeonSlime.csproj @@ -23,7 +23,7 @@ - + diff --git a/Tutorials/learn-monogame-2d/src/23-Completing-The-Game/DungeonSlime/Game1.cs b/Tutorials/learn-monogame-2d/src/23-Completing-The-Game/DungeonSlime/Game1.cs index 552a1790..514ab0da 100644 --- a/Tutorials/learn-monogame-2d/src/23-Completing-The-Game/DungeonSlime/Game1.cs +++ b/Tutorials/learn-monogame-2d/src/23-Completing-The-Game/DungeonSlime/Game1.cs @@ -1,7 +1,6 @@ using DungeonSlime.Scenes; using Microsoft.Xna.Framework.Media; using MonoGameLibrary; -using MonoGameGum; using Gum.Forms; using Gum.Forms.Controls; @@ -49,12 +48,12 @@ private void InitializeGum() // Customize the tab reverse UI navigation to also trigger when the keyboard // Up arrow key is pushed. FrameworkElement.TabReverseKeyCombos.Add( - new KeyCombo() { PushedKey = Microsoft.Xna.Framework.Input.Keys.Up }); + new KeyCombo() { PushedKey = Gum.Forms.Input.Keys.Up }); // Customize the tab UI navigation to also trigger when the keyboard // Down arrow key is pushed. FrameworkElement.TabKeyCombos.Add( - new KeyCombo() { PushedKey = Microsoft.Xna.Framework.Input.Keys.Down }); + new KeyCombo() { PushedKey = Gum.Forms.Input.Keys.Down }); // The assets created for the UI were done so at 1/4th the size to keep the size of the // texture atlas small. So we will set the default canvas size to be 1/4th the size of diff --git a/Tutorials/learn-monogame-2d/src/23-Completing-The-Game/DungeonSlime/Scenes/GameScene.cs b/Tutorials/learn-monogame-2d/src/23-Completing-The-Game/DungeonSlime/Scenes/GameScene.cs index d5bfcf16..5483e765 100644 --- a/Tutorials/learn-monogame-2d/src/23-Completing-The-Game/DungeonSlime/Scenes/GameScene.cs +++ b/Tutorials/learn-monogame-2d/src/23-Completing-The-Game/DungeonSlime/Scenes/GameScene.cs @@ -4,7 +4,6 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Audio; using Microsoft.Xna.Framework.Graphics; -using MonoGameGum; using MonoGameLibrary; using MonoGameLibrary.Graphics; using MonoGameLibrary.Scenes; diff --git a/Tutorials/learn-monogame-2d/src/23-Completing-The-Game/DungeonSlime/Scenes/TitleScene.cs b/Tutorials/learn-monogame-2d/src/23-Completing-The-Game/DungeonSlime/Scenes/TitleScene.cs index 057ac45f..11a3f3be 100644 --- a/Tutorials/learn-monogame-2d/src/23-Completing-The-Game/DungeonSlime/Scenes/TitleScene.cs +++ b/Tutorials/learn-monogame-2d/src/23-Completing-The-Game/DungeonSlime/Scenes/TitleScene.cs @@ -5,7 +5,6 @@ using Microsoft.Xna.Framework.Audio; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input; -using MonoGameGum; using Gum.GueDeriving; using MonoGameLibrary; using MonoGameLibrary.Graphics; diff --git a/Tutorials/learn-monogame-2d/src/23-Completing-The-Game/DungeonSlime/UI/AnimatedButton.cs b/Tutorials/learn-monogame-2d/src/23-Completing-The-Game/DungeonSlime/UI/AnimatedButton.cs index 13a4a485..9c12a2dd 100644 --- a/Tutorials/learn-monogame-2d/src/23-Completing-The-Game/DungeonSlime/UI/AnimatedButton.cs +++ b/Tutorials/learn-monogame-2d/src/23-Completing-The-Game/DungeonSlime/UI/AnimatedButton.cs @@ -141,12 +141,12 @@ public AnimatedButton(TextureAtlas atlas) /// private void HandleKeyDown(object sender, KeyEventArgs e) { - if (e.Key == Keys.Left) + if (e.Key == Gum.Forms.Input.Keys.Left) { // Left arrow navigates to previous control HandleTab(TabDirection.Up, loop: true); } - if (e.Key == Keys.Right) + if (e.Key == Gum.Forms.Input.Keys.Right) { // Right arrow navigates to next control HandleTab(TabDirection.Down, loop: true); diff --git a/Tutorials/learn-monogame-2d/src/23-Completing-The-Game/DungeonSlime/UI/GameSceneUI.cs b/Tutorials/learn-monogame-2d/src/23-Completing-The-Game/DungeonSlime/UI/GameSceneUI.cs index 67e413f6..d6521ff0 100644 --- a/Tutorials/learn-monogame-2d/src/23-Completing-The-Game/DungeonSlime/UI/GameSceneUI.cs +++ b/Tutorials/learn-monogame-2d/src/23-Completing-The-Game/DungeonSlime/UI/GameSceneUI.cs @@ -5,7 +5,6 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Audio; using Microsoft.Xna.Framework.Content; -using MonoGameGum; using Gum.GueDeriving; using MonoGameLibrary; using MonoGameLibrary.Graphics; diff --git a/Tutorials/learn-monogame-2d/src/23-Completing-The-Game/DungeonSlime/UI/OptionsSlider.cs b/Tutorials/learn-monogame-2d/src/23-Completing-The-Game/DungeonSlime/UI/OptionsSlider.cs index a74cb164..76648e2a 100644 --- a/Tutorials/learn-monogame-2d/src/23-Completing-The-Game/DungeonSlime/UI/OptionsSlider.cs +++ b/Tutorials/learn-monogame-2d/src/23-Completing-The-Game/DungeonSlime/UI/OptionsSlider.cs @@ -18,7 +18,7 @@ public class OptionsSlider : Slider private Gum.GueDeriving.TextRuntime _textInstance; // Reference to the rectangle that visually represents the current value - private Gum.GueDeriving.ColoredRectangleRuntime _fillRectangle; + private Gum.GueDeriving.RectangleRuntime _fillRectangle; /// /// Gets or sets the text label for this slider. @@ -128,7 +128,9 @@ public OptionsSlider(TextureAtlas atlas) middleBackground.AddChild(trackInstance); // Create the fill rectangle that visually displays the current value - _fillRectangle = new Gum.GueDeriving.ColoredRectangleRuntime(); + _fillRectangle = new Gum.GueDeriving.RectangleRuntime(); + _fillRectangle.IsFilled = true; + _fillRectangle.StrokeWidth = 0; _fillRectangle.Dock(Gum.Wireframe.Dock.Left); _fillRectangle.Width = 90f; // Default to 90% - will be updated by value changes _fillRectangle.WidthUnits = DimensionUnitType.PercentageOfParent; @@ -178,7 +180,7 @@ public OptionsSlider(TextureAtlas atlas) offBackground.Color = unfocusedColor; middleBackground.Color = unfocusedColor; maxBackground.Color = unfocusedColor; - _fillRectangle.Color = unfocusedColor; + _fillRectangle.FillColor = unfocusedColor; }; sliderCategory.States.Add(enabled); @@ -193,7 +195,7 @@ public OptionsSlider(TextureAtlas atlas) offBackground.Color = focusedColor; middleBackground.Color = focusedColor; maxBackground.Color = focusedColor; - _fillRectangle.Color = focusedColor; + _fillRectangle.FillColor = focusedColor; }; sliderCategory.States.Add(focused); diff --git a/Tutorials/learn-monogame-2d/src/24-Shaders/DungeonSlime/DungeonSlime.csproj b/Tutorials/learn-monogame-2d/src/24-Shaders/DungeonSlime/DungeonSlime.csproj index fb7a95fd..105b0bf0 100644 --- a/Tutorials/learn-monogame-2d/src/24-Shaders/DungeonSlime/DungeonSlime.csproj +++ b/Tutorials/learn-monogame-2d/src/24-Shaders/DungeonSlime/DungeonSlime.csproj @@ -23,7 +23,7 @@ - + diff --git a/Tutorials/learn-monogame-2d/src/24-Shaders/DungeonSlime/Game1.cs b/Tutorials/learn-monogame-2d/src/24-Shaders/DungeonSlime/Game1.cs index 552a1790..514ab0da 100644 --- a/Tutorials/learn-monogame-2d/src/24-Shaders/DungeonSlime/Game1.cs +++ b/Tutorials/learn-monogame-2d/src/24-Shaders/DungeonSlime/Game1.cs @@ -1,7 +1,6 @@ using DungeonSlime.Scenes; using Microsoft.Xna.Framework.Media; using MonoGameLibrary; -using MonoGameGum; using Gum.Forms; using Gum.Forms.Controls; @@ -49,12 +48,12 @@ private void InitializeGum() // Customize the tab reverse UI navigation to also trigger when the keyboard // Up arrow key is pushed. FrameworkElement.TabReverseKeyCombos.Add( - new KeyCombo() { PushedKey = Microsoft.Xna.Framework.Input.Keys.Up }); + new KeyCombo() { PushedKey = Gum.Forms.Input.Keys.Up }); // Customize the tab UI navigation to also trigger when the keyboard // Down arrow key is pushed. FrameworkElement.TabKeyCombos.Add( - new KeyCombo() { PushedKey = Microsoft.Xna.Framework.Input.Keys.Down }); + new KeyCombo() { PushedKey = Gum.Forms.Input.Keys.Down }); // The assets created for the UI were done so at 1/4th the size to keep the size of the // texture atlas small. So we will set the default canvas size to be 1/4th the size of diff --git a/Tutorials/learn-monogame-2d/src/24-Shaders/DungeonSlime/Scenes/GameScene.cs b/Tutorials/learn-monogame-2d/src/24-Shaders/DungeonSlime/Scenes/GameScene.cs index 3caaf983..7595f739 100644 --- a/Tutorials/learn-monogame-2d/src/24-Shaders/DungeonSlime/Scenes/GameScene.cs +++ b/Tutorials/learn-monogame-2d/src/24-Shaders/DungeonSlime/Scenes/GameScene.cs @@ -4,7 +4,6 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Audio; using Microsoft.Xna.Framework.Graphics; -using MonoGameGum; using MonoGameLibrary; using MonoGameLibrary.Graphics; using MonoGameLibrary.Scenes; diff --git a/Tutorials/learn-monogame-2d/src/24-Shaders/DungeonSlime/Scenes/TitleScene.cs b/Tutorials/learn-monogame-2d/src/24-Shaders/DungeonSlime/Scenes/TitleScene.cs index 057ac45f..11a3f3be 100644 --- a/Tutorials/learn-monogame-2d/src/24-Shaders/DungeonSlime/Scenes/TitleScene.cs +++ b/Tutorials/learn-monogame-2d/src/24-Shaders/DungeonSlime/Scenes/TitleScene.cs @@ -5,7 +5,6 @@ using Microsoft.Xna.Framework.Audio; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input; -using MonoGameGum; using Gum.GueDeriving; using MonoGameLibrary; using MonoGameLibrary.Graphics; diff --git a/Tutorials/learn-monogame-2d/src/24-Shaders/DungeonSlime/UI/AnimatedButton.cs b/Tutorials/learn-monogame-2d/src/24-Shaders/DungeonSlime/UI/AnimatedButton.cs index 026b1bef..3dbcec9e 100644 --- a/Tutorials/learn-monogame-2d/src/24-Shaders/DungeonSlime/UI/AnimatedButton.cs +++ b/Tutorials/learn-monogame-2d/src/24-Shaders/DungeonSlime/UI/AnimatedButton.cs @@ -141,12 +141,12 @@ public AnimatedButton(TextureAtlas atlas) /// private void HandleKeyDown(object sender, KeyEventArgs e) { - if (e.Key == Keys.Left) + if (e.Key == Gum.Forms.Input.Keys.Left) { // Left arrow navigates to previous control HandleTab(TabDirection.Up, loop: true); } - if (e.Key == Keys.Right) + if (e.Key == Gum.Forms.Input.Keys.Right) { // Right arrow navigates to next control HandleTab(TabDirection.Down, loop: true); diff --git a/Tutorials/learn-monogame-2d/src/24-Shaders/DungeonSlime/UI/GameSceneUI.cs b/Tutorials/learn-monogame-2d/src/24-Shaders/DungeonSlime/UI/GameSceneUI.cs index 67e413f6..d6521ff0 100644 --- a/Tutorials/learn-monogame-2d/src/24-Shaders/DungeonSlime/UI/GameSceneUI.cs +++ b/Tutorials/learn-monogame-2d/src/24-Shaders/DungeonSlime/UI/GameSceneUI.cs @@ -5,7 +5,6 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Audio; using Microsoft.Xna.Framework.Content; -using MonoGameGum; using Gum.GueDeriving; using MonoGameLibrary; using MonoGameLibrary.Graphics; diff --git a/Tutorials/learn-monogame-2d/src/24-Shaders/DungeonSlime/UI/OptionsSlider.cs b/Tutorials/learn-monogame-2d/src/24-Shaders/DungeonSlime/UI/OptionsSlider.cs index a74cb164..76648e2a 100644 --- a/Tutorials/learn-monogame-2d/src/24-Shaders/DungeonSlime/UI/OptionsSlider.cs +++ b/Tutorials/learn-monogame-2d/src/24-Shaders/DungeonSlime/UI/OptionsSlider.cs @@ -18,7 +18,7 @@ public class OptionsSlider : Slider private Gum.GueDeriving.TextRuntime _textInstance; // Reference to the rectangle that visually represents the current value - private Gum.GueDeriving.ColoredRectangleRuntime _fillRectangle; + private Gum.GueDeriving.RectangleRuntime _fillRectangle; /// /// Gets or sets the text label for this slider. @@ -128,7 +128,9 @@ public OptionsSlider(TextureAtlas atlas) middleBackground.AddChild(trackInstance); // Create the fill rectangle that visually displays the current value - _fillRectangle = new Gum.GueDeriving.ColoredRectangleRuntime(); + _fillRectangle = new Gum.GueDeriving.RectangleRuntime(); + _fillRectangle.IsFilled = true; + _fillRectangle.StrokeWidth = 0; _fillRectangle.Dock(Gum.Wireframe.Dock.Left); _fillRectangle.Width = 90f; // Default to 90% - will be updated by value changes _fillRectangle.WidthUnits = DimensionUnitType.PercentageOfParent; @@ -178,7 +180,7 @@ public OptionsSlider(TextureAtlas atlas) offBackground.Color = unfocusedColor; middleBackground.Color = unfocusedColor; maxBackground.Color = unfocusedColor; - _fillRectangle.Color = unfocusedColor; + _fillRectangle.FillColor = unfocusedColor; }; sliderCategory.States.Add(enabled); @@ -193,7 +195,7 @@ public OptionsSlider(TextureAtlas atlas) offBackground.Color = focusedColor; middleBackground.Color = focusedColor; maxBackground.Color = focusedColor; - _fillRectangle.Color = focusedColor; + _fillRectangle.FillColor = focusedColor; }; sliderCategory.States.Add(focused); diff --git a/Tutorials/learn-monogame-2d/src/25-Packaging-Game/DungeonSlime/DungeonSlime.csproj b/Tutorials/learn-monogame-2d/src/25-Packaging-Game/DungeonSlime/DungeonSlime.csproj index fb7a95fd..105b0bf0 100644 --- a/Tutorials/learn-monogame-2d/src/25-Packaging-Game/DungeonSlime/DungeonSlime.csproj +++ b/Tutorials/learn-monogame-2d/src/25-Packaging-Game/DungeonSlime/DungeonSlime.csproj @@ -23,7 +23,7 @@ - + diff --git a/Tutorials/learn-monogame-2d/src/25-Packaging-Game/DungeonSlime/Game1.cs b/Tutorials/learn-monogame-2d/src/25-Packaging-Game/DungeonSlime/Game1.cs index 552a1790..514ab0da 100644 --- a/Tutorials/learn-monogame-2d/src/25-Packaging-Game/DungeonSlime/Game1.cs +++ b/Tutorials/learn-monogame-2d/src/25-Packaging-Game/DungeonSlime/Game1.cs @@ -1,7 +1,6 @@ using DungeonSlime.Scenes; using Microsoft.Xna.Framework.Media; using MonoGameLibrary; -using MonoGameGum; using Gum.Forms; using Gum.Forms.Controls; @@ -49,12 +48,12 @@ private void InitializeGum() // Customize the tab reverse UI navigation to also trigger when the keyboard // Up arrow key is pushed. FrameworkElement.TabReverseKeyCombos.Add( - new KeyCombo() { PushedKey = Microsoft.Xna.Framework.Input.Keys.Up }); + new KeyCombo() { PushedKey = Gum.Forms.Input.Keys.Up }); // Customize the tab UI navigation to also trigger when the keyboard // Down arrow key is pushed. FrameworkElement.TabKeyCombos.Add( - new KeyCombo() { PushedKey = Microsoft.Xna.Framework.Input.Keys.Down }); + new KeyCombo() { PushedKey = Gum.Forms.Input.Keys.Down }); // The assets created for the UI were done so at 1/4th the size to keep the size of the // texture atlas small. So we will set the default canvas size to be 1/4th the size of diff --git a/Tutorials/learn-monogame-2d/src/25-Packaging-Game/DungeonSlime/Scenes/GameScene.cs b/Tutorials/learn-monogame-2d/src/25-Packaging-Game/DungeonSlime/Scenes/GameScene.cs index 3caaf983..7595f739 100644 --- a/Tutorials/learn-monogame-2d/src/25-Packaging-Game/DungeonSlime/Scenes/GameScene.cs +++ b/Tutorials/learn-monogame-2d/src/25-Packaging-Game/DungeonSlime/Scenes/GameScene.cs @@ -4,7 +4,6 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Audio; using Microsoft.Xna.Framework.Graphics; -using MonoGameGum; using MonoGameLibrary; using MonoGameLibrary.Graphics; using MonoGameLibrary.Scenes; diff --git a/Tutorials/learn-monogame-2d/src/25-Packaging-Game/DungeonSlime/Scenes/TitleScene.cs b/Tutorials/learn-monogame-2d/src/25-Packaging-Game/DungeonSlime/Scenes/TitleScene.cs index 62d14d59..2fcf96c4 100644 --- a/Tutorials/learn-monogame-2d/src/25-Packaging-Game/DungeonSlime/Scenes/TitleScene.cs +++ b/Tutorials/learn-monogame-2d/src/25-Packaging-Game/DungeonSlime/Scenes/TitleScene.cs @@ -4,7 +4,6 @@ using Microsoft.Xna.Framework.Audio; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input; -using MonoGameGum; using Gum.Forms.Controls; using Gum.GueDeriving; using MonoGameLibrary; diff --git a/Tutorials/learn-monogame-2d/src/25-Packaging-Game/DungeonSlime/UI/AnimatedButton.cs b/Tutorials/learn-monogame-2d/src/25-Packaging-Game/DungeonSlime/UI/AnimatedButton.cs index 026b1bef..3dbcec9e 100644 --- a/Tutorials/learn-monogame-2d/src/25-Packaging-Game/DungeonSlime/UI/AnimatedButton.cs +++ b/Tutorials/learn-monogame-2d/src/25-Packaging-Game/DungeonSlime/UI/AnimatedButton.cs @@ -141,12 +141,12 @@ public AnimatedButton(TextureAtlas atlas) /// private void HandleKeyDown(object sender, KeyEventArgs e) { - if (e.Key == Keys.Left) + if (e.Key == Gum.Forms.Input.Keys.Left) { // Left arrow navigates to previous control HandleTab(TabDirection.Up, loop: true); } - if (e.Key == Keys.Right) + if (e.Key == Gum.Forms.Input.Keys.Right) { // Right arrow navigates to next control HandleTab(TabDirection.Down, loop: true); diff --git a/Tutorials/learn-monogame-2d/src/25-Packaging-Game/DungeonSlime/UI/GameSceneUI.cs b/Tutorials/learn-monogame-2d/src/25-Packaging-Game/DungeonSlime/UI/GameSceneUI.cs index 0a210647..7031bc97 100644 --- a/Tutorials/learn-monogame-2d/src/25-Packaging-Game/DungeonSlime/UI/GameSceneUI.cs +++ b/Tutorials/learn-monogame-2d/src/25-Packaging-Game/DungeonSlime/UI/GameSceneUI.cs @@ -4,7 +4,6 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Audio; using Microsoft.Xna.Framework.Content; -using MonoGameGum; using Gum.Forms.Controls; using Gum.GueDeriving; using MonoGameLibrary; diff --git a/Tutorials/learn-monogame-2d/src/25-Packaging-Game/DungeonSlime/UI/OptionsSlider.cs b/Tutorials/learn-monogame-2d/src/25-Packaging-Game/DungeonSlime/UI/OptionsSlider.cs index adf12ec1..52aea9df 100644 --- a/Tutorials/learn-monogame-2d/src/25-Packaging-Game/DungeonSlime/UI/OptionsSlider.cs +++ b/Tutorials/learn-monogame-2d/src/25-Packaging-Game/DungeonSlime/UI/OptionsSlider.cs @@ -18,7 +18,7 @@ public class OptionsSlider : Slider private Gum.GueDeriving.TextRuntime _textInstance; // Reference to the rectangle that visually represents the current value - private Gum.GueDeriving.ColoredRectangleRuntime _fillRectangle; + private Gum.GueDeriving.RectangleRuntime _fillRectangle; /// /// Gets or sets the text label for this slider. @@ -128,7 +128,9 @@ public OptionsSlider(TextureAtlas atlas) middleBackground.AddChild(trackInstance); // Create the fill rectangle that visually displays the current value - _fillRectangle = new Gum.GueDeriving.ColoredRectangleRuntime(); + _fillRectangle = new Gum.GueDeriving.RectangleRuntime(); + _fillRectangle.IsFilled = true; + _fillRectangle.StrokeWidth = 0; _fillRectangle.Dock(Gum.Wireframe.Dock.Left); _fillRectangle.Width = 90f; // Default to 90% - will be updated by value changes _fillRectangle.WidthUnits = DimensionUnitType.PercentageOfParent; @@ -178,7 +180,7 @@ public OptionsSlider(TextureAtlas atlas) offBackground.Color = unfocusedColor; middleBackground.Color = unfocusedColor; maxBackground.Color = unfocusedColor; - _fillRectangle.Color = unfocusedColor; + _fillRectangle.FillColor = unfocusedColor; }; sliderCategory.States.Add(enabled); @@ -193,7 +195,7 @@ public OptionsSlider(TextureAtlas atlas) offBackground.Color = focusedColor; middleBackground.Color = focusedColor; maxBackground.Color = focusedColor; - _fillRectangle.Color = focusedColor; + _fillRectangle.FillColor = focusedColor; }; sliderCategory.States.Add(focused); diff --git a/Tutorials/learn-monogame-2d/src/26-Publish-To-Itch/DungeonSlime/DungeonSlime.csproj b/Tutorials/learn-monogame-2d/src/26-Publish-To-Itch/DungeonSlime/DungeonSlime.csproj index fb7a95fd..105b0bf0 100644 --- a/Tutorials/learn-monogame-2d/src/26-Publish-To-Itch/DungeonSlime/DungeonSlime.csproj +++ b/Tutorials/learn-monogame-2d/src/26-Publish-To-Itch/DungeonSlime/DungeonSlime.csproj @@ -23,7 +23,7 @@ - + diff --git a/Tutorials/learn-monogame-2d/src/26-Publish-To-Itch/DungeonSlime/Game1.cs b/Tutorials/learn-monogame-2d/src/26-Publish-To-Itch/DungeonSlime/Game1.cs index 552a1790..514ab0da 100644 --- a/Tutorials/learn-monogame-2d/src/26-Publish-To-Itch/DungeonSlime/Game1.cs +++ b/Tutorials/learn-monogame-2d/src/26-Publish-To-Itch/DungeonSlime/Game1.cs @@ -1,7 +1,6 @@ using DungeonSlime.Scenes; using Microsoft.Xna.Framework.Media; using MonoGameLibrary; -using MonoGameGum; using Gum.Forms; using Gum.Forms.Controls; @@ -49,12 +48,12 @@ private void InitializeGum() // Customize the tab reverse UI navigation to also trigger when the keyboard // Up arrow key is pushed. FrameworkElement.TabReverseKeyCombos.Add( - new KeyCombo() { PushedKey = Microsoft.Xna.Framework.Input.Keys.Up }); + new KeyCombo() { PushedKey = Gum.Forms.Input.Keys.Up }); // Customize the tab UI navigation to also trigger when the keyboard // Down arrow key is pushed. FrameworkElement.TabKeyCombos.Add( - new KeyCombo() { PushedKey = Microsoft.Xna.Framework.Input.Keys.Down }); + new KeyCombo() { PushedKey = Gum.Forms.Input.Keys.Down }); // The assets created for the UI were done so at 1/4th the size to keep the size of the // texture atlas small. So we will set the default canvas size to be 1/4th the size of diff --git a/Tutorials/learn-monogame-2d/src/26-Publish-To-Itch/DungeonSlime/Scenes/GameScene.cs b/Tutorials/learn-monogame-2d/src/26-Publish-To-Itch/DungeonSlime/Scenes/GameScene.cs index 3caaf983..7595f739 100644 --- a/Tutorials/learn-monogame-2d/src/26-Publish-To-Itch/DungeonSlime/Scenes/GameScene.cs +++ b/Tutorials/learn-monogame-2d/src/26-Publish-To-Itch/DungeonSlime/Scenes/GameScene.cs @@ -4,7 +4,6 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Audio; using Microsoft.Xna.Framework.Graphics; -using MonoGameGum; using MonoGameLibrary; using MonoGameLibrary.Graphics; using MonoGameLibrary.Scenes; diff --git a/Tutorials/learn-monogame-2d/src/26-Publish-To-Itch/DungeonSlime/Scenes/TitleScene.cs b/Tutorials/learn-monogame-2d/src/26-Publish-To-Itch/DungeonSlime/Scenes/TitleScene.cs index 62d14d59..2fcf96c4 100644 --- a/Tutorials/learn-monogame-2d/src/26-Publish-To-Itch/DungeonSlime/Scenes/TitleScene.cs +++ b/Tutorials/learn-monogame-2d/src/26-Publish-To-Itch/DungeonSlime/Scenes/TitleScene.cs @@ -4,7 +4,6 @@ using Microsoft.Xna.Framework.Audio; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input; -using MonoGameGum; using Gum.Forms.Controls; using Gum.GueDeriving; using MonoGameLibrary; diff --git a/Tutorials/learn-monogame-2d/src/26-Publish-To-Itch/DungeonSlime/UI/AnimatedButton.cs b/Tutorials/learn-monogame-2d/src/26-Publish-To-Itch/DungeonSlime/UI/AnimatedButton.cs index 026b1bef..3dbcec9e 100644 --- a/Tutorials/learn-monogame-2d/src/26-Publish-To-Itch/DungeonSlime/UI/AnimatedButton.cs +++ b/Tutorials/learn-monogame-2d/src/26-Publish-To-Itch/DungeonSlime/UI/AnimatedButton.cs @@ -141,12 +141,12 @@ public AnimatedButton(TextureAtlas atlas) /// private void HandleKeyDown(object sender, KeyEventArgs e) { - if (e.Key == Keys.Left) + if (e.Key == Gum.Forms.Input.Keys.Left) { // Left arrow navigates to previous control HandleTab(TabDirection.Up, loop: true); } - if (e.Key == Keys.Right) + if (e.Key == Gum.Forms.Input.Keys.Right) { // Right arrow navigates to next control HandleTab(TabDirection.Down, loop: true); diff --git a/Tutorials/learn-monogame-2d/src/26-Publish-To-Itch/DungeonSlime/UI/GameSceneUI.cs b/Tutorials/learn-monogame-2d/src/26-Publish-To-Itch/DungeonSlime/UI/GameSceneUI.cs index 0a210647..7031bc97 100644 --- a/Tutorials/learn-monogame-2d/src/26-Publish-To-Itch/DungeonSlime/UI/GameSceneUI.cs +++ b/Tutorials/learn-monogame-2d/src/26-Publish-To-Itch/DungeonSlime/UI/GameSceneUI.cs @@ -4,7 +4,6 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Audio; using Microsoft.Xna.Framework.Content; -using MonoGameGum; using Gum.Forms.Controls; using Gum.GueDeriving; using MonoGameLibrary; diff --git a/Tutorials/learn-monogame-2d/src/26-Publish-To-Itch/DungeonSlime/UI/OptionsSlider.cs b/Tutorials/learn-monogame-2d/src/26-Publish-To-Itch/DungeonSlime/UI/OptionsSlider.cs index adf12ec1..52aea9df 100644 --- a/Tutorials/learn-monogame-2d/src/26-Publish-To-Itch/DungeonSlime/UI/OptionsSlider.cs +++ b/Tutorials/learn-monogame-2d/src/26-Publish-To-Itch/DungeonSlime/UI/OptionsSlider.cs @@ -18,7 +18,7 @@ public class OptionsSlider : Slider private Gum.GueDeriving.TextRuntime _textInstance; // Reference to the rectangle that visually represents the current value - private Gum.GueDeriving.ColoredRectangleRuntime _fillRectangle; + private Gum.GueDeriving.RectangleRuntime _fillRectangle; /// /// Gets or sets the text label for this slider. @@ -128,7 +128,9 @@ public OptionsSlider(TextureAtlas atlas) middleBackground.AddChild(trackInstance); // Create the fill rectangle that visually displays the current value - _fillRectangle = new Gum.GueDeriving.ColoredRectangleRuntime(); + _fillRectangle = new Gum.GueDeriving.RectangleRuntime(); + _fillRectangle.IsFilled = true; + _fillRectangle.StrokeWidth = 0; _fillRectangle.Dock(Gum.Wireframe.Dock.Left); _fillRectangle.Width = 90f; // Default to 90% - will be updated by value changes _fillRectangle.WidthUnits = DimensionUnitType.PercentageOfParent; @@ -178,7 +180,7 @@ public OptionsSlider(TextureAtlas atlas) offBackground.Color = unfocusedColor; middleBackground.Color = unfocusedColor; maxBackground.Color = unfocusedColor; - _fillRectangle.Color = unfocusedColor; + _fillRectangle.FillColor = unfocusedColor; }; sliderCategory.States.Add(enabled); @@ -193,7 +195,7 @@ public OptionsSlider(TextureAtlas atlas) offBackground.Color = focusedColor; middleBackground.Color = focusedColor; maxBackground.Color = focusedColor; - _fillRectangle.Color = focusedColor; + _fillRectangle.FillColor = focusedColor; }; sliderCategory.States.Add(focused); diff --git a/Tutorials/learn-monogame-2d/src/27-Conclusion/DungeonSlime/DungeonSlime.csproj b/Tutorials/learn-monogame-2d/src/27-Conclusion/DungeonSlime/DungeonSlime.csproj index 2b3bed78..eef6bc20 100644 --- a/Tutorials/learn-monogame-2d/src/27-Conclusion/DungeonSlime/DungeonSlime.csproj +++ b/Tutorials/learn-monogame-2d/src/27-Conclusion/DungeonSlime/DungeonSlime.csproj @@ -23,7 +23,7 @@ - + diff --git a/Tutorials/learn-monogame-2d/src/27-Conclusion/DungeonSlime/DungeonSlimeGame.cs b/Tutorials/learn-monogame-2d/src/27-Conclusion/DungeonSlime/DungeonSlimeGame.cs index 1658d804..74dc4ad8 100644 --- a/Tutorials/learn-monogame-2d/src/27-Conclusion/DungeonSlime/DungeonSlimeGame.cs +++ b/Tutorials/learn-monogame-2d/src/27-Conclusion/DungeonSlime/DungeonSlimeGame.cs @@ -1,7 +1,6 @@ using DungeonSlime.Scenes; using Microsoft.Xna.Framework.Media; using MonoGameLibrary; -using MonoGameGum; using Gum.Forms; using Gum.Forms.Controls; diff --git a/Tutorials/learn-monogame-2d/src/27-Conclusion/DungeonSlime/Platforms/Android/DungeonSlime.csproj b/Tutorials/learn-monogame-2d/src/27-Conclusion/DungeonSlime/Platforms/Android/DungeonSlime.csproj index f56a21e8..423c8186 100644 --- a/Tutorials/learn-monogame-2d/src/27-Conclusion/DungeonSlime/Platforms/Android/DungeonSlime.csproj +++ b/Tutorials/learn-monogame-2d/src/27-Conclusion/DungeonSlime/Platforms/Android/DungeonSlime.csproj @@ -13,7 +13,7 @@ - + diff --git a/Tutorials/learn-monogame-2d/src/27-Conclusion/DungeonSlime/Platforms/Desktop/DungeonSlime.csproj b/Tutorials/learn-monogame-2d/src/27-Conclusion/DungeonSlime/Platforms/Desktop/DungeonSlime.csproj index e9d43dbe..c6c1914c 100644 --- a/Tutorials/learn-monogame-2d/src/27-Conclusion/DungeonSlime/Platforms/Desktop/DungeonSlime.csproj +++ b/Tutorials/learn-monogame-2d/src/27-Conclusion/DungeonSlime/Platforms/Desktop/DungeonSlime.csproj @@ -23,7 +23,7 @@ - + diff --git a/Tutorials/learn-monogame-2d/src/27-Conclusion/DungeonSlime/Platforms/Windows/DungeonSlime.WindowsDX.csproj b/Tutorials/learn-monogame-2d/src/27-Conclusion/DungeonSlime/Platforms/Windows/DungeonSlime.WindowsDX.csproj index 28526aa6..0e40c6e8 100644 --- a/Tutorials/learn-monogame-2d/src/27-Conclusion/DungeonSlime/Platforms/Windows/DungeonSlime.WindowsDX.csproj +++ b/Tutorials/learn-monogame-2d/src/27-Conclusion/DungeonSlime/Platforms/Windows/DungeonSlime.WindowsDX.csproj @@ -12,7 +12,7 @@ ..\Desktop\Icon.ico - + diff --git a/Tutorials/learn-monogame-2d/src/27-Conclusion/DungeonSlime/Scenes/GameScene.cs b/Tutorials/learn-monogame-2d/src/27-Conclusion/DungeonSlime/Scenes/GameScene.cs index 37b0262d..9d10230f 100644 --- a/Tutorials/learn-monogame-2d/src/27-Conclusion/DungeonSlime/Scenes/GameScene.cs +++ b/Tutorials/learn-monogame-2d/src/27-Conclusion/DungeonSlime/Scenes/GameScene.cs @@ -4,7 +4,6 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Audio; using Microsoft.Xna.Framework.Graphics; -using MonoGameGum; using MonoGameLibrary; using MonoGameLibrary.Graphics; using MonoGameLibrary.Scenes; diff --git a/Tutorials/learn-monogame-2d/src/27-Conclusion/DungeonSlime/Scenes/TitleScene.cs b/Tutorials/learn-monogame-2d/src/27-Conclusion/DungeonSlime/Scenes/TitleScene.cs index bd5bbfcd..20f7dfe5 100644 --- a/Tutorials/learn-monogame-2d/src/27-Conclusion/DungeonSlime/Scenes/TitleScene.cs +++ b/Tutorials/learn-monogame-2d/src/27-Conclusion/DungeonSlime/Scenes/TitleScene.cs @@ -3,7 +3,6 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Audio; using Microsoft.Xna.Framework.Graphics; -using MonoGameGum; using Gum.Forms.Controls; using Gum.GueDeriving; using MonoGameLibrary; diff --git a/Tutorials/learn-monogame-2d/src/27-Conclusion/DungeonSlime/UI/GameSceneUI.cs b/Tutorials/learn-monogame-2d/src/27-Conclusion/DungeonSlime/UI/GameSceneUI.cs index 0a210647..7031bc97 100644 --- a/Tutorials/learn-monogame-2d/src/27-Conclusion/DungeonSlime/UI/GameSceneUI.cs +++ b/Tutorials/learn-monogame-2d/src/27-Conclusion/DungeonSlime/UI/GameSceneUI.cs @@ -4,7 +4,6 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Audio; using Microsoft.Xna.Framework.Content; -using MonoGameGum; using Gum.Forms.Controls; using Gum.GueDeriving; using MonoGameLibrary; diff --git a/Tutorials/learn-monogame-2d/src/27-Conclusion/DungeonSlime/UI/OptionsSlider.cs b/Tutorials/learn-monogame-2d/src/27-Conclusion/DungeonSlime/UI/OptionsSlider.cs index adf12ec1..52aea9df 100644 --- a/Tutorials/learn-monogame-2d/src/27-Conclusion/DungeonSlime/UI/OptionsSlider.cs +++ b/Tutorials/learn-monogame-2d/src/27-Conclusion/DungeonSlime/UI/OptionsSlider.cs @@ -18,7 +18,7 @@ public class OptionsSlider : Slider private Gum.GueDeriving.TextRuntime _textInstance; // Reference to the rectangle that visually represents the current value - private Gum.GueDeriving.ColoredRectangleRuntime _fillRectangle; + private Gum.GueDeriving.RectangleRuntime _fillRectangle; /// /// Gets or sets the text label for this slider. @@ -128,7 +128,9 @@ public OptionsSlider(TextureAtlas atlas) middleBackground.AddChild(trackInstance); // Create the fill rectangle that visually displays the current value - _fillRectangle = new Gum.GueDeriving.ColoredRectangleRuntime(); + _fillRectangle = new Gum.GueDeriving.RectangleRuntime(); + _fillRectangle.IsFilled = true; + _fillRectangle.StrokeWidth = 0; _fillRectangle.Dock(Gum.Wireframe.Dock.Left); _fillRectangle.Width = 90f; // Default to 90% - will be updated by value changes _fillRectangle.WidthUnits = DimensionUnitType.PercentageOfParent; @@ -178,7 +180,7 @@ public OptionsSlider(TextureAtlas atlas) offBackground.Color = unfocusedColor; middleBackground.Color = unfocusedColor; maxBackground.Color = unfocusedColor; - _fillRectangle.Color = unfocusedColor; + _fillRectangle.FillColor = unfocusedColor; }; sliderCategory.States.Add(enabled); @@ -193,7 +195,7 @@ public OptionsSlider(TextureAtlas atlas) offBackground.Color = focusedColor; middleBackground.Color = focusedColor; maxBackground.Color = focusedColor; - _fillRectangle.Color = focusedColor; + _fillRectangle.FillColor = focusedColor; }; sliderCategory.States.Add(focused); From b2d00b7aed775acc5f204b23f766f5e4f8520824 Mon Sep 17 00:00:00 2001 From: Victor Chelaru Date: Wed, 4 Nov 2026 06:32:23 -0700 Subject: [PATCH 2/2] Bump Gum to 2026.11.2.1 in 2dShaders --- .../DungeonSlime/DungeonSlime.csproj | 2 +- .../DungeonSlime/Game1.cs | 19 +++++++++---------- .../DungeonSlime/Scenes/GameScene.cs | 5 ++--- .../DungeonSlime/Scenes/TitleScene.cs | 9 ++++----- .../DungeonSlime/UI/AnimatedButton.cs | 6 +++--- .../DungeonSlime/UI/GameSceneUI.cs | 11 +++++------ .../DungeonSlime/UI/OptionsSlider.cs | 12 +++++++----- .../DungeonSlime/DungeonSlime.csproj | 2 +- .../DungeonSlime/Game1.cs | 19 +++++++++---------- .../DungeonSlime/Scenes/GameScene.cs | 5 ++--- .../DungeonSlime/Scenes/TitleScene.cs | 9 ++++----- .../DungeonSlime/UI/AnimatedButton.cs | 6 +++--- .../DungeonSlime/UI/GameSceneUI.cs | 11 +++++------ .../DungeonSlime/UI/OptionsSlider.cs | 12 +++++++----- .../DungeonSlime/DungeonSlime.csproj | 2 +- .../src/04-Debug-UI/DungeonSlime/Game1.cs | 19 +++++++++---------- .../DungeonSlime/Scenes/GameScene.cs | 5 ++--- .../DungeonSlime/Scenes/TitleScene.cs | 9 ++++----- .../DungeonSlime/UI/AnimatedButton.cs | 6 +++--- .../DungeonSlime/UI/GameSceneUI.cs | 11 +++++------ .../DungeonSlime/UI/OptionsSlider.cs | 12 +++++++----- .../DungeonSlime/DungeonSlime.csproj | 2 +- .../DungeonSlime/Game1.cs | 19 +++++++++---------- .../DungeonSlime/Scenes/GameScene.cs | 5 ++--- .../DungeonSlime/Scenes/TitleScene.cs | 9 ++++----- .../DungeonSlime/UI/AnimatedButton.cs | 6 +++--- .../DungeonSlime/UI/GameSceneUI.cs | 11 +++++------ .../DungeonSlime/UI/OptionsSlider.cs | 12 +++++++----- .../DungeonSlime/DungeonSlime.csproj | 2 +- .../DungeonSlime/Game1.cs | 19 +++++++++---------- .../DungeonSlime/Scenes/GameScene.cs | 5 ++--- .../DungeonSlime/Scenes/TitleScene.cs | 9 ++++----- .../DungeonSlime/UI/AnimatedButton.cs | 6 +++--- .../DungeonSlime/UI/GameSceneUI.cs | 11 +++++------ .../DungeonSlime/UI/OptionsSlider.cs | 12 +++++++----- .../DungeonSlime/DungeonSlime.csproj | 2 +- .../DungeonSlime/Game1.cs | 19 +++++++++---------- .../DungeonSlime/Scenes/GameScene.cs | 5 ++--- .../DungeonSlime/Scenes/TitleScene.cs | 9 ++++----- .../DungeonSlime/UI/AnimatedButton.cs | 6 +++--- .../DungeonSlime/UI/GameSceneUI.cs | 11 +++++------ .../DungeonSlime/UI/OptionsSlider.cs | 12 +++++++----- .../DungeonSlime/DungeonSlime.csproj | 2 +- .../src/08-Light-Effect/DungeonSlime/Game1.cs | 19 +++++++++---------- .../DungeonSlime/Scenes/GameScene.cs | 5 ++--- .../DungeonSlime/Scenes/TitleScene.cs | 9 ++++----- .../DungeonSlime/UI/AnimatedButton.cs | 6 +++--- .../DungeonSlime/UI/GameSceneUI.cs | 11 +++++------ .../DungeonSlime/UI/OptionsSlider.cs | 12 +++++++----- .../DungeonSlime/DungeonSlime.csproj | 2 +- .../09-Shadows-Effect/DungeonSlime/Game1.cs | 19 +++++++++---------- .../DungeonSlime/Scenes/GameScene.cs | 5 ++--- .../DungeonSlime/Scenes/TitleScene.cs | 9 ++++----- .../DungeonSlime/UI/AnimatedButton.cs | 6 +++--- .../DungeonSlime/UI/GameSceneUI.cs | 11 +++++------ .../DungeonSlime/UI/OptionsSlider.cs | 12 +++++++----- 56 files changed, 248 insertions(+), 264 deletions(-) diff --git a/Tutorials/2dShaders/src/02-Hot-Reload-System/DungeonSlime/DungeonSlime.csproj b/Tutorials/2dShaders/src/02-Hot-Reload-System/DungeonSlime/DungeonSlime.csproj index 6a8a6989..0b129d28 100644 --- a/Tutorials/2dShaders/src/02-Hot-Reload-System/DungeonSlime/DungeonSlime.csproj +++ b/Tutorials/2dShaders/src/02-Hot-Reload-System/DungeonSlime/DungeonSlime.csproj @@ -26,7 +26,7 @@ - + diff --git a/Tutorials/2dShaders/src/02-Hot-Reload-System/DungeonSlime/Game1.cs b/Tutorials/2dShaders/src/02-Hot-Reload-System/DungeonSlime/Game1.cs index 85384e18..882e5bfb 100644 --- a/Tutorials/2dShaders/src/02-Hot-Reload-System/DungeonSlime/Game1.cs +++ b/Tutorials/2dShaders/src/02-Hot-Reload-System/DungeonSlime/Game1.cs @@ -1,7 +1,6 @@ using DungeonSlime.Scenes; using Microsoft.Xna.Framework.Media; using MonoGameLibrary; -using MonoGameGum; using Gum.Forms; using Gum.Forms.Controls; @@ -35,34 +34,34 @@ private void InitializeGum() { // Initialize the Gum service - GumService.Default.Initialize(this, DefaultVisualsVersion.V3); + Gum.GumService.Default.Initialize(this, DefaultVisualsVersion.V3); // Tell the Gum service which content manager to use. We will tell it to // use the global content manager from our Core. - GumService.Default.ContentLoader.XnaContentManager = Core.Content; + Gum.GumService.Default.ContentLoader.XnaContentManager = Core.Content; // Register keyboard input for UI control. - FrameworkElement.KeyboardsForUiControl.Add(GumService.Default.Keyboard); + FrameworkElement.KeyboardsForUiControl.Add(Gum.GumService.Default.Keyboard); // Register gamepad input for Ui control. - FrameworkElement.GamePadsForUiControl.AddRange(GumService.Default.Gamepads); + FrameworkElement.GamePadsForUiControl.AddRange(Gum.GumService.Default.Gamepads); // Customize the tab reverse UI navigation to also trigger when the keyboard // Up arrow key is pushed. FrameworkElement.TabReverseKeyCombos.Add( - new KeyCombo() { PushedKey = Microsoft.Xna.Framework.Input.Keys.Up }); + new KeyCombo() { PushedKey = Gum.Forms.Input.Keys.Up }); // Customize the tab UI navigation to also trigger when the keyboard // Down arrow key is pushed. FrameworkElement.TabKeyCombos.Add( - new KeyCombo() { PushedKey = Microsoft.Xna.Framework.Input.Keys.Down }); + new KeyCombo() { PushedKey = Gum.Forms.Input.Keys.Down }); // The assets created for the UI were done so at 1/4th the size to keep the size of the // texture atlas small. So we will set the default canvas size to be 1/4th the size of // the game's resolution then tell gum to zoom in by a factor of 4. - GumService.Default.CanvasWidth = GraphicsDevice.PresentationParameters.BackBufferWidth / 4.0f; - GumService.Default.CanvasHeight = GraphicsDevice.PresentationParameters.BackBufferHeight / 4.0f; - GumService.Default.Renderer.Camera.Zoom = 4.0f; + Gum.GumService.Default.CanvasWidth = GraphicsDevice.PresentationParameters.BackBufferWidth / 4.0f; + Gum.GumService.Default.CanvasHeight = GraphicsDevice.PresentationParameters.BackBufferHeight / 4.0f; + Gum.GumService.Default.Renderer.Camera.Zoom = 4.0f; } protected override void LoadContent() diff --git a/Tutorials/2dShaders/src/02-Hot-Reload-System/DungeonSlime/Scenes/GameScene.cs b/Tutorials/2dShaders/src/02-Hot-Reload-System/DungeonSlime/Scenes/GameScene.cs index 48a3394a..104802ee 100644 --- a/Tutorials/2dShaders/src/02-Hot-Reload-System/DungeonSlime/Scenes/GameScene.cs +++ b/Tutorials/2dShaders/src/02-Hot-Reload-System/DungeonSlime/Scenes/GameScene.cs @@ -4,7 +4,6 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Audio; using Microsoft.Xna.Framework.Graphics; -using MonoGameGum; using MonoGameLibrary; using MonoGameLibrary.Content; using MonoGameLibrary.Graphics; @@ -74,7 +73,7 @@ public override void Initialize() // Create any UI elements from the root element created in previous // scenes - GumService.Default.Root.Children.Clear(); + Gum.GumService.Default.Root.Children.Clear(); // Initialize the user interface for the game scene. InitializeUI(); @@ -87,7 +86,7 @@ private void InitializeUI() { // Clear out any previous UI element incase we came here // from a different scene. - GumService.Default.Root.Children.Clear(); + Gum.GumService.Default.Root.Children.Clear(); // Create the game scene ui instance. _ui = new GameSceneUI(); diff --git a/Tutorials/2dShaders/src/02-Hot-Reload-System/DungeonSlime/Scenes/TitleScene.cs b/Tutorials/2dShaders/src/02-Hot-Reload-System/DungeonSlime/Scenes/TitleScene.cs index 82410848..60a46577 100644 --- a/Tutorials/2dShaders/src/02-Hot-Reload-System/DungeonSlime/Scenes/TitleScene.cs +++ b/Tutorials/2dShaders/src/02-Hot-Reload-System/DungeonSlime/Scenes/TitleScene.cs @@ -4,8 +4,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Audio; using Microsoft.Xna.Framework.Graphics; -using MonoGameGum; -using MonoGameGum.GueDeriving; +using Gum.GueDeriving; using MonoGameLibrary; using MonoGameLibrary.Graphics; using MonoGameLibrary.Scenes; @@ -282,7 +281,7 @@ private void InitializeUI() { // Clear out any previous UI in case we came here from // a different screen: - GumService.Default.Root.Children.Clear(); + Gum.GumService.Default.Root.Children.Clear(); CreateTitlePanel(); CreateOptionsPanel(); @@ -301,7 +300,7 @@ public override void Update(GameTime gameTime) _backgroundOffset.X %= _backgroundPattern.Width; _backgroundOffset.Y %= _backgroundPattern.Height; - GumService.Default.Update(gameTime); + Gum.GumService.Default.Update(gameTime); } public override void Draw(GameTime gameTime) @@ -340,6 +339,6 @@ public override void Draw(GameTime gameTime) Core.SpriteBatch.End(); } - GumService.Default.Draw(); + Gum.GumService.Default.Draw(); } } diff --git a/Tutorials/2dShaders/src/02-Hot-Reload-System/DungeonSlime/UI/AnimatedButton.cs b/Tutorials/2dShaders/src/02-Hot-Reload-System/DungeonSlime/UI/AnimatedButton.cs index a98baf1a..1d5eff99 100644 --- a/Tutorials/2dShaders/src/02-Hot-Reload-System/DungeonSlime/UI/AnimatedButton.cs +++ b/Tutorials/2dShaders/src/02-Hot-Reload-System/DungeonSlime/UI/AnimatedButton.cs @@ -6,7 +6,7 @@ using Gum.Graphics.Animation; using Gum.Managers; using Microsoft.Xna.Framework.Input; -using MonoGameGum.GueDeriving; +using Gum.GueDeriving; using MonoGameLibrary.Graphics; namespace DungeonSlime.UI; @@ -141,12 +141,12 @@ public AnimatedButton(TextureAtlas atlas) /// private void HandleKeyDown(object sender, KeyEventArgs e) { - if (e.Key == Keys.Left) + if (e.Key == Gum.Forms.Input.Keys.Left) { // Left arrow navigates to previous control HandleTab(TabDirection.Up, loop: true); } - if (e.Key == Keys.Right) + if (e.Key == Gum.Forms.Input.Keys.Right) { // Right arrow navigates to next control HandleTab(TabDirection.Down, loop: true); diff --git a/Tutorials/2dShaders/src/02-Hot-Reload-System/DungeonSlime/UI/GameSceneUI.cs b/Tutorials/2dShaders/src/02-Hot-Reload-System/DungeonSlime/UI/GameSceneUI.cs index 83424927..8c3dbf40 100644 --- a/Tutorials/2dShaders/src/02-Hot-Reload-System/DungeonSlime/UI/GameSceneUI.cs +++ b/Tutorials/2dShaders/src/02-Hot-Reload-System/DungeonSlime/UI/GameSceneUI.cs @@ -5,8 +5,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Audio; using Microsoft.Xna.Framework.Content; -using MonoGameGum; -using MonoGameGum.GueDeriving; +using Gum.GueDeriving; using MonoGameLibrary; using MonoGameLibrary.Graphics; @@ -63,8 +62,8 @@ public GameSceneUI() this.AddToRoot(); // Get a reference to the content manager that was registered with the - // GumService when it was original initialized. - ContentManager content = GumService.Default.ContentLoader.XnaContentManager; + // Gum.GumService when it was original initialized. + ContentManager content = Gum.GumService.Default.ContentLoader.XnaContentManager; // Use that content manager to load the sound effect and atlas for the // user interface elements @@ -327,7 +326,7 @@ public void HideGameOverPanel() /// A snapshot of the timing values for the current update cycle. public void Update(GameTime gameTime) { - GumService.Default.Update(gameTime); + Gum.GumService.Default.Update(gameTime); } /// @@ -335,6 +334,6 @@ public void Update(GameTime gameTime) /// public void Draw() { - GumService.Default.Draw(); + Gum.GumService.Default.Draw(); } } diff --git a/Tutorials/2dShaders/src/02-Hot-Reload-System/DungeonSlime/UI/OptionsSlider.cs b/Tutorials/2dShaders/src/02-Hot-Reload-System/DungeonSlime/UI/OptionsSlider.cs index 2900d983..2a1d183b 100644 --- a/Tutorials/2dShaders/src/02-Hot-Reload-System/DungeonSlime/UI/OptionsSlider.cs +++ b/Tutorials/2dShaders/src/02-Hot-Reload-System/DungeonSlime/UI/OptionsSlider.cs @@ -4,7 +4,7 @@ using Gum.Forms.Controls; using Gum.Managers; using Microsoft.Xna.Framework; -using MonoGameGum.GueDeriving; +using Gum.GueDeriving; using MonoGameLibrary.Graphics; namespace DungeonSlime.UI; @@ -18,7 +18,7 @@ public class OptionsSlider : Slider private TextRuntime _textInstance; // Reference to the rectangle that visually represents the current value - private ColoredRectangleRuntime _fillRectangle; + private RectangleRuntime _fillRectangle; /// /// Gets or sets the text label for this slider. @@ -128,7 +128,9 @@ public OptionsSlider(TextureAtlas atlas) middleBackground.AddChild(trackInstance); // Create the fill rectangle that visually displays the current value - _fillRectangle = new ColoredRectangleRuntime(); + _fillRectangle = new RectangleRuntime(); + _fillRectangle.IsFilled = true; + _fillRectangle.StrokeWidth = 0; _fillRectangle.Dock(Gum.Wireframe.Dock.Left); _fillRectangle.Width = 90f; // Default to 90% - will be updated by value changes _fillRectangle.WidthUnits = DimensionUnitType.PercentageOfParent; @@ -178,7 +180,7 @@ public OptionsSlider(TextureAtlas atlas) offBackground.Color = unfocusedColor; middleBackground.Color = unfocusedColor; maxBackground.Color = unfocusedColor; - _fillRectangle.Color = unfocusedColor; + _fillRectangle.FillColor = unfocusedColor; }; sliderCategory.States.Add(enabled); @@ -193,7 +195,7 @@ public OptionsSlider(TextureAtlas atlas) offBackground.Color = focusedColor; middleBackground.Color = focusedColor; maxBackground.Color = focusedColor; - _fillRectangle.Color = focusedColor; + _fillRectangle.FillColor = focusedColor; }; sliderCategory.States.Add(focused); diff --git a/Tutorials/2dShaders/src/03-The-Material-Class/DungeonSlime/DungeonSlime.csproj b/Tutorials/2dShaders/src/03-The-Material-Class/DungeonSlime/DungeonSlime.csproj index 6a8a6989..0b129d28 100644 --- a/Tutorials/2dShaders/src/03-The-Material-Class/DungeonSlime/DungeonSlime.csproj +++ b/Tutorials/2dShaders/src/03-The-Material-Class/DungeonSlime/DungeonSlime.csproj @@ -26,7 +26,7 @@ - + diff --git a/Tutorials/2dShaders/src/03-The-Material-Class/DungeonSlime/Game1.cs b/Tutorials/2dShaders/src/03-The-Material-Class/DungeonSlime/Game1.cs index b061a04e..69109e52 100644 --- a/Tutorials/2dShaders/src/03-The-Material-Class/DungeonSlime/Game1.cs +++ b/Tutorials/2dShaders/src/03-The-Material-Class/DungeonSlime/Game1.cs @@ -1,7 +1,6 @@ using DungeonSlime.Scenes; using Microsoft.Xna.Framework.Media; using MonoGameLibrary; -using MonoGameGum; using Gum.Forms; using Gum.Forms.Controls; @@ -34,34 +33,34 @@ protected override void Initialize() private void InitializeGum() { // Initialize the Gum service - GumService.Default.Initialize(this, DefaultVisualsVersion.V3); + Gum.GumService.Default.Initialize(this, DefaultVisualsVersion.V3); // Tell the Gum service which content manager to use. We will tell it to // use the global content manager from our Core. - GumService.Default.ContentLoader.XnaContentManager = Core.Content; + Gum.GumService.Default.ContentLoader.XnaContentManager = Core.Content; // Register keyboard input for UI control. - FrameworkElement.KeyboardsForUiControl.Add(GumService.Default.Keyboard); + FrameworkElement.KeyboardsForUiControl.Add(Gum.GumService.Default.Keyboard); // Register gamepad input for Ui control. - FrameworkElement.GamePadsForUiControl.AddRange(GumService.Default.Gamepads); + FrameworkElement.GamePadsForUiControl.AddRange(Gum.GumService.Default.Gamepads); // Customize the tab reverse UI navigation to also trigger when the keyboard // Up arrow key is pushed. FrameworkElement.TabReverseKeyCombos.Add( - new KeyCombo() { PushedKey = Microsoft.Xna.Framework.Input.Keys.Up }); + new KeyCombo() { PushedKey = Gum.Forms.Input.Keys.Up }); // Customize the tab UI navigation to also trigger when the keyboard // Down arrow key is pushed. FrameworkElement.TabKeyCombos.Add( - new KeyCombo() { PushedKey = Microsoft.Xna.Framework.Input.Keys.Down }); + new KeyCombo() { PushedKey = Gum.Forms.Input.Keys.Down }); // The assets created for the UI were done so at 1/4th the size to keep the size of the // texture atlas small. So we will set the default canvas size to be 1/4th the size of // the game's resolution then tell gum to zoom in by a factor of 4. - GumService.Default.CanvasWidth = GraphicsDevice.PresentationParameters.BackBufferWidth / 4.0f; - GumService.Default.CanvasHeight = GraphicsDevice.PresentationParameters.BackBufferHeight / 4.0f; - GumService.Default.Renderer.Camera.Zoom = 4.0f; + Gum.GumService.Default.CanvasWidth = GraphicsDevice.PresentationParameters.BackBufferWidth / 4.0f; + Gum.GumService.Default.CanvasHeight = GraphicsDevice.PresentationParameters.BackBufferHeight / 4.0f; + Gum.GumService.Default.Renderer.Camera.Zoom = 4.0f; } protected override void LoadContent() diff --git a/Tutorials/2dShaders/src/03-The-Material-Class/DungeonSlime/Scenes/GameScene.cs b/Tutorials/2dShaders/src/03-The-Material-Class/DungeonSlime/Scenes/GameScene.cs index 58bade7e..75137748 100644 --- a/Tutorials/2dShaders/src/03-The-Material-Class/DungeonSlime/Scenes/GameScene.cs +++ b/Tutorials/2dShaders/src/03-The-Material-Class/DungeonSlime/Scenes/GameScene.cs @@ -4,7 +4,6 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Audio; using Microsoft.Xna.Framework.Graphics; -using MonoGameGum; using MonoGameLibrary; using MonoGameLibrary.Content; using MonoGameLibrary.Graphics; @@ -74,7 +73,7 @@ public override void Initialize() // Create any UI elements from the root element created in previous // scenes - GumService.Default.Root.Children.Clear(); + Gum.GumService.Default.Root.Children.Clear(); // Initialize the user interface for the game scene. InitializeUI(); @@ -87,7 +86,7 @@ private void InitializeUI() { // Clear out any previous UI element incase we came here // from a different scene. - GumService.Default.Root.Children.Clear(); + Gum.GumService.Default.Root.Children.Clear(); // Create the game scene ui instance. _ui = new GameSceneUI(); diff --git a/Tutorials/2dShaders/src/03-The-Material-Class/DungeonSlime/Scenes/TitleScene.cs b/Tutorials/2dShaders/src/03-The-Material-Class/DungeonSlime/Scenes/TitleScene.cs index 82410848..60a46577 100644 --- a/Tutorials/2dShaders/src/03-The-Material-Class/DungeonSlime/Scenes/TitleScene.cs +++ b/Tutorials/2dShaders/src/03-The-Material-Class/DungeonSlime/Scenes/TitleScene.cs @@ -4,8 +4,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Audio; using Microsoft.Xna.Framework.Graphics; -using MonoGameGum; -using MonoGameGum.GueDeriving; +using Gum.GueDeriving; using MonoGameLibrary; using MonoGameLibrary.Graphics; using MonoGameLibrary.Scenes; @@ -282,7 +281,7 @@ private void InitializeUI() { // Clear out any previous UI in case we came here from // a different screen: - GumService.Default.Root.Children.Clear(); + Gum.GumService.Default.Root.Children.Clear(); CreateTitlePanel(); CreateOptionsPanel(); @@ -301,7 +300,7 @@ public override void Update(GameTime gameTime) _backgroundOffset.X %= _backgroundPattern.Width; _backgroundOffset.Y %= _backgroundPattern.Height; - GumService.Default.Update(gameTime); + Gum.GumService.Default.Update(gameTime); } public override void Draw(GameTime gameTime) @@ -340,6 +339,6 @@ public override void Draw(GameTime gameTime) Core.SpriteBatch.End(); } - GumService.Default.Draw(); + Gum.GumService.Default.Draw(); } } diff --git a/Tutorials/2dShaders/src/03-The-Material-Class/DungeonSlime/UI/AnimatedButton.cs b/Tutorials/2dShaders/src/03-The-Material-Class/DungeonSlime/UI/AnimatedButton.cs index a98baf1a..1d5eff99 100644 --- a/Tutorials/2dShaders/src/03-The-Material-Class/DungeonSlime/UI/AnimatedButton.cs +++ b/Tutorials/2dShaders/src/03-The-Material-Class/DungeonSlime/UI/AnimatedButton.cs @@ -6,7 +6,7 @@ using Gum.Graphics.Animation; using Gum.Managers; using Microsoft.Xna.Framework.Input; -using MonoGameGum.GueDeriving; +using Gum.GueDeriving; using MonoGameLibrary.Graphics; namespace DungeonSlime.UI; @@ -141,12 +141,12 @@ public AnimatedButton(TextureAtlas atlas) /// private void HandleKeyDown(object sender, KeyEventArgs e) { - if (e.Key == Keys.Left) + if (e.Key == Gum.Forms.Input.Keys.Left) { // Left arrow navigates to previous control HandleTab(TabDirection.Up, loop: true); } - if (e.Key == Keys.Right) + if (e.Key == Gum.Forms.Input.Keys.Right) { // Right arrow navigates to next control HandleTab(TabDirection.Down, loop: true); diff --git a/Tutorials/2dShaders/src/03-The-Material-Class/DungeonSlime/UI/GameSceneUI.cs b/Tutorials/2dShaders/src/03-The-Material-Class/DungeonSlime/UI/GameSceneUI.cs index 83424927..8c3dbf40 100644 --- a/Tutorials/2dShaders/src/03-The-Material-Class/DungeonSlime/UI/GameSceneUI.cs +++ b/Tutorials/2dShaders/src/03-The-Material-Class/DungeonSlime/UI/GameSceneUI.cs @@ -5,8 +5,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Audio; using Microsoft.Xna.Framework.Content; -using MonoGameGum; -using MonoGameGum.GueDeriving; +using Gum.GueDeriving; using MonoGameLibrary; using MonoGameLibrary.Graphics; @@ -63,8 +62,8 @@ public GameSceneUI() this.AddToRoot(); // Get a reference to the content manager that was registered with the - // GumService when it was original initialized. - ContentManager content = GumService.Default.ContentLoader.XnaContentManager; + // Gum.GumService when it was original initialized. + ContentManager content = Gum.GumService.Default.ContentLoader.XnaContentManager; // Use that content manager to load the sound effect and atlas for the // user interface elements @@ -327,7 +326,7 @@ public void HideGameOverPanel() /// A snapshot of the timing values for the current update cycle. public void Update(GameTime gameTime) { - GumService.Default.Update(gameTime); + Gum.GumService.Default.Update(gameTime); } /// @@ -335,6 +334,6 @@ public void Update(GameTime gameTime) /// public void Draw() { - GumService.Default.Draw(); + Gum.GumService.Default.Draw(); } } diff --git a/Tutorials/2dShaders/src/03-The-Material-Class/DungeonSlime/UI/OptionsSlider.cs b/Tutorials/2dShaders/src/03-The-Material-Class/DungeonSlime/UI/OptionsSlider.cs index 2900d983..2a1d183b 100644 --- a/Tutorials/2dShaders/src/03-The-Material-Class/DungeonSlime/UI/OptionsSlider.cs +++ b/Tutorials/2dShaders/src/03-The-Material-Class/DungeonSlime/UI/OptionsSlider.cs @@ -4,7 +4,7 @@ using Gum.Forms.Controls; using Gum.Managers; using Microsoft.Xna.Framework; -using MonoGameGum.GueDeriving; +using Gum.GueDeriving; using MonoGameLibrary.Graphics; namespace DungeonSlime.UI; @@ -18,7 +18,7 @@ public class OptionsSlider : Slider private TextRuntime _textInstance; // Reference to the rectangle that visually represents the current value - private ColoredRectangleRuntime _fillRectangle; + private RectangleRuntime _fillRectangle; /// /// Gets or sets the text label for this slider. @@ -128,7 +128,9 @@ public OptionsSlider(TextureAtlas atlas) middleBackground.AddChild(trackInstance); // Create the fill rectangle that visually displays the current value - _fillRectangle = new ColoredRectangleRuntime(); + _fillRectangle = new RectangleRuntime(); + _fillRectangle.IsFilled = true; + _fillRectangle.StrokeWidth = 0; _fillRectangle.Dock(Gum.Wireframe.Dock.Left); _fillRectangle.Width = 90f; // Default to 90% - will be updated by value changes _fillRectangle.WidthUnits = DimensionUnitType.PercentageOfParent; @@ -178,7 +180,7 @@ public OptionsSlider(TextureAtlas atlas) offBackground.Color = unfocusedColor; middleBackground.Color = unfocusedColor; maxBackground.Color = unfocusedColor; - _fillRectangle.Color = unfocusedColor; + _fillRectangle.FillColor = unfocusedColor; }; sliderCategory.States.Add(enabled); @@ -193,7 +195,7 @@ public OptionsSlider(TextureAtlas atlas) offBackground.Color = focusedColor; middleBackground.Color = focusedColor; maxBackground.Color = focusedColor; - _fillRectangle.Color = focusedColor; + _fillRectangle.FillColor = focusedColor; }; sliderCategory.States.Add(focused); diff --git a/Tutorials/2dShaders/src/04-Debug-UI/DungeonSlime/DungeonSlime.csproj b/Tutorials/2dShaders/src/04-Debug-UI/DungeonSlime/DungeonSlime.csproj index 6a8a6989..0b129d28 100644 --- a/Tutorials/2dShaders/src/04-Debug-UI/DungeonSlime/DungeonSlime.csproj +++ b/Tutorials/2dShaders/src/04-Debug-UI/DungeonSlime/DungeonSlime.csproj @@ -26,7 +26,7 @@ - + diff --git a/Tutorials/2dShaders/src/04-Debug-UI/DungeonSlime/Game1.cs b/Tutorials/2dShaders/src/04-Debug-UI/DungeonSlime/Game1.cs index b061a04e..69109e52 100644 --- a/Tutorials/2dShaders/src/04-Debug-UI/DungeonSlime/Game1.cs +++ b/Tutorials/2dShaders/src/04-Debug-UI/DungeonSlime/Game1.cs @@ -1,7 +1,6 @@ using DungeonSlime.Scenes; using Microsoft.Xna.Framework.Media; using MonoGameLibrary; -using MonoGameGum; using Gum.Forms; using Gum.Forms.Controls; @@ -34,34 +33,34 @@ protected override void Initialize() private void InitializeGum() { // Initialize the Gum service - GumService.Default.Initialize(this, DefaultVisualsVersion.V3); + Gum.GumService.Default.Initialize(this, DefaultVisualsVersion.V3); // Tell the Gum service which content manager to use. We will tell it to // use the global content manager from our Core. - GumService.Default.ContentLoader.XnaContentManager = Core.Content; + Gum.GumService.Default.ContentLoader.XnaContentManager = Core.Content; // Register keyboard input for UI control. - FrameworkElement.KeyboardsForUiControl.Add(GumService.Default.Keyboard); + FrameworkElement.KeyboardsForUiControl.Add(Gum.GumService.Default.Keyboard); // Register gamepad input for Ui control. - FrameworkElement.GamePadsForUiControl.AddRange(GumService.Default.Gamepads); + FrameworkElement.GamePadsForUiControl.AddRange(Gum.GumService.Default.Gamepads); // Customize the tab reverse UI navigation to also trigger when the keyboard // Up arrow key is pushed. FrameworkElement.TabReverseKeyCombos.Add( - new KeyCombo() { PushedKey = Microsoft.Xna.Framework.Input.Keys.Up }); + new KeyCombo() { PushedKey = Gum.Forms.Input.Keys.Up }); // Customize the tab UI navigation to also trigger when the keyboard // Down arrow key is pushed. FrameworkElement.TabKeyCombos.Add( - new KeyCombo() { PushedKey = Microsoft.Xna.Framework.Input.Keys.Down }); + new KeyCombo() { PushedKey = Gum.Forms.Input.Keys.Down }); // The assets created for the UI were done so at 1/4th the size to keep the size of the // texture atlas small. So we will set the default canvas size to be 1/4th the size of // the game's resolution then tell gum to zoom in by a factor of 4. - GumService.Default.CanvasWidth = GraphicsDevice.PresentationParameters.BackBufferWidth / 4.0f; - GumService.Default.CanvasHeight = GraphicsDevice.PresentationParameters.BackBufferHeight / 4.0f; - GumService.Default.Renderer.Camera.Zoom = 4.0f; + Gum.GumService.Default.CanvasWidth = GraphicsDevice.PresentationParameters.BackBufferWidth / 4.0f; + Gum.GumService.Default.CanvasHeight = GraphicsDevice.PresentationParameters.BackBufferHeight / 4.0f; + Gum.GumService.Default.Renderer.Camera.Zoom = 4.0f; } protected override void LoadContent() diff --git a/Tutorials/2dShaders/src/04-Debug-UI/DungeonSlime/Scenes/GameScene.cs b/Tutorials/2dShaders/src/04-Debug-UI/DungeonSlime/Scenes/GameScene.cs index 0e0eeb9f..28dd839e 100644 --- a/Tutorials/2dShaders/src/04-Debug-UI/DungeonSlime/Scenes/GameScene.cs +++ b/Tutorials/2dShaders/src/04-Debug-UI/DungeonSlime/Scenes/GameScene.cs @@ -5,7 +5,6 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Audio; using Microsoft.Xna.Framework.Graphics; -using MonoGameGum; using MonoGameLibrary; using MonoGameLibrary.Content; using MonoGameLibrary.Graphics; @@ -75,7 +74,7 @@ public override void Initialize() // Create any UI elements from the root element created in previous // scenes - GumService.Default.Root.Children.Clear(); + Gum.GumService.Default.Root.Children.Clear(); // Initialize the user interface for the game scene. InitializeUI(); @@ -88,7 +87,7 @@ private void InitializeUI() { // Clear out any previous UI element incase we came here // from a different scene. - GumService.Default.Root.Children.Clear(); + Gum.GumService.Default.Root.Children.Clear(); // Create the game scene ui instance. _ui = new GameSceneUI(); diff --git a/Tutorials/2dShaders/src/04-Debug-UI/DungeonSlime/Scenes/TitleScene.cs b/Tutorials/2dShaders/src/04-Debug-UI/DungeonSlime/Scenes/TitleScene.cs index 82410848..60a46577 100644 --- a/Tutorials/2dShaders/src/04-Debug-UI/DungeonSlime/Scenes/TitleScene.cs +++ b/Tutorials/2dShaders/src/04-Debug-UI/DungeonSlime/Scenes/TitleScene.cs @@ -4,8 +4,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Audio; using Microsoft.Xna.Framework.Graphics; -using MonoGameGum; -using MonoGameGum.GueDeriving; +using Gum.GueDeriving; using MonoGameLibrary; using MonoGameLibrary.Graphics; using MonoGameLibrary.Scenes; @@ -282,7 +281,7 @@ private void InitializeUI() { // Clear out any previous UI in case we came here from // a different screen: - GumService.Default.Root.Children.Clear(); + Gum.GumService.Default.Root.Children.Clear(); CreateTitlePanel(); CreateOptionsPanel(); @@ -301,7 +300,7 @@ public override void Update(GameTime gameTime) _backgroundOffset.X %= _backgroundPattern.Width; _backgroundOffset.Y %= _backgroundPattern.Height; - GumService.Default.Update(gameTime); + Gum.GumService.Default.Update(gameTime); } public override void Draw(GameTime gameTime) @@ -340,6 +339,6 @@ public override void Draw(GameTime gameTime) Core.SpriteBatch.End(); } - GumService.Default.Draw(); + Gum.GumService.Default.Draw(); } } diff --git a/Tutorials/2dShaders/src/04-Debug-UI/DungeonSlime/UI/AnimatedButton.cs b/Tutorials/2dShaders/src/04-Debug-UI/DungeonSlime/UI/AnimatedButton.cs index a98baf1a..1d5eff99 100644 --- a/Tutorials/2dShaders/src/04-Debug-UI/DungeonSlime/UI/AnimatedButton.cs +++ b/Tutorials/2dShaders/src/04-Debug-UI/DungeonSlime/UI/AnimatedButton.cs @@ -6,7 +6,7 @@ using Gum.Graphics.Animation; using Gum.Managers; using Microsoft.Xna.Framework.Input; -using MonoGameGum.GueDeriving; +using Gum.GueDeriving; using MonoGameLibrary.Graphics; namespace DungeonSlime.UI; @@ -141,12 +141,12 @@ public AnimatedButton(TextureAtlas atlas) /// private void HandleKeyDown(object sender, KeyEventArgs e) { - if (e.Key == Keys.Left) + if (e.Key == Gum.Forms.Input.Keys.Left) { // Left arrow navigates to previous control HandleTab(TabDirection.Up, loop: true); } - if (e.Key == Keys.Right) + if (e.Key == Gum.Forms.Input.Keys.Right) { // Right arrow navigates to next control HandleTab(TabDirection.Down, loop: true); diff --git a/Tutorials/2dShaders/src/04-Debug-UI/DungeonSlime/UI/GameSceneUI.cs b/Tutorials/2dShaders/src/04-Debug-UI/DungeonSlime/UI/GameSceneUI.cs index 83424927..8c3dbf40 100644 --- a/Tutorials/2dShaders/src/04-Debug-UI/DungeonSlime/UI/GameSceneUI.cs +++ b/Tutorials/2dShaders/src/04-Debug-UI/DungeonSlime/UI/GameSceneUI.cs @@ -5,8 +5,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Audio; using Microsoft.Xna.Framework.Content; -using MonoGameGum; -using MonoGameGum.GueDeriving; +using Gum.GueDeriving; using MonoGameLibrary; using MonoGameLibrary.Graphics; @@ -63,8 +62,8 @@ public GameSceneUI() this.AddToRoot(); // Get a reference to the content manager that was registered with the - // GumService when it was original initialized. - ContentManager content = GumService.Default.ContentLoader.XnaContentManager; + // Gum.GumService when it was original initialized. + ContentManager content = Gum.GumService.Default.ContentLoader.XnaContentManager; // Use that content manager to load the sound effect and atlas for the // user interface elements @@ -327,7 +326,7 @@ public void HideGameOverPanel() /// A snapshot of the timing values for the current update cycle. public void Update(GameTime gameTime) { - GumService.Default.Update(gameTime); + Gum.GumService.Default.Update(gameTime); } /// @@ -335,6 +334,6 @@ public void Update(GameTime gameTime) /// public void Draw() { - GumService.Default.Draw(); + Gum.GumService.Default.Draw(); } } diff --git a/Tutorials/2dShaders/src/04-Debug-UI/DungeonSlime/UI/OptionsSlider.cs b/Tutorials/2dShaders/src/04-Debug-UI/DungeonSlime/UI/OptionsSlider.cs index 2900d983..2a1d183b 100644 --- a/Tutorials/2dShaders/src/04-Debug-UI/DungeonSlime/UI/OptionsSlider.cs +++ b/Tutorials/2dShaders/src/04-Debug-UI/DungeonSlime/UI/OptionsSlider.cs @@ -4,7 +4,7 @@ using Gum.Forms.Controls; using Gum.Managers; using Microsoft.Xna.Framework; -using MonoGameGum.GueDeriving; +using Gum.GueDeriving; using MonoGameLibrary.Graphics; namespace DungeonSlime.UI; @@ -18,7 +18,7 @@ public class OptionsSlider : Slider private TextRuntime _textInstance; // Reference to the rectangle that visually represents the current value - private ColoredRectangleRuntime _fillRectangle; + private RectangleRuntime _fillRectangle; /// /// Gets or sets the text label for this slider. @@ -128,7 +128,9 @@ public OptionsSlider(TextureAtlas atlas) middleBackground.AddChild(trackInstance); // Create the fill rectangle that visually displays the current value - _fillRectangle = new ColoredRectangleRuntime(); + _fillRectangle = new RectangleRuntime(); + _fillRectangle.IsFilled = true; + _fillRectangle.StrokeWidth = 0; _fillRectangle.Dock(Gum.Wireframe.Dock.Left); _fillRectangle.Width = 90f; // Default to 90% - will be updated by value changes _fillRectangle.WidthUnits = DimensionUnitType.PercentageOfParent; @@ -178,7 +180,7 @@ public OptionsSlider(TextureAtlas atlas) offBackground.Color = unfocusedColor; middleBackground.Color = unfocusedColor; maxBackground.Color = unfocusedColor; - _fillRectangle.Color = unfocusedColor; + _fillRectangle.FillColor = unfocusedColor; }; sliderCategory.States.Add(enabled); @@ -193,7 +195,7 @@ public OptionsSlider(TextureAtlas atlas) offBackground.Color = focusedColor; middleBackground.Color = focusedColor; maxBackground.Color = focusedColor; - _fillRectangle.Color = focusedColor; + _fillRectangle.FillColor = focusedColor; }; sliderCategory.States.Add(focused); diff --git a/Tutorials/2dShaders/src/05-Transition-Effect/DungeonSlime/DungeonSlime.csproj b/Tutorials/2dShaders/src/05-Transition-Effect/DungeonSlime/DungeonSlime.csproj index a6df81f4..86bfb71b 100644 --- a/Tutorials/2dShaders/src/05-Transition-Effect/DungeonSlime/DungeonSlime.csproj +++ b/Tutorials/2dShaders/src/05-Transition-Effect/DungeonSlime/DungeonSlime.csproj @@ -26,7 +26,7 @@ - + diff --git a/Tutorials/2dShaders/src/05-Transition-Effect/DungeonSlime/Game1.cs b/Tutorials/2dShaders/src/05-Transition-Effect/DungeonSlime/Game1.cs index 9b4ed366..c0ee3f0a 100644 --- a/Tutorials/2dShaders/src/05-Transition-Effect/DungeonSlime/Game1.cs +++ b/Tutorials/2dShaders/src/05-Transition-Effect/DungeonSlime/Game1.cs @@ -2,7 +2,6 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Media; using MonoGameLibrary; -using MonoGameGum; using Gum.Forms; using Gum.Forms.Controls; @@ -37,34 +36,34 @@ protected override void Initialize() private void InitializeGum() { // Initialize the Gum service - GumService.Default.Initialize(this, DefaultVisualsVersion.V3); + Gum.GumService.Default.Initialize(this, DefaultVisualsVersion.V3); // Tell the Gum service which content manager to use. We will tell it to // use the global content manager from our Core. - GumService.Default.ContentLoader.XnaContentManager = Core.Content; + Gum.GumService.Default.ContentLoader.XnaContentManager = Core.Content; // Register keyboard input for UI control. - FrameworkElement.KeyboardsForUiControl.Add(GumService.Default.Keyboard); + FrameworkElement.KeyboardsForUiControl.Add(Gum.GumService.Default.Keyboard); // Register gamepad input for Ui control. - FrameworkElement.GamePadsForUiControl.AddRange(GumService.Default.Gamepads); + FrameworkElement.GamePadsForUiControl.AddRange(Gum.GumService.Default.Gamepads); // Customize the tab reverse UI navigation to also trigger when the keyboard // Up arrow key is pushed. FrameworkElement.TabReverseKeyCombos.Add( - new KeyCombo() { PushedKey = Microsoft.Xna.Framework.Input.Keys.Up }); + new KeyCombo() { PushedKey = Gum.Forms.Input.Keys.Up }); // Customize the tab UI navigation to also trigger when the keyboard // Down arrow key is pushed. FrameworkElement.TabKeyCombos.Add( - new KeyCombo() { PushedKey = Microsoft.Xna.Framework.Input.Keys.Down }); + new KeyCombo() { PushedKey = Gum.Forms.Input.Keys.Down }); // The assets created for the UI were done so at 1/4th the size to keep the size of the // texture atlas small. So we will set the default canvas size to be 1/4th the size of // the game's resolution then tell gum to zoom in by a factor of 4. - GumService.Default.CanvasWidth = GraphicsDevice.PresentationParameters.BackBufferWidth / 4.0f; - GumService.Default.CanvasHeight = GraphicsDevice.PresentationParameters.BackBufferHeight / 4.0f; - GumService.Default.Renderer.Camera.Zoom = 4.0f; + Gum.GumService.Default.CanvasWidth = GraphicsDevice.PresentationParameters.BackBufferWidth / 4.0f; + Gum.GumService.Default.CanvasHeight = GraphicsDevice.PresentationParameters.BackBufferHeight / 4.0f; + Gum.GumService.Default.Renderer.Camera.Zoom = 4.0f; } protected override void LoadContent() diff --git a/Tutorials/2dShaders/src/05-Transition-Effect/DungeonSlime/Scenes/GameScene.cs b/Tutorials/2dShaders/src/05-Transition-Effect/DungeonSlime/Scenes/GameScene.cs index b47f80c0..d93ece33 100644 --- a/Tutorials/2dShaders/src/05-Transition-Effect/DungeonSlime/Scenes/GameScene.cs +++ b/Tutorials/2dShaders/src/05-Transition-Effect/DungeonSlime/Scenes/GameScene.cs @@ -5,7 +5,6 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Audio; using Microsoft.Xna.Framework.Graphics; -using MonoGameGum; using MonoGameLibrary; using MonoGameLibrary.Content; using MonoGameLibrary.Graphics; @@ -75,7 +74,7 @@ public override void Initialize() // Create any UI elements from the root element created in previous // scenes - GumService.Default.Root.Children.Clear(); + Gum.GumService.Default.Root.Children.Clear(); // Initialize the user interface for the game scene. InitializeUI(); @@ -88,7 +87,7 @@ private void InitializeUI() { // Clear out any previous UI element incase we came here // from a different scene. - GumService.Default.Root.Children.Clear(); + Gum.GumService.Default.Root.Children.Clear(); // Create the game scene ui instance. _ui = new GameSceneUI(); diff --git a/Tutorials/2dShaders/src/05-Transition-Effect/DungeonSlime/Scenes/TitleScene.cs b/Tutorials/2dShaders/src/05-Transition-Effect/DungeonSlime/Scenes/TitleScene.cs index 82410848..60a46577 100644 --- a/Tutorials/2dShaders/src/05-Transition-Effect/DungeonSlime/Scenes/TitleScene.cs +++ b/Tutorials/2dShaders/src/05-Transition-Effect/DungeonSlime/Scenes/TitleScene.cs @@ -4,8 +4,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Audio; using Microsoft.Xna.Framework.Graphics; -using MonoGameGum; -using MonoGameGum.GueDeriving; +using Gum.GueDeriving; using MonoGameLibrary; using MonoGameLibrary.Graphics; using MonoGameLibrary.Scenes; @@ -282,7 +281,7 @@ private void InitializeUI() { // Clear out any previous UI in case we came here from // a different screen: - GumService.Default.Root.Children.Clear(); + Gum.GumService.Default.Root.Children.Clear(); CreateTitlePanel(); CreateOptionsPanel(); @@ -301,7 +300,7 @@ public override void Update(GameTime gameTime) _backgroundOffset.X %= _backgroundPattern.Width; _backgroundOffset.Y %= _backgroundPattern.Height; - GumService.Default.Update(gameTime); + Gum.GumService.Default.Update(gameTime); } public override void Draw(GameTime gameTime) @@ -340,6 +339,6 @@ public override void Draw(GameTime gameTime) Core.SpriteBatch.End(); } - GumService.Default.Draw(); + Gum.GumService.Default.Draw(); } } diff --git a/Tutorials/2dShaders/src/05-Transition-Effect/DungeonSlime/UI/AnimatedButton.cs b/Tutorials/2dShaders/src/05-Transition-Effect/DungeonSlime/UI/AnimatedButton.cs index a98baf1a..1d5eff99 100644 --- a/Tutorials/2dShaders/src/05-Transition-Effect/DungeonSlime/UI/AnimatedButton.cs +++ b/Tutorials/2dShaders/src/05-Transition-Effect/DungeonSlime/UI/AnimatedButton.cs @@ -6,7 +6,7 @@ using Gum.Graphics.Animation; using Gum.Managers; using Microsoft.Xna.Framework.Input; -using MonoGameGum.GueDeriving; +using Gum.GueDeriving; using MonoGameLibrary.Graphics; namespace DungeonSlime.UI; @@ -141,12 +141,12 @@ public AnimatedButton(TextureAtlas atlas) /// private void HandleKeyDown(object sender, KeyEventArgs e) { - if (e.Key == Keys.Left) + if (e.Key == Gum.Forms.Input.Keys.Left) { // Left arrow navigates to previous control HandleTab(TabDirection.Up, loop: true); } - if (e.Key == Keys.Right) + if (e.Key == Gum.Forms.Input.Keys.Right) { // Right arrow navigates to next control HandleTab(TabDirection.Down, loop: true); diff --git a/Tutorials/2dShaders/src/05-Transition-Effect/DungeonSlime/UI/GameSceneUI.cs b/Tutorials/2dShaders/src/05-Transition-Effect/DungeonSlime/UI/GameSceneUI.cs index 83424927..8c3dbf40 100644 --- a/Tutorials/2dShaders/src/05-Transition-Effect/DungeonSlime/UI/GameSceneUI.cs +++ b/Tutorials/2dShaders/src/05-Transition-Effect/DungeonSlime/UI/GameSceneUI.cs @@ -5,8 +5,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Audio; using Microsoft.Xna.Framework.Content; -using MonoGameGum; -using MonoGameGum.GueDeriving; +using Gum.GueDeriving; using MonoGameLibrary; using MonoGameLibrary.Graphics; @@ -63,8 +62,8 @@ public GameSceneUI() this.AddToRoot(); // Get a reference to the content manager that was registered with the - // GumService when it was original initialized. - ContentManager content = GumService.Default.ContentLoader.XnaContentManager; + // Gum.GumService when it was original initialized. + ContentManager content = Gum.GumService.Default.ContentLoader.XnaContentManager; // Use that content manager to load the sound effect and atlas for the // user interface elements @@ -327,7 +326,7 @@ public void HideGameOverPanel() /// A snapshot of the timing values for the current update cycle. public void Update(GameTime gameTime) { - GumService.Default.Update(gameTime); + Gum.GumService.Default.Update(gameTime); } /// @@ -335,6 +334,6 @@ public void Update(GameTime gameTime) /// public void Draw() { - GumService.Default.Draw(); + Gum.GumService.Default.Draw(); } } diff --git a/Tutorials/2dShaders/src/05-Transition-Effect/DungeonSlime/UI/OptionsSlider.cs b/Tutorials/2dShaders/src/05-Transition-Effect/DungeonSlime/UI/OptionsSlider.cs index 2900d983..2a1d183b 100644 --- a/Tutorials/2dShaders/src/05-Transition-Effect/DungeonSlime/UI/OptionsSlider.cs +++ b/Tutorials/2dShaders/src/05-Transition-Effect/DungeonSlime/UI/OptionsSlider.cs @@ -4,7 +4,7 @@ using Gum.Forms.Controls; using Gum.Managers; using Microsoft.Xna.Framework; -using MonoGameGum.GueDeriving; +using Gum.GueDeriving; using MonoGameLibrary.Graphics; namespace DungeonSlime.UI; @@ -18,7 +18,7 @@ public class OptionsSlider : Slider private TextRuntime _textInstance; // Reference to the rectangle that visually represents the current value - private ColoredRectangleRuntime _fillRectangle; + private RectangleRuntime _fillRectangle; /// /// Gets or sets the text label for this slider. @@ -128,7 +128,9 @@ public OptionsSlider(TextureAtlas atlas) middleBackground.AddChild(trackInstance); // Create the fill rectangle that visually displays the current value - _fillRectangle = new ColoredRectangleRuntime(); + _fillRectangle = new RectangleRuntime(); + _fillRectangle.IsFilled = true; + _fillRectangle.StrokeWidth = 0; _fillRectangle.Dock(Gum.Wireframe.Dock.Left); _fillRectangle.Width = 90f; // Default to 90% - will be updated by value changes _fillRectangle.WidthUnits = DimensionUnitType.PercentageOfParent; @@ -178,7 +180,7 @@ public OptionsSlider(TextureAtlas atlas) offBackground.Color = unfocusedColor; middleBackground.Color = unfocusedColor; maxBackground.Color = unfocusedColor; - _fillRectangle.Color = unfocusedColor; + _fillRectangle.FillColor = unfocusedColor; }; sliderCategory.States.Add(enabled); @@ -193,7 +195,7 @@ public OptionsSlider(TextureAtlas atlas) offBackground.Color = focusedColor; middleBackground.Color = focusedColor; maxBackground.Color = focusedColor; - _fillRectangle.Color = focusedColor; + _fillRectangle.FillColor = focusedColor; }; sliderCategory.States.Add(focused); diff --git a/Tutorials/2dShaders/src/06-Color-Swap-Effect/DungeonSlime/DungeonSlime.csproj b/Tutorials/2dShaders/src/06-Color-Swap-Effect/DungeonSlime/DungeonSlime.csproj index 54eea451..78e621f9 100644 --- a/Tutorials/2dShaders/src/06-Color-Swap-Effect/DungeonSlime/DungeonSlime.csproj +++ b/Tutorials/2dShaders/src/06-Color-Swap-Effect/DungeonSlime/DungeonSlime.csproj @@ -26,7 +26,7 @@ - + diff --git a/Tutorials/2dShaders/src/06-Color-Swap-Effect/DungeonSlime/Game1.cs b/Tutorials/2dShaders/src/06-Color-Swap-Effect/DungeonSlime/Game1.cs index 15762bbf..bbc9831d 100644 --- a/Tutorials/2dShaders/src/06-Color-Swap-Effect/DungeonSlime/Game1.cs +++ b/Tutorials/2dShaders/src/06-Color-Swap-Effect/DungeonSlime/Game1.cs @@ -2,7 +2,6 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Media; using MonoGameLibrary; -using MonoGameGum; using Gum.Forms; using Gum.Forms.Controls; @@ -35,34 +34,34 @@ protected override void Initialize() private void InitializeGum() { // Initialize the Gum service - GumService.Default.Initialize(this, DefaultVisualsVersion.V3); + Gum.GumService.Default.Initialize(this, DefaultVisualsVersion.V3); // Tell the Gum service which content manager to use. We will tell it to // use the global content manager from our Core. - GumService.Default.ContentLoader.XnaContentManager = Core.Content; + Gum.GumService.Default.ContentLoader.XnaContentManager = Core.Content; // Register keyboard input for UI control. - FrameworkElement.KeyboardsForUiControl.Add(GumService.Default.Keyboard); + FrameworkElement.KeyboardsForUiControl.Add(Gum.GumService.Default.Keyboard); // Register gamepad input for Ui control. - FrameworkElement.GamePadsForUiControl.AddRange(GumService.Default.Gamepads); + FrameworkElement.GamePadsForUiControl.AddRange(Gum.GumService.Default.Gamepads); // Customize the tab reverse UI navigation to also trigger when the keyboard // Up arrow key is pushed. FrameworkElement.TabReverseKeyCombos.Add( - new KeyCombo() { PushedKey = Microsoft.Xna.Framework.Input.Keys.Up }); + new KeyCombo() { PushedKey = Gum.Forms.Input.Keys.Up }); // Customize the tab UI navigation to also trigger when the keyboard // Down arrow key is pushed. FrameworkElement.TabKeyCombos.Add( - new KeyCombo() { PushedKey = Microsoft.Xna.Framework.Input.Keys.Down }); + new KeyCombo() { PushedKey = Gum.Forms.Input.Keys.Down }); // The assets created for the UI were done so at 1/4th the size to keep the size of the // texture atlas small. So we will set the default canvas size to be 1/4th the size of // the game's resolution then tell gum to zoom in by a factor of 4. - GumService.Default.CanvasWidth = GraphicsDevice.PresentationParameters.BackBufferWidth / 4.0f; - GumService.Default.CanvasHeight = GraphicsDevice.PresentationParameters.BackBufferHeight / 4.0f; - GumService.Default.Renderer.Camera.Zoom = 4.0f; + Gum.GumService.Default.CanvasWidth = GraphicsDevice.PresentationParameters.BackBufferWidth / 4.0f; + Gum.GumService.Default.CanvasHeight = GraphicsDevice.PresentationParameters.BackBufferHeight / 4.0f; + Gum.GumService.Default.Renderer.Camera.Zoom = 4.0f; } protected override void LoadContent() diff --git a/Tutorials/2dShaders/src/06-Color-Swap-Effect/DungeonSlime/Scenes/GameScene.cs b/Tutorials/2dShaders/src/06-Color-Swap-Effect/DungeonSlime/Scenes/GameScene.cs index 354044e1..d6b80c9d 100644 --- a/Tutorials/2dShaders/src/06-Color-Swap-Effect/DungeonSlime/Scenes/GameScene.cs +++ b/Tutorials/2dShaders/src/06-Color-Swap-Effect/DungeonSlime/Scenes/GameScene.cs @@ -7,7 +7,6 @@ using Microsoft.Xna.Framework.Audio; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input; -using MonoGameGum; using MonoGameLibrary; using MonoGameLibrary.Content; using MonoGameLibrary.Graphics; @@ -80,7 +79,7 @@ public override void Initialize() // Create any UI elements from the root element created in previous // scenes - GumService.Default.Root.Children.Clear(); + Gum.GumService.Default.Root.Children.Clear(); // Initialize the user interface for the game scene. InitializeUI(); @@ -93,7 +92,7 @@ private void InitializeUI() { // Clear out any previous UI element incase we came here // from a different scene. - GumService.Default.Root.Children.Clear(); + Gum.GumService.Default.Root.Children.Clear(); // Create the game scene ui instance. _ui = new GameSceneUI(); diff --git a/Tutorials/2dShaders/src/06-Color-Swap-Effect/DungeonSlime/Scenes/TitleScene.cs b/Tutorials/2dShaders/src/06-Color-Swap-Effect/DungeonSlime/Scenes/TitleScene.cs index 82410848..60a46577 100644 --- a/Tutorials/2dShaders/src/06-Color-Swap-Effect/DungeonSlime/Scenes/TitleScene.cs +++ b/Tutorials/2dShaders/src/06-Color-Swap-Effect/DungeonSlime/Scenes/TitleScene.cs @@ -4,8 +4,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Audio; using Microsoft.Xna.Framework.Graphics; -using MonoGameGum; -using MonoGameGum.GueDeriving; +using Gum.GueDeriving; using MonoGameLibrary; using MonoGameLibrary.Graphics; using MonoGameLibrary.Scenes; @@ -282,7 +281,7 @@ private void InitializeUI() { // Clear out any previous UI in case we came here from // a different screen: - GumService.Default.Root.Children.Clear(); + Gum.GumService.Default.Root.Children.Clear(); CreateTitlePanel(); CreateOptionsPanel(); @@ -301,7 +300,7 @@ public override void Update(GameTime gameTime) _backgroundOffset.X %= _backgroundPattern.Width; _backgroundOffset.Y %= _backgroundPattern.Height; - GumService.Default.Update(gameTime); + Gum.GumService.Default.Update(gameTime); } public override void Draw(GameTime gameTime) @@ -340,6 +339,6 @@ public override void Draw(GameTime gameTime) Core.SpriteBatch.End(); } - GumService.Default.Draw(); + Gum.GumService.Default.Draw(); } } diff --git a/Tutorials/2dShaders/src/06-Color-Swap-Effect/DungeonSlime/UI/AnimatedButton.cs b/Tutorials/2dShaders/src/06-Color-Swap-Effect/DungeonSlime/UI/AnimatedButton.cs index a98baf1a..1d5eff99 100644 --- a/Tutorials/2dShaders/src/06-Color-Swap-Effect/DungeonSlime/UI/AnimatedButton.cs +++ b/Tutorials/2dShaders/src/06-Color-Swap-Effect/DungeonSlime/UI/AnimatedButton.cs @@ -6,7 +6,7 @@ using Gum.Graphics.Animation; using Gum.Managers; using Microsoft.Xna.Framework.Input; -using MonoGameGum.GueDeriving; +using Gum.GueDeriving; using MonoGameLibrary.Graphics; namespace DungeonSlime.UI; @@ -141,12 +141,12 @@ public AnimatedButton(TextureAtlas atlas) /// private void HandleKeyDown(object sender, KeyEventArgs e) { - if (e.Key == Keys.Left) + if (e.Key == Gum.Forms.Input.Keys.Left) { // Left arrow navigates to previous control HandleTab(TabDirection.Up, loop: true); } - if (e.Key == Keys.Right) + if (e.Key == Gum.Forms.Input.Keys.Right) { // Right arrow navigates to next control HandleTab(TabDirection.Down, loop: true); diff --git a/Tutorials/2dShaders/src/06-Color-Swap-Effect/DungeonSlime/UI/GameSceneUI.cs b/Tutorials/2dShaders/src/06-Color-Swap-Effect/DungeonSlime/UI/GameSceneUI.cs index 83424927..8c3dbf40 100644 --- a/Tutorials/2dShaders/src/06-Color-Swap-Effect/DungeonSlime/UI/GameSceneUI.cs +++ b/Tutorials/2dShaders/src/06-Color-Swap-Effect/DungeonSlime/UI/GameSceneUI.cs @@ -5,8 +5,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Audio; using Microsoft.Xna.Framework.Content; -using MonoGameGum; -using MonoGameGum.GueDeriving; +using Gum.GueDeriving; using MonoGameLibrary; using MonoGameLibrary.Graphics; @@ -63,8 +62,8 @@ public GameSceneUI() this.AddToRoot(); // Get a reference to the content manager that was registered with the - // GumService when it was original initialized. - ContentManager content = GumService.Default.ContentLoader.XnaContentManager; + // Gum.GumService when it was original initialized. + ContentManager content = Gum.GumService.Default.ContentLoader.XnaContentManager; // Use that content manager to load the sound effect and atlas for the // user interface elements @@ -327,7 +326,7 @@ public void HideGameOverPanel() /// A snapshot of the timing values for the current update cycle. public void Update(GameTime gameTime) { - GumService.Default.Update(gameTime); + Gum.GumService.Default.Update(gameTime); } /// @@ -335,6 +334,6 @@ public void Update(GameTime gameTime) /// public void Draw() { - GumService.Default.Draw(); + Gum.GumService.Default.Draw(); } } diff --git a/Tutorials/2dShaders/src/06-Color-Swap-Effect/DungeonSlime/UI/OptionsSlider.cs b/Tutorials/2dShaders/src/06-Color-Swap-Effect/DungeonSlime/UI/OptionsSlider.cs index 2900d983..2a1d183b 100644 --- a/Tutorials/2dShaders/src/06-Color-Swap-Effect/DungeonSlime/UI/OptionsSlider.cs +++ b/Tutorials/2dShaders/src/06-Color-Swap-Effect/DungeonSlime/UI/OptionsSlider.cs @@ -4,7 +4,7 @@ using Gum.Forms.Controls; using Gum.Managers; using Microsoft.Xna.Framework; -using MonoGameGum.GueDeriving; +using Gum.GueDeriving; using MonoGameLibrary.Graphics; namespace DungeonSlime.UI; @@ -18,7 +18,7 @@ public class OptionsSlider : Slider private TextRuntime _textInstance; // Reference to the rectangle that visually represents the current value - private ColoredRectangleRuntime _fillRectangle; + private RectangleRuntime _fillRectangle; /// /// Gets or sets the text label for this slider. @@ -128,7 +128,9 @@ public OptionsSlider(TextureAtlas atlas) middleBackground.AddChild(trackInstance); // Create the fill rectangle that visually displays the current value - _fillRectangle = new ColoredRectangleRuntime(); + _fillRectangle = new RectangleRuntime(); + _fillRectangle.IsFilled = true; + _fillRectangle.StrokeWidth = 0; _fillRectangle.Dock(Gum.Wireframe.Dock.Left); _fillRectangle.Width = 90f; // Default to 90% - will be updated by value changes _fillRectangle.WidthUnits = DimensionUnitType.PercentageOfParent; @@ -178,7 +180,7 @@ public OptionsSlider(TextureAtlas atlas) offBackground.Color = unfocusedColor; middleBackground.Color = unfocusedColor; maxBackground.Color = unfocusedColor; - _fillRectangle.Color = unfocusedColor; + _fillRectangle.FillColor = unfocusedColor; }; sliderCategory.States.Add(enabled); @@ -193,7 +195,7 @@ public OptionsSlider(TextureAtlas atlas) offBackground.Color = focusedColor; middleBackground.Color = focusedColor; maxBackground.Color = focusedColor; - _fillRectangle.Color = focusedColor; + _fillRectangle.FillColor = focusedColor; }; sliderCategory.States.Add(focused); diff --git a/Tutorials/2dShaders/src/07-Sprite-Vertex-Effect/DungeonSlime/DungeonSlime.csproj b/Tutorials/2dShaders/src/07-Sprite-Vertex-Effect/DungeonSlime/DungeonSlime.csproj index ecf79e2a..5fd4b7c0 100644 --- a/Tutorials/2dShaders/src/07-Sprite-Vertex-Effect/DungeonSlime/DungeonSlime.csproj +++ b/Tutorials/2dShaders/src/07-Sprite-Vertex-Effect/DungeonSlime/DungeonSlime.csproj @@ -26,7 +26,7 @@ - + diff --git a/Tutorials/2dShaders/src/07-Sprite-Vertex-Effect/DungeonSlime/Game1.cs b/Tutorials/2dShaders/src/07-Sprite-Vertex-Effect/DungeonSlime/Game1.cs index 15762bbf..bbc9831d 100644 --- a/Tutorials/2dShaders/src/07-Sprite-Vertex-Effect/DungeonSlime/Game1.cs +++ b/Tutorials/2dShaders/src/07-Sprite-Vertex-Effect/DungeonSlime/Game1.cs @@ -2,7 +2,6 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Media; using MonoGameLibrary; -using MonoGameGum; using Gum.Forms; using Gum.Forms.Controls; @@ -35,34 +34,34 @@ protected override void Initialize() private void InitializeGum() { // Initialize the Gum service - GumService.Default.Initialize(this, DefaultVisualsVersion.V3); + Gum.GumService.Default.Initialize(this, DefaultVisualsVersion.V3); // Tell the Gum service which content manager to use. We will tell it to // use the global content manager from our Core. - GumService.Default.ContentLoader.XnaContentManager = Core.Content; + Gum.GumService.Default.ContentLoader.XnaContentManager = Core.Content; // Register keyboard input for UI control. - FrameworkElement.KeyboardsForUiControl.Add(GumService.Default.Keyboard); + FrameworkElement.KeyboardsForUiControl.Add(Gum.GumService.Default.Keyboard); // Register gamepad input for Ui control. - FrameworkElement.GamePadsForUiControl.AddRange(GumService.Default.Gamepads); + FrameworkElement.GamePadsForUiControl.AddRange(Gum.GumService.Default.Gamepads); // Customize the tab reverse UI navigation to also trigger when the keyboard // Up arrow key is pushed. FrameworkElement.TabReverseKeyCombos.Add( - new KeyCombo() { PushedKey = Microsoft.Xna.Framework.Input.Keys.Up }); + new KeyCombo() { PushedKey = Gum.Forms.Input.Keys.Up }); // Customize the tab UI navigation to also trigger when the keyboard // Down arrow key is pushed. FrameworkElement.TabKeyCombos.Add( - new KeyCombo() { PushedKey = Microsoft.Xna.Framework.Input.Keys.Down }); + new KeyCombo() { PushedKey = Gum.Forms.Input.Keys.Down }); // The assets created for the UI were done so at 1/4th the size to keep the size of the // texture atlas small. So we will set the default canvas size to be 1/4th the size of // the game's resolution then tell gum to zoom in by a factor of 4. - GumService.Default.CanvasWidth = GraphicsDevice.PresentationParameters.BackBufferWidth / 4.0f; - GumService.Default.CanvasHeight = GraphicsDevice.PresentationParameters.BackBufferHeight / 4.0f; - GumService.Default.Renderer.Camera.Zoom = 4.0f; + Gum.GumService.Default.CanvasWidth = GraphicsDevice.PresentationParameters.BackBufferWidth / 4.0f; + Gum.GumService.Default.CanvasHeight = GraphicsDevice.PresentationParameters.BackBufferHeight / 4.0f; + Gum.GumService.Default.Renderer.Camera.Zoom = 4.0f; } protected override void LoadContent() diff --git a/Tutorials/2dShaders/src/07-Sprite-Vertex-Effect/DungeonSlime/Scenes/GameScene.cs b/Tutorials/2dShaders/src/07-Sprite-Vertex-Effect/DungeonSlime/Scenes/GameScene.cs index 5b7c5436..2250ba2e 100644 --- a/Tutorials/2dShaders/src/07-Sprite-Vertex-Effect/DungeonSlime/Scenes/GameScene.cs +++ b/Tutorials/2dShaders/src/07-Sprite-Vertex-Effect/DungeonSlime/Scenes/GameScene.cs @@ -6,7 +6,6 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Audio; using Microsoft.Xna.Framework.Graphics; -using MonoGameGum; using MonoGameLibrary; using MonoGameLibrary.Content; using MonoGameLibrary.Graphics; @@ -80,7 +79,7 @@ public override void Initialize() // Create any UI elements from the root element created in previous // scenes - GumService.Default.Root.Children.Clear(); + Gum.GumService.Default.Root.Children.Clear(); // Initialize the user interface for the game scene. InitializeUI(); @@ -93,7 +92,7 @@ private void InitializeUI() { // Clear out any previous UI element incase we came here // from a different scene. - GumService.Default.Root.Children.Clear(); + Gum.GumService.Default.Root.Children.Clear(); // Create the game scene ui instance. _ui = new GameSceneUI(); diff --git a/Tutorials/2dShaders/src/07-Sprite-Vertex-Effect/DungeonSlime/Scenes/TitleScene.cs b/Tutorials/2dShaders/src/07-Sprite-Vertex-Effect/DungeonSlime/Scenes/TitleScene.cs index 1cebd1a3..a9e9db69 100644 --- a/Tutorials/2dShaders/src/07-Sprite-Vertex-Effect/DungeonSlime/Scenes/TitleScene.cs +++ b/Tutorials/2dShaders/src/07-Sprite-Vertex-Effect/DungeonSlime/Scenes/TitleScene.cs @@ -4,8 +4,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Audio; using Microsoft.Xna.Framework.Graphics; -using MonoGameGum; -using MonoGameGum.GueDeriving; +using Gum.GueDeriving; using MonoGameLibrary; using MonoGameLibrary.Content; using MonoGameLibrary.Graphics; @@ -297,7 +296,7 @@ private void InitializeUI() { // Clear out any previous UI in case we came here from // a different screen: - GumService.Default.Root.Children.Clear(); + Gum.GumService.Default.Root.Children.Clear(); CreateTitlePanel(); CreateOptionsPanel(); @@ -322,7 +321,7 @@ public override void Update(GameTime gameTime) _backgroundOffset.X %= _backgroundPattern.Width; _backgroundOffset.Y %= _backgroundPattern.Height; - GumService.Default.Update(gameTime); + Gum.GumService.Default.Update(gameTime); } public override void Draw(GameTime gameTime) @@ -364,6 +363,6 @@ public override void Draw(GameTime gameTime) Core.SpriteBatch.End(); } - GumService.Default.Draw(); + Gum.GumService.Default.Draw(); } } diff --git a/Tutorials/2dShaders/src/07-Sprite-Vertex-Effect/DungeonSlime/UI/AnimatedButton.cs b/Tutorials/2dShaders/src/07-Sprite-Vertex-Effect/DungeonSlime/UI/AnimatedButton.cs index a98baf1a..1d5eff99 100644 --- a/Tutorials/2dShaders/src/07-Sprite-Vertex-Effect/DungeonSlime/UI/AnimatedButton.cs +++ b/Tutorials/2dShaders/src/07-Sprite-Vertex-Effect/DungeonSlime/UI/AnimatedButton.cs @@ -6,7 +6,7 @@ using Gum.Graphics.Animation; using Gum.Managers; using Microsoft.Xna.Framework.Input; -using MonoGameGum.GueDeriving; +using Gum.GueDeriving; using MonoGameLibrary.Graphics; namespace DungeonSlime.UI; @@ -141,12 +141,12 @@ public AnimatedButton(TextureAtlas atlas) /// private void HandleKeyDown(object sender, KeyEventArgs e) { - if (e.Key == Keys.Left) + if (e.Key == Gum.Forms.Input.Keys.Left) { // Left arrow navigates to previous control HandleTab(TabDirection.Up, loop: true); } - if (e.Key == Keys.Right) + if (e.Key == Gum.Forms.Input.Keys.Right) { // Right arrow navigates to next control HandleTab(TabDirection.Down, loop: true); diff --git a/Tutorials/2dShaders/src/07-Sprite-Vertex-Effect/DungeonSlime/UI/GameSceneUI.cs b/Tutorials/2dShaders/src/07-Sprite-Vertex-Effect/DungeonSlime/UI/GameSceneUI.cs index 83424927..8c3dbf40 100644 --- a/Tutorials/2dShaders/src/07-Sprite-Vertex-Effect/DungeonSlime/UI/GameSceneUI.cs +++ b/Tutorials/2dShaders/src/07-Sprite-Vertex-Effect/DungeonSlime/UI/GameSceneUI.cs @@ -5,8 +5,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Audio; using Microsoft.Xna.Framework.Content; -using MonoGameGum; -using MonoGameGum.GueDeriving; +using Gum.GueDeriving; using MonoGameLibrary; using MonoGameLibrary.Graphics; @@ -63,8 +62,8 @@ public GameSceneUI() this.AddToRoot(); // Get a reference to the content manager that was registered with the - // GumService when it was original initialized. - ContentManager content = GumService.Default.ContentLoader.XnaContentManager; + // Gum.GumService when it was original initialized. + ContentManager content = Gum.GumService.Default.ContentLoader.XnaContentManager; // Use that content manager to load the sound effect and atlas for the // user interface elements @@ -327,7 +326,7 @@ public void HideGameOverPanel() /// A snapshot of the timing values for the current update cycle. public void Update(GameTime gameTime) { - GumService.Default.Update(gameTime); + Gum.GumService.Default.Update(gameTime); } /// @@ -335,6 +334,6 @@ public void Update(GameTime gameTime) /// public void Draw() { - GumService.Default.Draw(); + Gum.GumService.Default.Draw(); } } diff --git a/Tutorials/2dShaders/src/07-Sprite-Vertex-Effect/DungeonSlime/UI/OptionsSlider.cs b/Tutorials/2dShaders/src/07-Sprite-Vertex-Effect/DungeonSlime/UI/OptionsSlider.cs index 2900d983..2a1d183b 100644 --- a/Tutorials/2dShaders/src/07-Sprite-Vertex-Effect/DungeonSlime/UI/OptionsSlider.cs +++ b/Tutorials/2dShaders/src/07-Sprite-Vertex-Effect/DungeonSlime/UI/OptionsSlider.cs @@ -4,7 +4,7 @@ using Gum.Forms.Controls; using Gum.Managers; using Microsoft.Xna.Framework; -using MonoGameGum.GueDeriving; +using Gum.GueDeriving; using MonoGameLibrary.Graphics; namespace DungeonSlime.UI; @@ -18,7 +18,7 @@ public class OptionsSlider : Slider private TextRuntime _textInstance; // Reference to the rectangle that visually represents the current value - private ColoredRectangleRuntime _fillRectangle; + private RectangleRuntime _fillRectangle; /// /// Gets or sets the text label for this slider. @@ -128,7 +128,9 @@ public OptionsSlider(TextureAtlas atlas) middleBackground.AddChild(trackInstance); // Create the fill rectangle that visually displays the current value - _fillRectangle = new ColoredRectangleRuntime(); + _fillRectangle = new RectangleRuntime(); + _fillRectangle.IsFilled = true; + _fillRectangle.StrokeWidth = 0; _fillRectangle.Dock(Gum.Wireframe.Dock.Left); _fillRectangle.Width = 90f; // Default to 90% - will be updated by value changes _fillRectangle.WidthUnits = DimensionUnitType.PercentageOfParent; @@ -178,7 +180,7 @@ public OptionsSlider(TextureAtlas atlas) offBackground.Color = unfocusedColor; middleBackground.Color = unfocusedColor; maxBackground.Color = unfocusedColor; - _fillRectangle.Color = unfocusedColor; + _fillRectangle.FillColor = unfocusedColor; }; sliderCategory.States.Add(enabled); @@ -193,7 +195,7 @@ public OptionsSlider(TextureAtlas atlas) offBackground.Color = focusedColor; middleBackground.Color = focusedColor; maxBackground.Color = focusedColor; - _fillRectangle.Color = focusedColor; + _fillRectangle.FillColor = focusedColor; }; sliderCategory.States.Add(focused); diff --git a/Tutorials/2dShaders/src/08-Light-Effect/DungeonSlime/DungeonSlime.csproj b/Tutorials/2dShaders/src/08-Light-Effect/DungeonSlime/DungeonSlime.csproj index ecf79e2a..5fd4b7c0 100644 --- a/Tutorials/2dShaders/src/08-Light-Effect/DungeonSlime/DungeonSlime.csproj +++ b/Tutorials/2dShaders/src/08-Light-Effect/DungeonSlime/DungeonSlime.csproj @@ -26,7 +26,7 @@ - + diff --git a/Tutorials/2dShaders/src/08-Light-Effect/DungeonSlime/Game1.cs b/Tutorials/2dShaders/src/08-Light-Effect/DungeonSlime/Game1.cs index 15762bbf..bbc9831d 100644 --- a/Tutorials/2dShaders/src/08-Light-Effect/DungeonSlime/Game1.cs +++ b/Tutorials/2dShaders/src/08-Light-Effect/DungeonSlime/Game1.cs @@ -2,7 +2,6 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Media; using MonoGameLibrary; -using MonoGameGum; using Gum.Forms; using Gum.Forms.Controls; @@ -35,34 +34,34 @@ protected override void Initialize() private void InitializeGum() { // Initialize the Gum service - GumService.Default.Initialize(this, DefaultVisualsVersion.V3); + Gum.GumService.Default.Initialize(this, DefaultVisualsVersion.V3); // Tell the Gum service which content manager to use. We will tell it to // use the global content manager from our Core. - GumService.Default.ContentLoader.XnaContentManager = Core.Content; + Gum.GumService.Default.ContentLoader.XnaContentManager = Core.Content; // Register keyboard input for UI control. - FrameworkElement.KeyboardsForUiControl.Add(GumService.Default.Keyboard); + FrameworkElement.KeyboardsForUiControl.Add(Gum.GumService.Default.Keyboard); // Register gamepad input for Ui control. - FrameworkElement.GamePadsForUiControl.AddRange(GumService.Default.Gamepads); + FrameworkElement.GamePadsForUiControl.AddRange(Gum.GumService.Default.Gamepads); // Customize the tab reverse UI navigation to also trigger when the keyboard // Up arrow key is pushed. FrameworkElement.TabReverseKeyCombos.Add( - new KeyCombo() { PushedKey = Microsoft.Xna.Framework.Input.Keys.Up }); + new KeyCombo() { PushedKey = Gum.Forms.Input.Keys.Up }); // Customize the tab UI navigation to also trigger when the keyboard // Down arrow key is pushed. FrameworkElement.TabKeyCombos.Add( - new KeyCombo() { PushedKey = Microsoft.Xna.Framework.Input.Keys.Down }); + new KeyCombo() { PushedKey = Gum.Forms.Input.Keys.Down }); // The assets created for the UI were done so at 1/4th the size to keep the size of the // texture atlas small. So we will set the default canvas size to be 1/4th the size of // the game's resolution then tell gum to zoom in by a factor of 4. - GumService.Default.CanvasWidth = GraphicsDevice.PresentationParameters.BackBufferWidth / 4.0f; - GumService.Default.CanvasHeight = GraphicsDevice.PresentationParameters.BackBufferHeight / 4.0f; - GumService.Default.Renderer.Camera.Zoom = 4.0f; + Gum.GumService.Default.CanvasWidth = GraphicsDevice.PresentationParameters.BackBufferWidth / 4.0f; + Gum.GumService.Default.CanvasHeight = GraphicsDevice.PresentationParameters.BackBufferHeight / 4.0f; + Gum.GumService.Default.Renderer.Camera.Zoom = 4.0f; } protected override void LoadContent() diff --git a/Tutorials/2dShaders/src/08-Light-Effect/DungeonSlime/Scenes/GameScene.cs b/Tutorials/2dShaders/src/08-Light-Effect/DungeonSlime/Scenes/GameScene.cs index 49431a24..b04d64ae 100644 --- a/Tutorials/2dShaders/src/08-Light-Effect/DungeonSlime/Scenes/GameScene.cs +++ b/Tutorials/2dShaders/src/08-Light-Effect/DungeonSlime/Scenes/GameScene.cs @@ -6,7 +6,6 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Audio; using Microsoft.Xna.Framework.Graphics; -using MonoGameGum; using MonoGameLibrary; using MonoGameLibrary.Content; using MonoGameLibrary.Graphics; @@ -89,7 +88,7 @@ public override void Initialize() // Create any UI elements from the root element created in previous // scenes - GumService.Default.Root.Children.Clear(); + Gum.GumService.Default.Root.Children.Clear(); // Initialize the user interface for the game scene. InitializeUI(); @@ -152,7 +151,7 @@ private void InitializeUI() { // Clear out any previous UI element incase we came here // from a different scene. - GumService.Default.Root.Children.Clear(); + Gum.GumService.Default.Root.Children.Clear(); // Create the game scene ui instance. _ui = new GameSceneUI(); diff --git a/Tutorials/2dShaders/src/08-Light-Effect/DungeonSlime/Scenes/TitleScene.cs b/Tutorials/2dShaders/src/08-Light-Effect/DungeonSlime/Scenes/TitleScene.cs index 4a9bcb3b..bef72c65 100644 --- a/Tutorials/2dShaders/src/08-Light-Effect/DungeonSlime/Scenes/TitleScene.cs +++ b/Tutorials/2dShaders/src/08-Light-Effect/DungeonSlime/Scenes/TitleScene.cs @@ -4,8 +4,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Audio; using Microsoft.Xna.Framework.Graphics; -using MonoGameGum; -using MonoGameGum.GueDeriving; +using Gum.GueDeriving; using MonoGameLibrary; using MonoGameLibrary.Content; using MonoGameLibrary.Graphics; @@ -296,7 +295,7 @@ private void InitializeUI() { // Clear out any previous UI in case we came here from // a different screen: - GumService.Default.Root.Children.Clear(); + Gum.GumService.Default.Root.Children.Clear(); CreateTitlePanel(); CreateOptionsPanel(); @@ -321,7 +320,7 @@ public override void Update(GameTime gameTime) _backgroundOffset.X %= _backgroundPattern.Width; _backgroundOffset.Y %= _backgroundPattern.Height; - GumService.Default.Update(gameTime); + Gum.GumService.Default.Update(gameTime); } public override void Draw(GameTime gameTime) @@ -363,6 +362,6 @@ public override void Draw(GameTime gameTime) Core.SpriteBatch.End(); } - GumService.Default.Draw(); + Gum.GumService.Default.Draw(); } } diff --git a/Tutorials/2dShaders/src/08-Light-Effect/DungeonSlime/UI/AnimatedButton.cs b/Tutorials/2dShaders/src/08-Light-Effect/DungeonSlime/UI/AnimatedButton.cs index a98baf1a..1d5eff99 100644 --- a/Tutorials/2dShaders/src/08-Light-Effect/DungeonSlime/UI/AnimatedButton.cs +++ b/Tutorials/2dShaders/src/08-Light-Effect/DungeonSlime/UI/AnimatedButton.cs @@ -6,7 +6,7 @@ using Gum.Graphics.Animation; using Gum.Managers; using Microsoft.Xna.Framework.Input; -using MonoGameGum.GueDeriving; +using Gum.GueDeriving; using MonoGameLibrary.Graphics; namespace DungeonSlime.UI; @@ -141,12 +141,12 @@ public AnimatedButton(TextureAtlas atlas) /// private void HandleKeyDown(object sender, KeyEventArgs e) { - if (e.Key == Keys.Left) + if (e.Key == Gum.Forms.Input.Keys.Left) { // Left arrow navigates to previous control HandleTab(TabDirection.Up, loop: true); } - if (e.Key == Keys.Right) + if (e.Key == Gum.Forms.Input.Keys.Right) { // Right arrow navigates to next control HandleTab(TabDirection.Down, loop: true); diff --git a/Tutorials/2dShaders/src/08-Light-Effect/DungeonSlime/UI/GameSceneUI.cs b/Tutorials/2dShaders/src/08-Light-Effect/DungeonSlime/UI/GameSceneUI.cs index 83424927..8c3dbf40 100644 --- a/Tutorials/2dShaders/src/08-Light-Effect/DungeonSlime/UI/GameSceneUI.cs +++ b/Tutorials/2dShaders/src/08-Light-Effect/DungeonSlime/UI/GameSceneUI.cs @@ -5,8 +5,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Audio; using Microsoft.Xna.Framework.Content; -using MonoGameGum; -using MonoGameGum.GueDeriving; +using Gum.GueDeriving; using MonoGameLibrary; using MonoGameLibrary.Graphics; @@ -63,8 +62,8 @@ public GameSceneUI() this.AddToRoot(); // Get a reference to the content manager that was registered with the - // GumService when it was original initialized. - ContentManager content = GumService.Default.ContentLoader.XnaContentManager; + // Gum.GumService when it was original initialized. + ContentManager content = Gum.GumService.Default.ContentLoader.XnaContentManager; // Use that content manager to load the sound effect and atlas for the // user interface elements @@ -327,7 +326,7 @@ public void HideGameOverPanel() /// A snapshot of the timing values for the current update cycle. public void Update(GameTime gameTime) { - GumService.Default.Update(gameTime); + Gum.GumService.Default.Update(gameTime); } /// @@ -335,6 +334,6 @@ public void Update(GameTime gameTime) /// public void Draw() { - GumService.Default.Draw(); + Gum.GumService.Default.Draw(); } } diff --git a/Tutorials/2dShaders/src/08-Light-Effect/DungeonSlime/UI/OptionsSlider.cs b/Tutorials/2dShaders/src/08-Light-Effect/DungeonSlime/UI/OptionsSlider.cs index 2900d983..2a1d183b 100644 --- a/Tutorials/2dShaders/src/08-Light-Effect/DungeonSlime/UI/OptionsSlider.cs +++ b/Tutorials/2dShaders/src/08-Light-Effect/DungeonSlime/UI/OptionsSlider.cs @@ -4,7 +4,7 @@ using Gum.Forms.Controls; using Gum.Managers; using Microsoft.Xna.Framework; -using MonoGameGum.GueDeriving; +using Gum.GueDeriving; using MonoGameLibrary.Graphics; namespace DungeonSlime.UI; @@ -18,7 +18,7 @@ public class OptionsSlider : Slider private TextRuntime _textInstance; // Reference to the rectangle that visually represents the current value - private ColoredRectangleRuntime _fillRectangle; + private RectangleRuntime _fillRectangle; /// /// Gets or sets the text label for this slider. @@ -128,7 +128,9 @@ public OptionsSlider(TextureAtlas atlas) middleBackground.AddChild(trackInstance); // Create the fill rectangle that visually displays the current value - _fillRectangle = new ColoredRectangleRuntime(); + _fillRectangle = new RectangleRuntime(); + _fillRectangle.IsFilled = true; + _fillRectangle.StrokeWidth = 0; _fillRectangle.Dock(Gum.Wireframe.Dock.Left); _fillRectangle.Width = 90f; // Default to 90% - will be updated by value changes _fillRectangle.WidthUnits = DimensionUnitType.PercentageOfParent; @@ -178,7 +180,7 @@ public OptionsSlider(TextureAtlas atlas) offBackground.Color = unfocusedColor; middleBackground.Color = unfocusedColor; maxBackground.Color = unfocusedColor; - _fillRectangle.Color = unfocusedColor; + _fillRectangle.FillColor = unfocusedColor; }; sliderCategory.States.Add(enabled); @@ -193,7 +195,7 @@ public OptionsSlider(TextureAtlas atlas) offBackground.Color = focusedColor; middleBackground.Color = focusedColor; maxBackground.Color = focusedColor; - _fillRectangle.Color = focusedColor; + _fillRectangle.FillColor = focusedColor; }; sliderCategory.States.Add(focused); diff --git a/Tutorials/2dShaders/src/09-Shadows-Effect/DungeonSlime/DungeonSlime.csproj b/Tutorials/2dShaders/src/09-Shadows-Effect/DungeonSlime/DungeonSlime.csproj index ecf79e2a..5fd4b7c0 100644 --- a/Tutorials/2dShaders/src/09-Shadows-Effect/DungeonSlime/DungeonSlime.csproj +++ b/Tutorials/2dShaders/src/09-Shadows-Effect/DungeonSlime/DungeonSlime.csproj @@ -26,7 +26,7 @@ - + diff --git a/Tutorials/2dShaders/src/09-Shadows-Effect/DungeonSlime/Game1.cs b/Tutorials/2dShaders/src/09-Shadows-Effect/DungeonSlime/Game1.cs index 15762bbf..bbc9831d 100644 --- a/Tutorials/2dShaders/src/09-Shadows-Effect/DungeonSlime/Game1.cs +++ b/Tutorials/2dShaders/src/09-Shadows-Effect/DungeonSlime/Game1.cs @@ -2,7 +2,6 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Media; using MonoGameLibrary; -using MonoGameGum; using Gum.Forms; using Gum.Forms.Controls; @@ -35,34 +34,34 @@ protected override void Initialize() private void InitializeGum() { // Initialize the Gum service - GumService.Default.Initialize(this, DefaultVisualsVersion.V3); + Gum.GumService.Default.Initialize(this, DefaultVisualsVersion.V3); // Tell the Gum service which content manager to use. We will tell it to // use the global content manager from our Core. - GumService.Default.ContentLoader.XnaContentManager = Core.Content; + Gum.GumService.Default.ContentLoader.XnaContentManager = Core.Content; // Register keyboard input for UI control. - FrameworkElement.KeyboardsForUiControl.Add(GumService.Default.Keyboard); + FrameworkElement.KeyboardsForUiControl.Add(Gum.GumService.Default.Keyboard); // Register gamepad input for Ui control. - FrameworkElement.GamePadsForUiControl.AddRange(GumService.Default.Gamepads); + FrameworkElement.GamePadsForUiControl.AddRange(Gum.GumService.Default.Gamepads); // Customize the tab reverse UI navigation to also trigger when the keyboard // Up arrow key is pushed. FrameworkElement.TabReverseKeyCombos.Add( - new KeyCombo() { PushedKey = Microsoft.Xna.Framework.Input.Keys.Up }); + new KeyCombo() { PushedKey = Gum.Forms.Input.Keys.Up }); // Customize the tab UI navigation to also trigger when the keyboard // Down arrow key is pushed. FrameworkElement.TabKeyCombos.Add( - new KeyCombo() { PushedKey = Microsoft.Xna.Framework.Input.Keys.Down }); + new KeyCombo() { PushedKey = Gum.Forms.Input.Keys.Down }); // The assets created for the UI were done so at 1/4th the size to keep the size of the // texture atlas small. So we will set the default canvas size to be 1/4th the size of // the game's resolution then tell gum to zoom in by a factor of 4. - GumService.Default.CanvasWidth = GraphicsDevice.PresentationParameters.BackBufferWidth / 4.0f; - GumService.Default.CanvasHeight = GraphicsDevice.PresentationParameters.BackBufferHeight / 4.0f; - GumService.Default.Renderer.Camera.Zoom = 4.0f; + Gum.GumService.Default.CanvasWidth = GraphicsDevice.PresentationParameters.BackBufferWidth / 4.0f; + Gum.GumService.Default.CanvasHeight = GraphicsDevice.PresentationParameters.BackBufferHeight / 4.0f; + Gum.GumService.Default.Renderer.Camera.Zoom = 4.0f; } protected override void LoadContent() diff --git a/Tutorials/2dShaders/src/09-Shadows-Effect/DungeonSlime/Scenes/GameScene.cs b/Tutorials/2dShaders/src/09-Shadows-Effect/DungeonSlime/Scenes/GameScene.cs index 1212ba8c..5ffb5c99 100644 --- a/Tutorials/2dShaders/src/09-Shadows-Effect/DungeonSlime/Scenes/GameScene.cs +++ b/Tutorials/2dShaders/src/09-Shadows-Effect/DungeonSlime/Scenes/GameScene.cs @@ -7,7 +7,6 @@ using Microsoft.Xna.Framework.Audio; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input; -using MonoGameGum; using MonoGameLibrary; using MonoGameLibrary.Content; using MonoGameLibrary.Graphics; @@ -93,7 +92,7 @@ public override void Initialize() // Create any UI elements from the root element created in previous // scenes - GumService.Default.Root.Children.Clear(); + Gum.GumService.Default.Root.Children.Clear(); // Initialize the user interface for the game scene. InitializeUI(); @@ -137,7 +136,7 @@ private void InitializeUI() { // Clear out any previous UI element incase we came here // from a different scene. - GumService.Default.Root.Children.Clear(); + Gum.GumService.Default.Root.Children.Clear(); // Create the game scene ui instance. _ui = new GameSceneUI(); diff --git a/Tutorials/2dShaders/src/09-Shadows-Effect/DungeonSlime/Scenes/TitleScene.cs b/Tutorials/2dShaders/src/09-Shadows-Effect/DungeonSlime/Scenes/TitleScene.cs index 4a9bcb3b..bef72c65 100644 --- a/Tutorials/2dShaders/src/09-Shadows-Effect/DungeonSlime/Scenes/TitleScene.cs +++ b/Tutorials/2dShaders/src/09-Shadows-Effect/DungeonSlime/Scenes/TitleScene.cs @@ -4,8 +4,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Audio; using Microsoft.Xna.Framework.Graphics; -using MonoGameGum; -using MonoGameGum.GueDeriving; +using Gum.GueDeriving; using MonoGameLibrary; using MonoGameLibrary.Content; using MonoGameLibrary.Graphics; @@ -296,7 +295,7 @@ private void InitializeUI() { // Clear out any previous UI in case we came here from // a different screen: - GumService.Default.Root.Children.Clear(); + Gum.GumService.Default.Root.Children.Clear(); CreateTitlePanel(); CreateOptionsPanel(); @@ -321,7 +320,7 @@ public override void Update(GameTime gameTime) _backgroundOffset.X %= _backgroundPattern.Width; _backgroundOffset.Y %= _backgroundPattern.Height; - GumService.Default.Update(gameTime); + Gum.GumService.Default.Update(gameTime); } public override void Draw(GameTime gameTime) @@ -363,6 +362,6 @@ public override void Draw(GameTime gameTime) Core.SpriteBatch.End(); } - GumService.Default.Draw(); + Gum.GumService.Default.Draw(); } } diff --git a/Tutorials/2dShaders/src/09-Shadows-Effect/DungeonSlime/UI/AnimatedButton.cs b/Tutorials/2dShaders/src/09-Shadows-Effect/DungeonSlime/UI/AnimatedButton.cs index a98baf1a..1d5eff99 100644 --- a/Tutorials/2dShaders/src/09-Shadows-Effect/DungeonSlime/UI/AnimatedButton.cs +++ b/Tutorials/2dShaders/src/09-Shadows-Effect/DungeonSlime/UI/AnimatedButton.cs @@ -6,7 +6,7 @@ using Gum.Graphics.Animation; using Gum.Managers; using Microsoft.Xna.Framework.Input; -using MonoGameGum.GueDeriving; +using Gum.GueDeriving; using MonoGameLibrary.Graphics; namespace DungeonSlime.UI; @@ -141,12 +141,12 @@ public AnimatedButton(TextureAtlas atlas) /// private void HandleKeyDown(object sender, KeyEventArgs e) { - if (e.Key == Keys.Left) + if (e.Key == Gum.Forms.Input.Keys.Left) { // Left arrow navigates to previous control HandleTab(TabDirection.Up, loop: true); } - if (e.Key == Keys.Right) + if (e.Key == Gum.Forms.Input.Keys.Right) { // Right arrow navigates to next control HandleTab(TabDirection.Down, loop: true); diff --git a/Tutorials/2dShaders/src/09-Shadows-Effect/DungeonSlime/UI/GameSceneUI.cs b/Tutorials/2dShaders/src/09-Shadows-Effect/DungeonSlime/UI/GameSceneUI.cs index 83424927..8c3dbf40 100644 --- a/Tutorials/2dShaders/src/09-Shadows-Effect/DungeonSlime/UI/GameSceneUI.cs +++ b/Tutorials/2dShaders/src/09-Shadows-Effect/DungeonSlime/UI/GameSceneUI.cs @@ -5,8 +5,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Audio; using Microsoft.Xna.Framework.Content; -using MonoGameGum; -using MonoGameGum.GueDeriving; +using Gum.GueDeriving; using MonoGameLibrary; using MonoGameLibrary.Graphics; @@ -63,8 +62,8 @@ public GameSceneUI() this.AddToRoot(); // Get a reference to the content manager that was registered with the - // GumService when it was original initialized. - ContentManager content = GumService.Default.ContentLoader.XnaContentManager; + // Gum.GumService when it was original initialized. + ContentManager content = Gum.GumService.Default.ContentLoader.XnaContentManager; // Use that content manager to load the sound effect and atlas for the // user interface elements @@ -327,7 +326,7 @@ public void HideGameOverPanel() /// A snapshot of the timing values for the current update cycle. public void Update(GameTime gameTime) { - GumService.Default.Update(gameTime); + Gum.GumService.Default.Update(gameTime); } /// @@ -335,6 +334,6 @@ public void Update(GameTime gameTime) /// public void Draw() { - GumService.Default.Draw(); + Gum.GumService.Default.Draw(); } } diff --git a/Tutorials/2dShaders/src/09-Shadows-Effect/DungeonSlime/UI/OptionsSlider.cs b/Tutorials/2dShaders/src/09-Shadows-Effect/DungeonSlime/UI/OptionsSlider.cs index 2900d983..2a1d183b 100644 --- a/Tutorials/2dShaders/src/09-Shadows-Effect/DungeonSlime/UI/OptionsSlider.cs +++ b/Tutorials/2dShaders/src/09-Shadows-Effect/DungeonSlime/UI/OptionsSlider.cs @@ -4,7 +4,7 @@ using Gum.Forms.Controls; using Gum.Managers; using Microsoft.Xna.Framework; -using MonoGameGum.GueDeriving; +using Gum.GueDeriving; using MonoGameLibrary.Graphics; namespace DungeonSlime.UI; @@ -18,7 +18,7 @@ public class OptionsSlider : Slider private TextRuntime _textInstance; // Reference to the rectangle that visually represents the current value - private ColoredRectangleRuntime _fillRectangle; + private RectangleRuntime _fillRectangle; /// /// Gets or sets the text label for this slider. @@ -128,7 +128,9 @@ public OptionsSlider(TextureAtlas atlas) middleBackground.AddChild(trackInstance); // Create the fill rectangle that visually displays the current value - _fillRectangle = new ColoredRectangleRuntime(); + _fillRectangle = new RectangleRuntime(); + _fillRectangle.IsFilled = true; + _fillRectangle.StrokeWidth = 0; _fillRectangle.Dock(Gum.Wireframe.Dock.Left); _fillRectangle.Width = 90f; // Default to 90% - will be updated by value changes _fillRectangle.WidthUnits = DimensionUnitType.PercentageOfParent; @@ -178,7 +180,7 @@ public OptionsSlider(TextureAtlas atlas) offBackground.Color = unfocusedColor; middleBackground.Color = unfocusedColor; maxBackground.Color = unfocusedColor; - _fillRectangle.Color = unfocusedColor; + _fillRectangle.FillColor = unfocusedColor; }; sliderCategory.States.Add(enabled); @@ -193,7 +195,7 @@ public OptionsSlider(TextureAtlas atlas) offBackground.Color = focusedColor; middleBackground.Color = focusedColor; maxBackground.Color = focusedColor; - _fillRectangle.Color = focusedColor; + _fillRectangle.FillColor = focusedColor; }; sliderCategory.States.Add(focused);