20,741
edits
Line 64: | Line 64: | ||
<syntaxhighlight lang="nasal"> | <syntaxhighlight lang="nasal"> | ||
var (width,height) = (512,512); | var (width,height) = (512,512); | ||
var ELEMENT_NAME = " | var ELEMENT_NAME = "viewcam"; | ||
var display_view = func(view=0) | var display_view = func(view=0) { | ||
var title = 'Canvas test:' ~ ELEMENT_NAME; | var title = 'Canvas test:' ~ ELEMENT_NAME; | ||
var window = canvas.Window.new([width,height],"dialog").set('title',title); | var window = canvas.Window.new([width,height],"dialog").set('title',title); | ||
Line 73: | Line 73: | ||
var child = root.createChild( ELEMENT_NAME ); | var child = root.createChild( ELEMENT_NAME ); | ||
child.set("view-number", view); | # child.set("view-number", view); | ||
} # display_view() | } # display_view() | ||
var totalViews = props.getNode("sim").getChildren("view"); | var totalViews = props.getNode("sim").getChildren("view"); | ||
forindex(var v;totalViews) { | |||
display_view(view: | display_view(view: v); | ||
}</syntaxhighlight> | |||
</syntaxhighlight> | |||
Aircraft developers can use the new Canvas '''view''' element simply by using the conventional approach to replace a static texture with a Canvas using a cockpit placement. | Aircraft developers can use the new Canvas '''view''' element simply by using the conventional approach to replace a static texture with a Canvas using a cockpit placement. |