Canvas snippets: Difference between revisions

Jump to navigation Jump to search
m (→‎Adding a NavDisplay: http://forum.flightgear.org/viewtopic.php?f=25&t=25331&p=232113&hilit=cdu#p232109)
Line 75: Line 75:
<syntaxhighlight lang="nasal" enclose="div">
<syntaxhighlight lang="nasal" enclose="div">


var filename = "Textures/Splash1.png";
# path is relative to $FG_ROOT (base package)
var path = "Textures/Splash1.png";
# create an image child for the texture
# create an image child for the texture
var child=root.createChild("image")
var child=root.createChild("image")
          .setFile( filename )
          .setFile( path )
  .setTranslation(100,10)
  .setTranslation(100,10)
                                   .setSize(130,130);
                                   .setSize(130,130);

Navigation menu