Canvas SVG: Difference between revisions

Jump to navigation Jump to search
445 bytes removed ,  31 May 2020
Line 46: Line 46:


var (width, height) = (512, 512);
var (width, height) = (512, 512);
# Create a standalone Canvas(not attached to any GUI dialog / aircraft etc)
var myCanvas = canvas.new({
var myCanvas = canvas.new({
     "name": "Canvas.Image SVG Test",
     "name": "Canvas.Image SVG Test",
    # The name is optional but allow
    for easier identification "size": [width, height],
    # Size of the underlying texture(should be a power of 2, required)[Resolution]
     "view": [width, height],
     "view": [width, height],
    # Virtual resolution(Defines the coordinate system of the canvas[Dimensions] # which will be stretched the size of the texture, required)
     "mipmapping": 1  
     "mipmapping": 1 # Enable mipmapping(optional)
});
});


# set background color
myCanvas.set("background", canvas.style.getColor("bg_color"));
myCanvas.set("background", canvas.style.getColor("bg_color"));


Navigation menu