20,741
edits
Line 165: | Line 165: | ||
Consult your mobile devices operation manual about how to add a web page as a full screen App. | Consult your mobile devices operation manual about how to add a web page as a full screen App. | ||
== Learning Canvas using Copy & Paste == | |||
Given that we still have aircraft developers who consider [[Canvas]] programming too 'inaccessible', we've started a dedicate wiki article for gathering useful Canvas snippets - early Canvas adopters are obviously invited to help grow this library of snippets over time to turn this into a useful repository for all people wanting to do Canvas development in some shape or form. For starters, here's a simple snippet creating a GUI dialog: | |||
{| class="wikitable" | |||
|- | |||
! Screenshot !! Code !! | |||
|- | |||
| [[File:Snippets-canvas-dialog.png|left|thumb|This is what the [[Nasal]]/[[Canvas]] snippet will look like once you pasted it into the [[Nasal Console]] and click "Execute".]] || {{Note|This example uses so called method chaining, if you're not familiar with the concept, please see: [[Object_Oriented_Programming_with_Nasal#More_on_methods:_Chaining|Method Chaining]].}} | |||
<syntaxhighlight lang="nasal" enclose="div"> | |||
# create a new window, dimensions are 320 x 160, using the dialog decoration (i.e. titlebar) | |||
var window = canvas.Window.new([320,160],"dialog"); | |||
# adding a canvas to the new window and setting up background colors/transparency | |||
var myCanvas = window.createCanvas().set("background", canvas.style.getColor("bg_color")); | |||
# Using specific css colors would also be possible: | |||
# myCanvas.set("background", "#ffaac0"); | |||
# creating the top-level/root group which will contain all other elements/group | |||
var root = myCanvas.createGroup(); | |||
</syntaxhighlight> | |||
|- | |||
|} | |||
See: [[Canvas Snippets]] | |||
== Dynamic Liveries via Canvas / Proof of Concept: Exhaust dirt== | == Dynamic Liveries via Canvas / Proof of Concept: Exhaust dirt== | ||
''by [[User:Algernon|Algernon]] ([[User talk:Algernon|talk]]) 17:09, 17 September 2014 (UTC) '' | ''by [[User:Algernon|Algernon]] ([[User talk:Algernon|talk]]) 17:09, 17 September 2014 (UTC) '' | ||
Line 182: | Line 208: | ||
To learn more, see [[Howto:Dynamic Liveries via Canvas]] | To learn more, see [[Howto:Dynamic Liveries via Canvas]] | ||
== Interview with a contributor == | == Interview with a contributor == | ||