Board index FlightGear Development Canvas

New/experimental Canvas elements (sandbox on the wiki)

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.

New/experimental Canvas elements (sandbox on the wiki)

Postby Hooray » Tue Nov 10, 2015 7:09 pm

Over the last 3 years we have seen a number of feature requests, and ideas, related to new/experimental canvas elements, to support features which cannot currently be supported easily.

The most popular feature request clearly being a dedicated "Camera" element to draw slave cameras to a Canvas, i.e. for supporting mirror textures or tail cameras (A380/787 etc).

Equally, some of our avionics developers need certain functionality such as loading/rendering 3D models or supporting spatial data formats like GeoTIFF/Shapefiles to create compelling moving maps.

More recently, we are seeing a revamped interest in supporting PDF rendering, so that charts can be displayed right inside the main fgfs window, but also to display aircraft specific help files and/or the manual itself.

In summary, many of these features may become useful at some point, and implementing them is usually not overly difficult, especially when looking at OpenSceneGraph examples and some OSG tutorials, to adapt those and "wrap" them within a corresponding Canvas::Element/Image child class.

The most difficult part for people familiar with OSG is probably coming to grips with how Canvas and its elements, but also the cmake build system work under the hood.

For that reason, we have begun documenting the common steps by using the FlightGear wiki as a boilerplate "code generator" which can create working stubs to implement custom Canvas elements and register/expose those at the property tree level.

Obviously, people will still need to be familiar with building from source, using git and OpenGL/OSG - but otherwise, these code snippets will hopefully help lower the barrier to entry for those wanting to extend the Canvas system beyond the original 2D use-case.

Equally, I am hoping to extend/refine those code snippets and templates to add more pointers and links to relevant tutorials - so that we can hopefully grow a library of useful code snippets for features that may not yet be ready for "prime time", but which have still been discussed/requested pretty frequently - so that we can eventually turn those ideas into features that content developers can use in the future.

For details, please check out the Canvas Sandbox article at:
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,
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Posts: 12058
Joined: Tue Mar 25, 2008 8:40 am

Return to Canvas

Who is online

Users browsing this forum: No registered users and 1 guest