Snagar Development Site
  • Home
  • News
  • Plugins
  • Applications
    • Mission-X Editor
    • Mission Installer
    • Scripts
  • Missions
  • Documentation
    • Overview of XML Writing
    • XSD: XML Schema Definition
    • v2.0 Tutorials >
      • intro [v2.0]
      • Triggers and Events [v2.0] >
        • Solution 02 [v2.0]
      • Mission Ending [v2.0]
      • Dropping Object [v2.0]
  • Staff

UI = User Interface = Head Ache

18/11/2017

0 Comments

 
Hi All,

It has been some time since I last update this blog, but I promise there was a reason.
Since X-Plane 11.10b1 came out, it was the perfect time to start experiment and implement its new features.
After reading the new SDK examples I started testing and building a simple UI.
Very fast I reached the point were I found that the old issues we had prior to 11.10 are still there. Meaning, fonts management is lousy. Fonts has one size which makes it hard to read.

Since few years back I read some info on TTF baking and such, I decided to try my luck.
My first attempt was to load TTF fonts into memory (using stb_fonts library), make a texture out of them and then print to screen.
It worked.
But not as I expected, * sigh *.
The font did display itself, but it was flipped, as if mirrored in water. I tried playing with the viewing projection but that did not solve the alignments of the characters. Here is an example:

Picture
This is just an example of the issue. You can see that the characters are aligned but flipped.

Since I reached a dead end, I had no idea how to re-project the font texture correctly, I moved to plan B. Search the net.
I searched for libraries that will give me a simple 2D UI interface based on OpenGL.
I stumbled upon few interesting libraries, such as "TurboBudger" and "Dear imgui" but then I found "Nuklear". A one file header library that used techniques from "imgui" but store everything in one neat header file. No dependencies to other libraries (all stb_xxx code has been implemented in same header as far as I understand) and you can use your own code/alternatives for certain implementations (like image load).
Overall, I was impressed with this library potential, my only problem was the lack of documentation, well there is some documentation but as detail comments inside the code, it is probably OK for seasoned programmers, but not easy for a casual one like me.
It took me few days to implement Nuklear and many trials and errors until I was able to provide it with the right data it needs to self handle itself. My only bump so far is related to scroll-bars, I have no idea what it needs for scroll-bar to work, so I adapt a no scroll-bar interface, as I sometime say: if you can't win them, workaround them.

My goal is not to have a [complex] UI for Misson-X but a simplified and functional interface were it is easy to read and get a long.
Worse, my "hard work" these past weeks, will probably need to go to the bean, once LR will move to pure Vulkan/Metal.
My expectations, and I wrote Tyler my concerns, is that LR will prepare a cross platform SDK that will give us developers a building blocks to build UI for X-Plane and it should work on all supported OSes.
From [my] point of view, that is the correct approach from day one, but since LR have their own priorities, I can just hope that [they] will listen to reason and won't publish their Vulkan/Metal builds without good UI foundation for their developers.

Here are images from the new Mission-X UI, I borrowed few ideas from FSW to make it simpler.



Picture

I hope that all interaction with the plugin will take place through one screen.
The first screen, when there is no running mission, is the mission pick screen. In each screen you can see only 4 supported missions and a thumbnail with few words regarding the mission (like the name). Currently you only see three images, because the 4th is a work in progress that I use for testing and maybe for my document.
(The designer is responsible to prepare that image, I'll prepare a boilerplate).

I used FSW as a guide line to these screens, but in no way it mimics them, FSW has a talented team which push their UI and their sim in interesting directions.

Picture
Once you picked a mission, you can read about it in the "Mission details" screen.
You can see the type of plane, difficulty, recommended setup and the "story" behind the mission.

If you are satisfied, you can press the [LOAD] button.
Pressing [Back] will bring you back to the "Mission picker" screen.

Picture
If mission load was successful, then the [LOAD] button is transitioned to [START] button.
If you want to start the mission then just press [START] and you will be positioned at the starting location of the mission or you can still cancel the mission, by pressing the [Back] button, which will take you back to the "Mission picker" screen.

I hope you enjoy[ed] what you [have seen].
The Nuklear library really allow me to concentrate on the plugin, it free my time so I'll be able to go back and actually work on the plugin itself.
Currently I'm still finalizing the UI for alpha build, and it might change in the future. I also need to finalize save and load, not sure it will make to first alpha public build.

I hope to share the first public alpha soon but I need to work on documentation and tutorials and I do not have much time, which can push the first publication back for few weeks.

As you all have seen, there are some fundamental changes to the "mission packaging" and file locations. Nothing is set in stone. I'll publish the new changes on later date.

In any case, if you have any questions, suggestions or requests, please do send me an e-mail.

Until next time
Cheers
Saar

0 Comments

    Author

    Creation is something I always wanted to do. Since I'm not that good in painting/writing, I decided to contribute in programming.

    Archives

    October 2019
    August 2019
    February 2019
    January 2019
    December 2018
    November 2018
    August 2018
    July 2018
    April 2018
    February 2018
    January 2018
    December 2017
    November 2017
    October 2017
    September 2017
    August 2017
    July 2017
    April 2017
    November 2016
    September 2016
    August 2016
    April 2016
    February 2016
    January 2016
    December 2015
    August 2015
    July 2015
    May 2015
    April 2015
    March 2015
    February 2015
    October 2014
    April 2014
    February 2014
    December 2013
    November 2013
    September 2013
    August 2013
    April 2013
    March 2013
    November 2012
    August 2012
    July 2012
    May 2012
    April 2012
    March 2012
    January 2012
    December 2011
    November 2011
    October 2011
    September 2011
    August 2011
    June 2011
    May 2011
    April 2011
    March 2011
    February 2011
    January 2011
    December 2010
    November 2010
    October 2010
    September 2010

    RSS Feed

Powered by Create your own unique website with customizable templates.