Canvas troubleshooting: Difference between revisions

Jump to navigation Jump to search
m
no edit summary
mNo edit summary
mNo edit summary
Line 79: Line 79:


<syntaxhighlight lang="nasal">
<syntaxhighlight lang="nasal">
var filename = getprop('/sim/fg-hime')~'WholeCanvas.xml';
var filename = getprop('/sim/fg-home')~'/Export/WholeCanvas.xml';
io.write_properties(filename, myCanvas);
io.write_properties(filename, props.wrap(myCanvas._node));
</syntaxhighlight>
</syntaxhighlight>
The output, written to [[$FG_HOME]]/Export/WholeCanvas.xml, would look like this:
<syntaxhighlight lang="xml">
<?xml version="1.0"?>
<PropertyList>
  <status type="int">1</status>
  <status-msg type="string">Creation pending...</status-msg>
  <blend-source-rgb type="string">src-alpha</blend-source-rgb>
  <view type="double">320</view>
  <view n="1" type="double">160</view>
  <size type="double">320</size>
  <size n="1" type="double">160</size>
  <placement>
    <type type="string">window</type>
    <id type="string">1</id>
  </placement>
  <blend-destination-rgb type="string">one-minus-src-alpha</blend-destination-rgb>
  <blend-source-alpha type="string">zero</blend-source-alpha>
  <blend-destination-alpha type="string">one</blend-destination-alpha>
  <data-focused type="long">1</data-focused>
  <background type="string">rgba(242,241,240,1)</background>
</PropertyList>
</syntaxhighlight>
Do note that this is an entirely valid [[PropertyList]] encoded XML file, which means that it could be also used to unserialize the Canvas, i.e. reading it back into FG to create a new valid Canvas and display the texture there. The main limitation here being that this would be a "passive" Canvas only, without any listeners/timers etc being bound obviously, because just the visual aspects of the original Canvas texture would be re-created, but none of the logics used to originally create/animate the Canvas (think PFD, ND, CDU or Map):
<syntaxhighlight lang="nasal">
</syntaxhighlight>


== Profiling Canvas code ==
== Profiling Canvas code ==

Navigation menu