Board index FlightGear Development Canvas

Hacking canvas_demo.nas

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.

Hacking canvas_demo.nas

Postby Kabuki » Tue Feb 05, 2013 3:12 am

I'm starting to hack at the canvas_demo.nas file that's used by the c172 demo plane... :?

:?:Is it necessary to restart flightgear every time I make a change to the file?
:?:

Please, let there be a way to debug/reload just that file...
This is a family-friendly saloon. No talk stink.
Kabuki
 
Posts: 584
Joined: Sat Oct 24, 2009 12:21 am
Location: Usually on the ground, always in the sky, except when underwater.
Callsign: Kabuki
Version: 3.0.0
OS: Windows 7

Re: Hacking canvas_demo.nas

Postby Hooray » Tue Feb 05, 2013 4:05 am

I think it cannot currently be easily reloaded, but it should not be too difficult to change that - we just need a way to explicitly remove/clear the whole canvas, stop all functions/loops/listeners, reset the namespace and load the file from disk again to start over. I agree, that would seem to be pretty useful for more rapid development.

Ideally, all aircraft specific Nasal files would become reloadable like this - but explicit design is easier to implement ...
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: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: Hacking canvas_demo.nas

Postby jam007 » Tue Feb 05, 2013 9:30 am

I also noted that the canvas doesn't work after you done a Debug-> Reload aircraft model. Something you tend to do a lot when placing instruments.
So yes having reloadable canvases would be a great help in aircraft development. Especially since more and more instruments probably will be canvas based.
jam007
 
Posts: 579
Joined: Sun Dec 16, 2012 11:04 am
Location: Uppsala, Sweden
Callsign: LOOP
Version: 2020.4.0
OS: Ubuntu 22.04

Re: Hacking canvas_demo.nas

Postby Hooray » Tue Feb 05, 2013 11:21 pm

could you please file a feature request for this ?
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: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: Hacking canvas_demo.nas

Postby TheTom » Wed Feb 06, 2013 12:20 am

Hooray wrote in Tue Feb 05, 2013 11:21 pm:could you please file a feature request for this ?

I'm reading this forum, so this is not really needed. I think I also already know the cause for this. Reloading a canvas shouldn't be too difficult if using io.load_nasal to load the according Nasal files.

/* edit: I've now pushed a fix to SimGear and FlightGear. Reloading should now work properly */
TheTom
 
Posts: 322
Joined: Sun Oct 09, 2011 11:20 am

Re: Hacking canvas_demo.nas

Postby jam007 » Fri Feb 15, 2013 3:48 pm

Thanks.
:)
Makes testing much easier :!:
jam007
 
Posts: 579
Joined: Sun Dec 16, 2012 11:04 am
Location: Uppsala, Sweden
Callsign: LOOP
Version: 2020.4.0
OS: Ubuntu 22.04


Return to Canvas

Who is online

Users browsing this forum: No registered users and 4 guests