Myra - UI Library for the MonoGame

Version 0.3.9.7 had been released. It has two major improvements:

Binary distribution link: https://github.com/rds1983/Myra/releases/download/0.3.9.7/Myra.0.3.9.7.msi
NuGet had been also updated.

Thanks again for the feedbacks.

I think i will give this a try in my game’s prototype :slight_smile: can’t wait to try this.

New version 0.4.0.0 is ready.
Added SpinButton, HorizontalProgressBar and VerticalProgressBar widgets. Their usage is demonstrated at GridSample and CustomUIStylesheetSample.
Also added ImageButton widget. Which is just a simplified version of the Button widget(which can have both image and text).

As the UI part seems pretty complete functionality-wise I’ve started to add completely new feature to Myra: 3d engine. The end goal of that project is to make it simplistic, easy to use and sufficient for indie low-poly games.

To make the work simplier, I’ve added MultiCompileEffect feature. It allows to specify values for #defines of Effect at the run-time. It is done by compiling possible variants(which are specified by special JSON file) and packaging it into the one content resource. More detailed documentation for that feature is here: https://github.com/rds1983/Myra/wiki/MultiCompileEffect

With MultiCompileEffect I’ve done first two shaders: DefaultEffect and TerrainEffect. Which are demonstrated on the new samples: Primitives3DSample(screenshot is attached) and TerrainSample. You can move there using WASD keys. Pressing right button and moving the mouse will make the camera rotate.

Link to binary distribution: https://github.com/rds1983/Myra/releases/download/0.4.0.0/Myra.0.4.0.0.msi

NuGet had been updated as well.

Would not it be better to place the 3D engine in its own library/dll ?
If I use Myra for my UI, I don’t need Myra’s 3D engine alongside mine, even if I don’t use it.

ps: did you make your own OOBB ? From my memories, MG uses AABB.

Probably you’re right, I’ll make separate Myra.Graphics3D library in future releases.
I use MG’s BoundingBox class for AABB calculations.

Myra 0.4.1.72 is here.
List of changes:

  • Following discussion, I’ve removed 3d stuff from it for now. Probably it’ll find it’s place in the completely new project.
  • Added FNA version of Myra. Myra.FNA.dll had been added to both NuGet and to MSI package. Also MSI package got FNA Samples Launcher.
  • Added ZIP distribution: https://github.com/rds1983/Myra/releases/download/0.4.1.72/Myra.0.4.1.72.zip
    It could be used under Linux(had been tested with Ubuntu). Unzip it and then executables could be run with mono(i.e. ‘mono ./Myra.UIEditor.exe’)
  • Some minor changes to the UI: Tree widget could be navigated with Up/Down keys. And Return key could be used to expand/collapse nodes. ScrollPane widget could be vertically scrolled using the mouse wheel. Both changes had been implemented to make the UI Editor more convinient to use. It can be turned off by setting CanFocus of either Tree or ScrollPane to false.
  • Switched to MonoGame 3.6. Though it should work with 3.5 as well.

Binary distribution link: https://github.com/rds1983/Myra/releases/tag/0.4.1.72

Myra 0.4.5.76 had been released.
The major change is Myra got it’s own system of the asset management. It is fundamentally different from MonoGame Content Pipeline. The difference is Myra’s asset management doesnt have any sort of pipeline, but loads raw assets. I’ve wrapped up some docs on it: https://github.com/rds1983/Myra/wiki/Asset-Management
Though it is far from being complete.
The new system could be used to load custom UI stylesheet using just one line of code:

var stylesheet = _assetManager.Load<Stylesheet>("uiskin.json");

The Loading Custom UI Stylesheet Guide had been updated appropriately.

Binary releases link: https://github.com/rds1983/Myra/releases/tag/0.4.5.76
NuGet had been updated as well.

Btw, I would be glad to answer any questions and offer any assistance regarding Myra in the real time. Feel free to contact me at gitter.

Only two days passed since the last announcement. And now there’s new version. The major change is that Myra moved on top of MonoGame.Extended.
FNA version of Myra had been dropped.

Binary distribution: https://github.com/rds1983/Myra/releases/tag/0.4.6.82
NuGet had been updated.

Roman…

So far, very well done!

Please keep your software tool going. So far it is the only one I have found that works “right out of the box”. It is something all Monogame developers need since so few of the UIs developed so far have proven to be useful.

I tried EmptyKeys and you would think that the developer would offer some basic documentation on how to use his software but I couldn’t find any. The assumption is that you can go through the source-code examples but in the latest version, the sample component I needed doesn’t work…

1 Like

Thanks for the kind words, Steve.
Yeah, I was surprised when found out that there were almost no MonoGame UI frameworks focused on ease of integration.
Probably when a developer wants to make his library easily integratable, he thinks that he’ll have to make a version for every MonoGame backend. And so he rejects that idea. It seems that it is widely unknown that one can develop a single library for all versions of MonoGame at once using MonoGame bait-and-switch PCL(personally I figured that out analyzing how MonoGame.Extended was made).

Roman…

Thank you for such a quick response on the Monogame forums.

I have been very slowly been developing a strategic war game with Monogame, though I have been away from it for a few months due to other work. It took me a while to get one of the most difficult aspects done, which was the implementation of a tiled hexagonal map (If anyone wants to know I accomplished this, let me know and I will provide you with the source code.). Now that I am back on this project, I needed a UI to provide me with information in real time. This is why I was so excited to see your new software presented on the Monogame forums.

Just a question…

I just finished setting up a test for your “Hello World” sample. Everything compiled cleanly but when the application gets to the following line of code in the “LoadContent” event, “_font = DefaultAssets.Font;”, it threw the following error…

An unhandled exception of type ‘System.MissingMethodException’ occurred in Myra.dll

I noticed that the “default.fnt” file was not in the installed directory where the Myra assemblies are, However, could this issue be because because you updated your binaries very recently?

What version of Myra do you use?
You can find that out by running UI Editor and going to Help/About.

Roman…

This is the version I downloaded just the other day… Myra.0.4.1.72.msi

It is quite old.
I’d recommend getting the top one here: https://github.com/rds1983/Myra/releases
Which is 0.4.6.82
After installing it, you would need to reference MonoGame.Extended.dll(which is also part of distribution) as well as Myra.dll.

If you trying out this tutorial: https://github.com/rds1983/Myra/wiki/Tutorial:-“Hello,-World”
I should warn you that it is outdated. And the second part(Custom Font) shouldn’t even compile. But I’ll fix it asap.

default.fnt shouldn’t be in the distribution as it is stored in the assembly resources.

Thank you, Roman…

I am giving it a try right now…

Roman…

I have your latest version of Myra installed.

Do you have any updated samples since the “Hello World” sample is still failing as you thought it would.

This time it is failing on the second to last line in the “Draw” method…

_font.Draw(_batch, "Hello, World!", Point.Zero, Color.White);

I expected this as well since you had stated that Myra now sits atop Monogame.Extended.

Steve,
I updated that tutorial.
That line should be replaced with:

_batch.DrawString(_font, "Hello, World!", Vector2.Zero, Color.White);

Roman…

Just found your updated sample with the “Batch.DrawString” method…

Changed the “font.draw” line to “Batch.DrawString” and the sample worked as you have it shown on the web page.

Great work ! :relaxed:

Now, can I implement something similar in my game project so that the text will be written atop my game screen?

I need this since I am beginning to work on some mouse input and need to see the state of the mouse as I depress the various buttons.

hmm, in your Draw method firstly draw the game screen, then do “Batch.DrawString”.

Sounds terrific… Thanks… :relaxed: