yeah, you can use different 2D panels - they can be switched easily, too - best to refer to the 2D panel of the c172p (reference plan).
I am not sure if anyone has previously created a 2D panels with canvas textures - but it should be possible actually, but it's been years since I looked at the 2D panel stuff.
The C++ code should be easy enough to extend to make this work (if necessary).
However, to be perfectly honest - I would tackle the whole thing differently, and just use a conventional Canvas GUI dialog and set up your 2D panel inside that - you can load existing textures and other artwork just fine, with a little Nasal coding you could even set up the animation logic automatically:
http://wiki.flightgear.org/Howto:Parsin ... the_CanvasNote that there is no reason why you should not be able to also load other 2D instruments into the same dialog, and change the dialog decoration/transparency as you see fit.
In other words, my suggestion would be to let the 2D panel stuff alone, and just use a conventional Canvas GUI dialog, and load 2D instruments into that - or create new ones from scratch using conventional Inkscape/GIMP images.
That should be pretty straightforward to do - if you'd like to use existing 2D instruments, it would be much easier to code a simple parser that loads the XML file and maps that to a handful of Canvas primitives, analogous to svg.nas (or the pui2canvas parser).
For starters, see:
https://sourceforge.net/p/flightgear/fg ... E.xmlpanelhttps://sourceforge.net/p/flightgear/fg ... .minipanelIn addition, do note that the 2D panel stuff is considered to be legacy code that is in the process of being revamped by James, as part of unifying the 2d rendering back-end:
http://wiki.flightgear.org/Unifying_the ... via_canvasHis most recent comments related to this are quoted below:
http://wiki.flightgear.org/Canvas_News#2D_PanelsJames wrote:James has done most of the work to port the 2D panels to use Canvas, and will do the C++ HUD next, and hence is creating Canvas elements bypassing the Nasal API
Do note however that the approach that is taken now is not in line with the original consensus on the devel list to come up with a Nasal space parser and augment the Canvas C++ code as necessary, so that the 2D panel back-end would become maintainable by fgdata contributors - so, I am not sure if James has meanwhile shared any of this code or not, since it seems he's using a pure C++ approach instead of a scripted parser. If in doubt, I'd suggest getting in touch via the devel list, because this is something that James mentioned being working on (on/off) over the years - so better to discuss this before duplicating effort here.
But again, writing a Nasal space parser to map the existing 2D panel stuff to Canvas primitives would be pretty straightforward actually.