Myra - UI Library for the MonoGame

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

Roman… Great introductory video to using your Myra.UI Editor… :relaxed:

Is there any more activity on this project?

It looks like a very easy to use UI for MonoGame and I have had very little trouble implementing some of its basic components…

Hey Steve,
Yes, I am working on the project. Though not very actively. Probably there will be a new version by November. It’ll have various bug fixes as well as new IsMultiline property for the TextField widget.
Also I want to make Menu widget controllable by the keyboard.

Looking forward to your next release… :relaxed:

The new Myra version is on its way.
I’ve improved the Menu widget. Now menu items could be navigated using keyboard. Also now if a menu item name contain ‘&’ char, it’ll be accessible through Alt key(as in WinForms).

The goal of the Myra project is to provide UI framework that could be used not only in games, but in the level editors as well. Hopefully I’ll reach it one day.

The new Myra 0.5.5.112 has arrived!
It has following features:

  • IsMultiline property for the TextField is widget. Default value is false.
  • New Panel widget - very simple container(could be considered as Grid with single cell).
  • Menu Widget can be controlled via keyboard.
  • Various bug fixes.

Also I’ve made new sample AllWidgetsSample, which as its name states, demonstrates all widgets at once in action:

All samples, include the new one, are available in the binary release: https://github.com/rds1983/Myra/releases/download/0.5.5.112/Myra.0.5.5.112.zip

NuGet had been updated as well.

5 Likes

I am having trouble figuring out how to access information about the widget in the code. For example, how do I check if a button has been pressed, or the string in a text field? A tutorial or help on this would be appreciated.

The button has property IsPressed and the textfield has property Text.
I hope to make small wiki entry for every widget in the future.

Made another animated gif demonstrating UI Editor(which included in the binary release):

1 Like

Happy New Year!
Myra 0.5.6 has been released.
List of improvements:

  • Style Variants.
    Now you can declare multiple variants of style for every widget. I.e.:
"textButton": {
        "background": "button",
        "pressedBackground": "button-down",
        "overBackground": "button-over",
        "label": {
            "font": "default-font",
            "textColor": "white",
            "disabledTextColor": "grey"
        },
        "variants": {
            "blue": { 
                "background": "button-blue",
                "pressedBackground": "button-blue-down",
                "overBackground": "button-blue-down"
            }
        }
    }

‘blue’ is style variant for TextButton widget. The corresponding TextButton could be created with following code:

var textButton = new TextButton("blue");

New feature is supported in the UI Editor:

  • Added TextButton widget. Now Myra has 3 button widgets: TextButton(has only text), ImageButton(only image) and ordinary Button(can have both image and text). All of it are demonstrates on the AllWidgetsSample:

  • Simplification of Serialization System
    Now serialization of properties having default values is omitted in both .ui saving/loading and ‘Export To C#’. Therefore .ui and generated .cs files became much smaller.
  • Fixes for following issues: #21, #23

Binary distribution link: [https://github.com/rds1983/Myra/releases/download/0.5.6.113/Myra.0.5.6.113.zip]
(https://github.com/rds1983/Myra/releases/download/0.5.6.113/Myra.0.5.6.113.zip)
NuGet had been updated too as always.

I’ve a question for everyone who uses Myra.
I am thinking about moving off MonoGame.Extended. Particulary that means Myra will stop using MGE’s BitmapFont and start to use MG’s SpriteFont. What do you think about this idea?
If that idea will be met with negativity or even with neutrality, I wont do it.

5 Likes

Hi rds1983…

I have returned to my game project development after working for an extended time on another project. :relaxed:

I have successfully implemented the basic Myra-UI code for a master menu. However, how do I get my menu-bar to extend across the width of my game-screen?

Currently, I have only one master-menu master item with one sub-item in it, which I am planning on using on testing out some code for my hexagonal war-game map. Yet, the master-menu-bar only extends to the size of my single master-menu master-item.

I would like to have the menu-bar background extend across my game screen as it does in your sample code and the Myra-UI Editor.

Thank you… :relaxed:

I believe I may have answered my own question by using the “horizontal menu” widthhint property.

Hi @SNaidamast,
I think it also could be archieved by setting HorizontalAlignment property to HorizontalAlignment.Stretch.

Thank you for the reply, rds1983… :relaxed: