Board index FlightGear Development Canvas

Canvas GUI & Michat's GUI mockups

Canvas is FlightGear's new fully scriptable 2D drawing system that will allow you to easily create new instruments, HUDs and even GUI dialogs and custom GUI widgets, without having to write C++ code and without having to rebuild FlightGear.

Re: Canvas GUI & Michat's GUI mockups

Postby Johan G » Fri May 10, 2013 8:57 pm

Low-level flying — It's all fun and games till someone looses an engine. (Paraphrased from a YouTube video)
Improving the Dassault Mirage F1 (Wiki, Forum, GitLab. Work in slow progress)
Johan G
Moderator
 
Posts: 5546
Joined: Fri Aug 06, 2010 5:33 pm
Location: Sweden
Callsign: SE-JG
IRC name: Johan_G
Version: 3.0.0
OS: Windows 7, 32 bit

Re: Canvas GUI & Michat's GUI mockups

Postby TheTom » Fri May 10, 2013 9:31 pm

I have already done a basic version: http://www.mail-archive.com/flightgear- ... 40059.html. Its no finished yet, but it is already able to correctly display distance and a closing rate bar. And also arrows are placed upon azimuth deviation (but not with different action depending on the amount of deviation yet). Also for example slow down and parking brake messages are missing.
TheTom
 
Posts: 321
Joined: Sun Oct 09, 2011 10:20 am

Re: Canvas GUI & Michat's GUI mockups

Postby Michat » Sat May 11, 2013 2:07 pm

Hi again, I was on trouble trying to Imagine what specific task may I start First, because you are faster than me, I'm running at 333 mgz and 800mgz old PC, so I have my limitations, for that, I requested more than basic help to Hooray, because I can't install FG. So he gaves me the specific info I need. Thanks HOO.

But other doubts remains in the desktop that I move here:


"Now without more information I have big headache trying to imagine what we need. Also I read some news from Tom adapting canvas to the DOM. Now my big doubt is if we use FGCanvas/Dom we can consider that our used technique (images) are valid? Because if DOMable maybe it can be CSSable."


Another thing I wish to point if that user Trez made and excellent theme using code, don't know if he is also the author of the last replay I saw in FG (my controls). He did it good by code.
Now we move to another system.

For me there is not problem to create all custom images that we'll need. My concerns are:

If the code Is always faster than graphics, we must work with portion of code and portion of graphics. IF canvas can draw tables and borders, no needed graphic tabs, and we will have solved big issue fitting text, getting new technical quests.

Now I'm very lost.

I leave to your discretion the best way to do it. I'll be very proud to assist with any specific graphic element you need. grateful if you could specify the maximum your requirements.
If you need a tab, a background, no matter If I have to change it n times. I'll be more confortable if for example you say "today I want a square widget that will show..... whatever." You may understand that what I see is nothing, so for me is great help to see your canvas screenies.

Tell me where to start. The menu, the isolated buttons..... it's up to your FGCSS.

@TheTom I can do and attempt of your visual docking guidance system texture, if this is a 2d, have you got the image to see the size and recreated?, for the VDGS chassis an panel we can do it in a rush, same as when rally timer.

@Johan G good spotting. 8) :roll: :D

Thank you.
User avatar
Michat
 
Posts: 976
Joined: Mon Jan 25, 2010 6:24 pm
Location: Spain
Version: 191b
OS: GNewSense

Re: Canvas GUI & Michat's GUI mockups

Postby jam007 » Sat May 11, 2013 4:58 pm

I realised one very interesting use of the new 3D-object click function.
Lets say you have this radio control unit.
Image
Instead of making a lot of pick animations for all buttons. You could replace the texture with a canvas objekt. Put the texture-file as an image on the canvas and then use the UV-coordinates to register the different clicks with canvas Nasal.
Made a small test with a dice that prints to the console the side you clicked on. Files here.

Is it possible to make animations in Nasal rather than setting properties used by xml-code? If not you have to make an xml animation file for the different buttons movement in the example above if you want these to be seen.
jam007
 
Posts: 477
Joined: Sun Dec 16, 2012 10:04 am
Location: Uppsala, Sweden
Version: 2017.3.1
OS: Ubuntu 16.04

Re: Canvas GUI & Michat's GUI mockups

Postby Philosopher » Sat May 11, 2013 5:02 pm

Actually, in addition to the knob/slider animation, having a button animation would be useful as well! I wonder if one could do it so you can move the mouse over all of the buttons without releasing and see them move, like a piano keyboard :D.

No you cannot use Nasal for animations, it's a temporary PropertyList file/tree, deleted after use, inaccessible from other places, and the only way to use Nasal is to read it in, change it, write it out, and reload the model.
Thanks,
Philosopher
(inactive but lurking occasionally...)
Philosopher
 
Posts: 1590
Joined: Sun Aug 12, 2012 6:29 pm
Location: Stuck in my head...
Callsign: AFTI
Version: Git
OS: Mac OS X 10.7.5

Re: Canvas GUI & Michat's GUI mockups

Postby jam007 » Sat May 11, 2013 5:57 pm

Philosopher wrote in Sat May 11, 2013 5:02 pm:the only way to use Nasal is to read it in, change it, write it out, and reload the model.

Can you reload a single model?
If so you cold make a script that creates the xml-file and reloads it. In a case like the the control unit above this could me useful. A loop that makes the animation-xml for all buttos and the canvas takes care of the "picking".
jam007
 
Posts: 477
Joined: Sun Dec 16, 2012 10:04 am
Location: Uppsala, Sweden
Version: 2017.3.1
OS: Ubuntu 16.04

Re: Canvas GUI & Michat's GUI mockups

Postby Philosopher » Sat May 11, 2013 6:02 pm

Not being familiar with anything beyond 2.6, I cannot say, but I believe I've seen a "reload aircraft model" button, particularly with F-JJTH's video showing the blender plugin for animations... Or it could be in my 2.8 version that I've used 5 times :(. But if there is such a menu button, it's just a fgcommand as usual and could easily be done with a Nasal script.
Thanks,
Philosopher
(inactive but lurking occasionally...)
Philosopher
 
Posts: 1590
Joined: Sun Aug 12, 2012 6:29 pm
Location: Stuck in my head...
Callsign: AFTI
Version: Git
OS: Mac OS X 10.7.5

Re: Canvas GUI & Michat's GUI mockups

Postby jam007 » Sat May 11, 2013 6:10 pm

Yes there is a reload aircraft model. And it works (except that at least for me the sound disappears). Very useful when placing instruments etc.
Code: Select all
      <item>
         <name>reload-model</name>
         <binding>
            <command>reinit</command>
            <subsystem>aircraft-model</subsystem>
              </binding>
      </item>
jam007
 
Posts: 477
Joined: Sun Dec 16, 2012 10:04 am
Location: Uppsala, Sweden
Version: 2017.3.1
OS: Ubuntu 16.04

Re: Canvas GUI & Michat's GUI mockups

Postby Gijs » Sat May 11, 2013 6:33 pm

This only reloads the model files. So if your Nasal is included within the model XML files, then it is also reloaded. Same as with "Reload GUI". If your nasal code is references from elsewhere (eg. through the <nasal> section of -set.xml), it won't be reloaded. Since it has to reload ALL of the model, it takes some seconds. Therefore you don't want to loop it. Just use the property tree like it's meant to be used and you save yourself a lot of trouble ;-)

I reported the sound issue earlier today: http://code.google.com/p/flightgear-bug ... il?id=1118
Airports: EHAM, EHLE, KSFO
Aircraft: 747-400
User avatar
Gijs
Moderator
 
Posts: 9386
Joined: Tue Jul 03, 2007 2:55 pm
Location: Amsterdam/Delft, the Netherlands
Callsign: PH-GYS
Version: Git
OS: Windows 10

Re: Canvas GUI & Michat's GUI mockups

Postby jam007 » Sat May 11, 2013 6:58 pm

I'm just exploring the possibilities with the new canvas system.
Actually. There is not much point in creating the animation xml in nasal at start up since you probably have the same result every startup.
But if it was possible to more directly animate via nasal it would be neat to have:
*user input handling
*2D graphics
*3D animation
*internal functions
In one nasal file for eg. an instrument.
jam007
 
Posts: 477
Joined: Sun Dec 16, 2012 10:04 am
Location: Uppsala, Sweden
Version: 2017.3.1
OS: Ubuntu 16.04

Re: Canvas GUI & Michat's GUI mockups

Postby Hooray » Sat May 11, 2013 7:10 pm

IF canvas can draw tables and borders

The Canvas system is "just" a property-driven wrapper on top of OpenVG, so you can draw all sorts of fancy things using vector graphics, incuding tables, borders etc.

Tom implemented a basic SVG parser that turns the SVG image into OpenVG paths.
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11437
Joined: Tue Mar 25, 2008 8:40 am

Re: Canvas GUI & Michat's GUI mockups

Postby Michat » Sat May 11, 2013 9:41 pm

Hooray to that point I understood, but if the space required for each word changes because we use different languages? is clear that we can make tabs, but what is the technique we'll use to make the text fit on labels?. I understand that I will need to use fake spacers better than making a single mask. What is not is how to approach this dilemma. Who draw the tables- tabs and so on, is me or the code? must be the code...
User avatar
Michat
 
Posts: 976
Joined: Mon Jan 25, 2010 6:24 pm
Location: Spain
Version: 191b
OS: GNewSense

Re: Canvas GUI & Michat's GUI mockups

Postby Hooray » Sat May 11, 2013 9:52 pm

See Tom's "Copy & Paste" demo - basically, you would compute a label's bounding box and use that to dynamically adjust space as required.

Tom can probably better clarify things ...
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11437
Joined: Tue Mar 25, 2008 8:40 am

Re: Canvas GUI & Michat's GUI mockups

Postby Michat » Sat May 11, 2013 10:05 pm

Oh yes the copy paste demo has the key, now I'm more unconcerned. :oops: THANk YOU AGAIN.
Gonna make a momentary set of tabs for the interface. Just for a test. will share here. :) waiting for new reports.
User avatar
Michat
 
Posts: 976
Joined: Mon Jan 25, 2010 6:24 pm
Location: Spain
Version: 191b
OS: GNewSense

Re: Canvas GUI & Michat's GUI mockups

Postby Hooray » Sat May 11, 2013 10:11 pm

To help replace the Plib-based PUI GUI, we would mainly need artwork to help with the creation of the widgets mentioned in $FG_ROOT/Docs/README.gui - i.e. see: http://plib.sourceforge.net/pui

Depending on Tom's plans and priorities, I can then help with providing Nasal code to animate your artwork.
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11437
Joined: Tue Mar 25, 2008 8:40 am

PreviousNext

Return to Canvas

Who is online

Users browsing this forum: No registered users and 1 guest