20,741
edits
m (→Canvas Code: more intuitive to use a hash here ?) |
m (→Canvas Code) |
||
Line 65: | Line 65: | ||
myCanvas.addPlacement({"node": "Fuselage"}); | myCanvas.addPlacement({"node": "Fuselage"}); | ||
# | # hash with all images added | ||
var layers = {}; | var layers = {}; | ||
# texture path | # texture path | ||
var path="Aircraft/EF2000/Models/"; | var path="Aircraft/EF2000/Models/"; | ||
foreach(var image; ['EF2000.png','EF2000-dirt.png']) { | foreach(var image; ['EF2000.png','EF2000-dirt.png']) { | ||
# Put a raster image into the canvas and save the image in a hash: layers['EF2000.png]. | if(contains(layers, image)) print("Warning: replacing texture (added twice): ", image); | ||
# Put a raster image into the canvas and save the image in a hash: layers['EF2000.png].hide(); | |||
layers[image] = root.createChild("image") | layers[image] = root.createChild("image") | ||
.setFile( path~image ) | .setFile( path~image ) |