Nez: free, open source 2D framework

MonoGame 3.5 is basically completely broken on retina Macs. All mouse coordinated are way, way off and you can’t click and drag. Oh yeah, and the window and scaling will all be half so you’ll have everything super tiny.

If you just want to give the demo a quick look move the window so it is in the upper left of your screen then move your mouse around it until the hover effect on the buttons shows. The cursor won’t actually be over the buttons but they will still work. You can then just click to activate.

For a proper fix what I usually do is drop back to MonoGame 3.4 which does actually work on Mac.

Ah, didn’t realise that. It’s not a Retina machine FWIW. Couldn’t get it to work but it’s not important right now (I just wanted to see the samples “quickly”) and will hopefully be fixed in 3.6 and/or FNA :slight_smile:

Everything works great with FNA. I actually just use FNA myself due to MonoGame 3.5 being such a mess on Mac. FNA works perfectly on all the desktop platforms.

What settings are required to import a TexturePacker atlas? I tried “JSON (Array)” but the pipeline tool is throwing ...MyAtlas.json: error: oldValue is the empty string and not building. I did get a TexturePacker generated libGDX format atlas working though.

The standard JSON output is what the importer expects. Have a look at the importer code and you can see directly the JSON properties it expects: file and region.

Got it. Needed to uncheck the “Trim sprite names” option in TexturePacker. The error is thrown from this line in TexturePackerWriter when the region name is missing a file extension:

var regionName = region.filename.Replace( Path.GetExtension( region.filename ), string.Empty );

I notice that ScrollWheelValue gets updated even when the game doesn’t have focus which can result in various issues depending on what you’re using if for (e.g. unintended change in zoom level when game regains focus). I guess I can deal with it by setting pauseOnFocusLost to false and then using IsActive myself to properly filter out these changes but is this the only way to deal with this? I’m just thinking that if I find other reasons why I’d rather have pauseOnFocusLost set to true then I’m back to putting up with these out-of-game scroll wheel changes.

Is it possible to use both TableLayout positioning and tweening with UI elements?

I was messing around and wondered if I could start a transition from a menu screen by initally having the labels, buttons etc shoot offscreen somehow, then the elements for the next screen shoot on…

Table takes over the layout and positioning of an element so I don’t think tweening directly would work (at least off the top of my head I can’t think of a property to tween that wouldn’t affect the rest of the layout). You could pop the element out of the table, do the animation and then pop it back in the table when the animation completes.

Does the UI only work with touch controls (iOS) in screen space, or can it work when scaled to the rendertarget size?

If the latter, how? I might be being dumb but I can’t get it to work.

I have a low-res 304x240 screen set up with a TextButton in the middle, but it doesn’t seem to receive any clicks. I’ve called Input.touch.enableTouchSupport(); and confirmed that touches are coming in to Input.touch.currentTouches.

Some stripped down test code:

The UI only processes mouse input currently. Luckily, there were plans to add touch input at some point so some work was done to start the process as you can see here. It is by no means complete though.


What did you use to generate the default NezDefaultBMFont? I’m trying to load Nez.BitmapFonts and cannot seem to load mine.


Any program that can export a BM font XML file should work fine. I personally use Glyph Designer and the website Littera. If I recall, the default Nez font was a Littera export.

I’m trying to use Nez with MonoGame develop branch. There’s a few easy tweaks needed to the Nez source, but I’m stuck building an updated MonoGame.Framework PCL.

I’ve built the PCL according to these instructions and referenced it from the Nez project, but Game.Window property seems missing?

How did you build the PCL that’s bundled with Nez?

The PCL included with Nez is ancient. It isn’t from the 3.6 branch at all. If I am not mistaken the MG crew actually has a development NuGet for a proper PCL now. I can’t tell you where you can find it though as I generally use FNA for everything so I haven’t updated to 3.6 myself yet.

The portable NuGet doesn’t install unfortunately, which is why I was trying to build my own:

Could not install package 'MonoGame.Framework.Portable'. You are trying to install this package into a project that targets '.NETPortable,Version=v4.5,Profile=Profile111', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.

Eh, it was easy in the end:

Following up on [SOLVED] MonoGame.Portable & Nez

I fired up my Windows 10 VM and put the Nez default effect sources into the 3.6 pipeline tool, but it produced .xnb files not the .mgfxo files (whatever those are?) Nez seems to want. I was able to build a test .mgfxo from the command line with 2MGFX and successfully run it on my Nez+MG3.6 iOS project so that part works, but I couldn’t see how to do it in a 3.6 content project.

I haven’t a clue. I didn’t update to 3.6 at all yet. I’m waiting for it to be released before updating. I had too many issues using it in beta state.

Hi. Is it possible to get the code for the sample UI project you used in this video

Also, does Nez UI already support animations? Not looking for anything fancy. A simple bounce in/out of elements will do it for me.

Thanks in advance.