Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Gum.MonoGame" Version="2026.5.8.1" />
<PackageReference Include="Gum.MonoGame" Version="2026.11.2.1" />
<PackageReference Include="MonoGame.Framework.DesktopGL" Version="3.8.5.1" />
<PackageReference Include="MonoGame.Content.Builder.Task" Version="3.8.5.1" />
</ItemGroup>
Expand Down
19 changes: 9 additions & 10 deletions Tutorials/2dShaders/src/02-Hot-Reload-System/DungeonSlime/Game1.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using DungeonSlime.Scenes;
using Microsoft.Xna.Framework.Media;
using MonoGameLibrary;
using MonoGameGum;
using Gum.Forms;
using Gum.Forms.Controls;

Expand Down Expand Up @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand All @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand All @@ -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)
Expand Down Expand Up @@ -340,6 +339,6 @@ public override void Draw(GameTime gameTime)
Core.SpriteBatch.End();
}

GumService.Default.Draw();
Gum.GumService.Default.Draw();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -141,12 +141,12 @@ public AnimatedButton(TextureAtlas atlas)
/// </summary>
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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -327,14 +326,14 @@ public void HideGameOverPanel()
/// <param name="gameTime">A snapshot of the timing values for the current update cycle.</param>
public void Update(GameTime gameTime)
{
GumService.Default.Update(gameTime);
Gum.GumService.Default.Update(gameTime);
}

/// <summary>
/// Draws the game scene ui.
/// </summary>
public void Draw()
{
GumService.Default.Draw();
Gum.GumService.Default.Draw();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;

/// <summary>
/// Gets or sets the text label for this slider.
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);

Expand All @@ -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);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Gum.MonoGame" Version="2026.5.8.1" />
<PackageReference Include="Gum.MonoGame" Version="2026.11.2.1" />
<PackageReference Include="MonoGame.Framework.DesktopGL" Version="3.8.5.1" />
<PackageReference Include="MonoGame.Content.Builder.Task" Version="3.8.5.1" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using DungeonSlime.Scenes;
using Microsoft.Xna.Framework.Media;
using MonoGameLibrary;
using MonoGameGum;
using Gum.Forms;
using Gum.Forms.Controls;

Expand Down Expand Up @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand All @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand All @@ -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)
Expand Down Expand Up @@ -340,6 +339,6 @@ public override void Draw(GameTime gameTime)
Core.SpriteBatch.End();
}

GumService.Default.Draw();
Gum.GumService.Default.Draw();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -141,12 +141,12 @@ public AnimatedButton(TextureAtlas atlas)
/// </summary>
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);
Expand Down
Loading
Loading