Myra - UI Library for the MonoGame

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:

I thought I would let everyone know the success I have been having with Roman’s new Myra-UI component. It is only a start but it is already providing the information I require to move into the next area of development for my own game project.

The image below shows a scrollable, hexagonal 2D map-board. It is the initial design for my game concept of bringing Avalon Hill’s famous board-game, “1776”, to the PC; however, with a lot of different features that would allow for advanced, strategic game play. In the end, the only thing recognizable from the original game would be the style of the map-board.

“1776” is the only strategic level game I am aware of that demonstrates the difficulties that the American colonists had against the British Forces (In reality, they should have lost and actually did so up until the last few months of the conflict. Had Britain invested additional resources, there would be no USA today. However, Britain was for more interested in her Canadian possession than her colonies in America.)

John Tiller Software produces a game by the same name but it is more of a tactical level game than my planned development will hopefully one day produce.

In its day, “1776”, was also considered one of the most advanced board games that Avalon Hill produced. This new direction from Avalon Hill would also produce the strategic games, “Third Reich” and “Alesia”, among others.

In the upper left-hand corner of the image you can see the information output that the Myra-U is now producing, which will be added to as I begin developing the algorithms to calculate the hex-tile that the mouse is pointing to.

As I had mentioned in an earlier reply on this thread, I am making my code available to anyone who is interested in researching war game development since this aspect of game development is still one of the truly “black arts”, leaving such developers with very little, real, concrete information to avail themselves of.

Interested parties can contact me at

           blackfalconsoftware@outlook.com.

I am also in the process of researching and testing out various techniques for creating the entire map-board. However, not being a graphic artist myself, my results so far have been less than stellar… :disappointed:

New version 0.4.7.86 of Myra is out.
Now it can load and render simple orthogonal Tiled maps(screenshot at the end of this post) through the asset management system. Animated tiles aren’t supported yet.
Corresponding sample had been added. It’s screenshot is at the end of this post.

New version binary distribution link: https://github.com/rds1983/Myra/releases/download/0.4.7.86/Myra.0.4.7.86.msi

NuGet had been updated as always.

This project is awesome… outta curiosity, it seems you got this working with FNA and MonoGame.Extended is a dependency, does that mean you got MonoGame.Extended working with FNA? Also, is making an installer really worth it? I mean, do people use it?

Is this project still being worked on? I am using it currently in my own game project so I am keeping tabs on it haven’t seen any postings beyond the first flurry of postings that appeared to stop this May…

Hi everyone!
Sorry for the disappearance. I am going to return to this project and release the new version soon. I am going to remove experimental features(Asset Manager and Tiled support) and make Myra UI library only. Further plans include enhancements of the UI Editor. I am going to make it able to generate the C# code(similar to WIndows Forms designer) to ease integration of the UI forms drawn there into the game.
Also I want to add support for the custom(user made) controls there.

@Alan,
No, FNA is no longer supported. And probably making installer didnt worth it. I may remove it in favor of simple ZIP archive in future versions.

1 Like

New version 0.5 is finally there.
List of changes:

  • I’ve made serious clean up and removed all experimental stuff. Now Myra is what it is intended to be - UI Library for the MonoGame.
  • Removed .msi package. Now the distribution consists only from zip package. It has all dlls along with their dependencies, all samples and the UI Editor. The distribution is using MonoGame DesktopGL backend, so it should work on all desktop platforms.
  • Integrated the UI stylesheet loading into the Content Pipeline. The corresponding sample had been attached. The wiki entry had been updated as well: https://github.com/rds1983/Myra/wiki/Loading-Custom-UI-Stylesheet

New distribution link: https://github.com/rds1983/Myra/releases/download/0.5.0.107/Myra.0.5.0.107.zip

I hope to add the C# code generation to the UI Editor in the next version.
Thanks for the feedbacks!

1 Like

rds1983…

Keep up the great work you are doing for the MonoGame Community.

I plan on continuing to use your excellent Myra-UI for my own military simulation project.

However, as the project develops I will probably have a number of questions on how to implement a master menu in the application among several other types of implementations.

Thank you again for your great efforts… :relaxed: :relaxed::relaxed:

Myra 0.5.1 had been released.
Major addition is ability of Myra UI Editor to export UI to C#(close analogue is WinForms designer in Visual Studio).
I’ve made a new video. It is quite long(about 11 mins). But it is complete tutorial on how to create a new MG project, add Myra support, draw a UI in the Editor and embed it in the project using new export to C# feature.

New binary distribution download link: https://github.com/rds1983/Myra/releases/download/0.5.1.110/Myra.0.5.1.110.zip

1 Like