Monogame.ImGui
1.0.0
dotnet add package Monogame.ImGui --version 1.0.0
NuGet\Install-Package Monogame.ImGui -Version 1.0.0
<PackageReference Include="Monogame.ImGui" Version="1.0.0" />
paket add Monogame.ImGui --version 1.0.0
#r "nuget: Monogame.ImGui, 1.0.0"
// Install Monogame.ImGui as a Cake Addin #addin nuget:?package=Monogame.ImGui&version=1.0.0 // Install Monogame.ImGui as a Cake Tool #tool nuget:?package=Monogame.ImGui&version=1.0.0
Monogame.ImGui
This is a Monogame wrapper for the ImGui.NET Library (https://github.com/mellinoe/ImGui.NET). Monogame.ImGui lets you build graphical interfaces for your Monogame games using a simple immediate-mode style.
Disclaimer: This code wasn't written by me, I just fixed a few things and uploaded it to a GitHub and NuGet. The code of the user I got it from: https://twitter.com/BinaryEyesDev
Usage
To use Monogame.ImGui, download this library using NuGet inside your Monogame project. In your Game1, Initialize ImGuiRenderer like so:
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using MonoGame.ImGui;
namespace YourGame
{
public class Game1 : Game
{
public GraphicsDeviceManager graphics;
SpriteBatch spriteBatch;
public ImGUIRenderer GuiRenderer; //This is the ImGuiRenderer
}
public Game1()
{
GuiRenderer = new ImGUIRenderer(this).Initialize().RebuildFontAtlas();
graphics = new GraphicsDeviceManager(this);
Content.RootDirectory = "Content";
}
...
And then in the Draw event, you need to add GuiRenderer.BeginLayout(gameTime);
and GuiRenderer.EndLayout();
Like so:
...
protected override void Draw(GameTime gameTime)
{
graphics.GraphicsDevice.Clear(Color.Coral);
spriteBatch.Begin();
//Your regular Game draw calls
spriteBatch.End();
base.Draw(gameTime);
GuiRenderer.BeginLayout(gameTime);
//Insert Your ImGui code
GuiRenderer.EndLayout();
}
...
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET Framework | net462 is compatible. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
-
.NETFramework 4.6.2
- ImGui.NET (>= 1.72.0)
- MonoGame.Framework.DesktopGL (>= 3.7.1.189)
- System.Buffers (>= 4.5.0)
- System.Numerics.Vectors (>= 4.5.0)
- System.Runtime.CompilerServices.Unsafe (>= 4.6.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.0.0 | 3,296 | 9/26/2019 |