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 4: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: 584
Joined: Sun Dec 16, 2012 11:04 am
Location: Uppsala, Sweden
Callsign: LOOP
Version: 2020.4.0
OS: Ubuntu 22.04

Re: Canvas API documentation  

Postby TheTom » Fri Feb 15, 2013 7: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: 322
Joined: Sun Oct 09, 2011 11:20 am

Re: Canvas API documentation

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

Thanks!
jam007
 
Posts: 584
Joined: Sun Dec 16, 2012 11:04 am
Location: Uppsala, Sweden
Callsign: LOOP
Version: 2020.4.0
OS: Ubuntu 22.04

Re: Canvas API documentation

Postby Hooray » Fri Feb 15, 2013 11: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: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU


Return to Canvas

Who is online

Users browsing this forum: No registered users and 3 guests