Board index FlightGear Development Canvas

SVG text masks in Canvas (split)

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.

SVG text masks in Canvas (split)

Postby Hooray » Sun Feb 28, 2016 3:41 pm

Trying to keep this constructive and posting a follow-up below:
Subject: FMC
Thorsten wrote:the question is about low level tasks - animate a set of gauges or indicators. Display numbers. This can be achieved in different ways, how to do it efficiently depends on where the data resides in the first place (Richard has for instance a HUD data provider to interface between property tree and HUD, systems may be modeled in Nasal in the first place,...) and it depends on design needs/wants (I like the idea of creating an SVN text mask of displays rather than u

Assuming that you are referring to SVG (not SVN), the parser would probably need to be extended according to your requirements, i.e. you would still be calling Canvas code, but it would be hidden by the parser handling the details. Like I said, it's in $FG_ROOT/Nasal/canvas/svg.nas - not sure if you have ever looked at it, but you would basically want to look at the handling of other tags/attributes and then add to the operand stack accordingly, so that Canvas.Path (OpenVG) instructions are used. For text handling, it would mainly be the osgText stuff and everything the underlying parent class (Canvas.Element) supports. For raster image handling, it would be the Canvas.Image class. Nested SVGs (e.g. via include) are a different matter, i.e. would need to call the parser recursively.
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: 11437
Joined: Tue Mar 25, 2008 8:40 am

Re: SVG text masks in Canvas (split)

Postby Thorsten » Mon Feb 29, 2016 3:18 pm

If you're been following the Shuttle commits as you say, I'm surprised you didn't catch the fact that the existing design of all the DPS displays are based on SVG text masks with the variable elements getting their text assigned runtime.

So there's nothing that needs to be extended to my requirements, nor was there a question asked from my side. I said I like the idea of SVG text masks because I see it at work.
Posts: 11327
Joined: Mon Nov 02, 2009 8:33 am

Return to Canvas

Who is online

Users browsing this forum: No registered users and 1 guest