20,741
edits
m (→Canvas Code:  untested - demonstrate how to move the canvas out of the window)  | 
				|||
| Line 30: | Line 30: | ||
<syntaxhighlight lang="nasal">  | <syntaxhighlight lang="nasal">  | ||
# Create a Canvas   | # Create a Canvas    | ||
var   | var myCanvas = canvas.new({  | ||
  "name": "Livery Test",   # The name is optional but allow for easier identification  | |||
  "size": [2048, 2048], # Size of the underlying texture (should be a power of 2, required) [Resolution]  | |||
  "view": [2048, 2048],  # Virtual resolution (Defines the coordinate system of the canvas [Dimensions]  | |||
                        # which will be stretched the size of the texture, required)  | |||
  "mipmapping": 1       # Enable mipmapping (optional)  | |||
});  | |||
var root = myCanvas.createGroup();  | var root = myCanvas.createGroup();  | ||
| Line 44: | Line 48: | ||
      .setFile("Aircraft/EF2000/Models/EF2000.png")  |       .setFile("Aircraft/EF2000/Models/EF2000.png")  | ||
      .setSize(2048,2048);  |       .setSize(2048,2048);  | ||
# Create a Canvas dialog window to hold the canvas and show that it's working  | |||
var window = canvas.Window.new([512,512],"dialog");  | |||
window.setCanvas(myCanvas);  | |||
</syntaxhighlight>  | </syntaxhighlight>  | ||