Howto:Creating SVG-based Canvas Avionics
|This article is a stub. You can help the wiki by|
- Scripted SVG parser for Canvas
- Howto:Coding a simple Nasal Framework
| The FlightGear forum has a
subforum related to: Canvas
|Normally, you would start by prototyping instruments using a standalone GUI dialog, which greatly simplifies the whole prototyping process, because reloading/switching aircraft in FG still works only very unreliably - equally, lose coupling is much easier to accomplish by using a standalone GUI dialog.
For starters, you will probably want to use the Nasal console and play with the code snippets from: Canvas Snippets The whole idea of this article is to get people started doing basic stuff, and then let them integrate things as required - i.e. "Canvas Snippets" is all about providing building blocks that can be adapted as needed. In other words, feel free to ask questions or help improve the wiki docs if you think anything is missing - please do so via the main Canvas forum, we should usually be able to answer most questions pretty quickly, or at least provide snippets/pointers to snippets. You will definitely benefit from understanding Nasal, and object-oriented programming in particular, a few fairly accessible introductory articles are these: Howto:Start using vectors and hashes in Nasal
Object Oriented Programming with Nasal Once you have worked through these and played with a few examples, I would suggest to look at the Canvas docs, the API reference, and the snippets on the wiki. For prototyping purposes, I would suggest to create a standard canvas GUI dialog: Howto:Creating a Canvas GUI dialog file
And you should also learn how to use io.include() and friends to split up your Nasal sources into separate files and make things more modular. Note that you don't need to be an experienced Nasal coder to use Nasal/Canvas, but understanding a few basic concepts will greatly simplify the whole process.
The other part of this is artwork, which is usually created/edited using the Inkscape SVG editor. And it also makes sense to look at people who have previously done related work (e.g. Gijs, Hyde, artix, Philosopher, TheTom etc) - if in doubt, check the commit logs of aircraft using Canvas to look up whose involved. (but please don't just send tons of PMs to those, but instead ask general questions on the forum, and offer to provide something in return, i.e. document your journey, help improve the wiki/docs or help improve/write tutorials etc) For a few more relevant pointers/discussions, please see:
search.php?st=0&sk=t&sd=d&sr=posts&keywords=nasal+canvas+animated+timers+listeners (it would be great, if someone could copy relevant stuff over to the wiki so that these postings can be turned into a new wiki article) Features closely related to existing stuff (think PFD, ND, EICAS/EFIS) would ideally be based on adapting, generaliing and refactoring existing code (as per Gijs' ND effort) though - but you would inevitably benefit from knowing how Nasal/Canvas work under the hood, especially in order to learn how to use the corresponding frameworks (think MapStructure), because most people have a hard time understanding the reasons for contributing to a generic/aircraft-agnostic effort even though their primary motivation is a single project only. Feel free to get in touch via the forum/wiki if you have any specific questions and nobody else seems to be around to answer those.strictly speaking, 3D modeling will remain largely irrelevant for anything involving MFDs, it will only start becoming slightly relevant when all prototyping is finished, i.e. when you hook up your Nasal/Canvas code and SVG artwork to the cockpit and stop using a standalone GUI dialog. Overall, 3D modeling has little (if any) bearing on 2D MFDs - and people focusing on that, merely demonstrate to fellow coders that their priorities/interests or skills are elsewhere (you could look at the FARMIN effort).