Board index FlightGear Development Canvas

Canvas API documentation  Topic is solved

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.

Canvas API documentation

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

I have been searching for documentation for things like what can you set for eg. a path child. What transformations are available and their methods...
Is there one?

Right now I'm looking for how to hide and show children and to check if they are visible (if possible).

Edit: guessed show() and hide() and it worked. But have not found visibility check.
jam007
 
Posts: 477
Joined: Sun Dec 16, 2012 10:04 am
Location: Uppsala, Sweden
Version: 2017.3.1
OS: Ubuntu 16.04

Re: Canvas API documentation  

Postby TheTom » Fri Feb 15, 2013 6:01 pm

There is no real documentation. Some examples can be found in the wiki and in my fgdata branch () but most can be seen from the Nasal api.nas file (https://gitorious.org/fg/fgdata/blobs/m ... as/api.nas). There are many comments and it should be quite self-explanatory.

Checking if an element is hidden can be done with .isVisible() or getBool("visible") (see https://gitorious.org/fg/fgdata/blobs/m ... as#line161).
TheTom
 
Posts: 321
Joined: Sun Oct 09, 2011 10:20 am

Re: Canvas API documentation

Postby jam007 » Fri Feb 15, 2013 6:35 pm

Thanks!
jam007
 
Posts: 477
Joined: Sun Dec 16, 2012 10:04 am
Location: Uppsala, Sweden
Version: 2017.3.1
OS: Ubuntu 16.04

Re: Canvas API documentation

Postby Hooray » Fri Feb 15, 2013 10:52 pm

Adrian's nasal_api_doc.py script in $FG_SRC/scripts/python should automatically create updated API documentation based on the nasal source code in $FG_ROOT/Nasal (html output).
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: 11376
Joined: Tue Mar 25, 2008 8:40 am


Return to Canvas

Who is online

Users browsing this forum: No registered users and 0 guests