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 2: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: 587
Joined: Fri Oct 23, 2009 11:21 pm
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 3: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: 11437
Joined: Tue Mar 25, 2008 8:40 am

Re: Hacking canvas_demo.nas

Postby jam007 » Tue Feb 05, 2013 8: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: 477
Joined: Sun Dec 16, 2012 10:04 am
Location: Uppsala, Sweden
Version: 2017.3.1
OS: Ubuntu 16.04

Re: Hacking canvas_demo.nas

Postby Hooray » Tue Feb 05, 2013 10: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: 11437
Joined: Tue Mar 25, 2008 8:40 am

Re: Hacking canvas_demo.nas

Postby TheTom » Tue Feb 05, 2013 11:20 pm

Hooray wrote in Tue Feb 05, 2013 10: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: 321
Joined: Sun Oct 09, 2011 10:20 am

Re: Hacking canvas_demo.nas

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

Thanks.
:)
Makes testing much easier :!:
jam007
 
Posts: 477
Joined: Sun Dec 16, 2012 10:04 am
Location: Uppsala, Sweden
Version: 2017.3.1
OS: Ubuntu 16.04


Return to Canvas

Who is online

Users browsing this forum: No registered users and 2 guests