20,741
edits
(→tag) |
|||
Line 32: | Line 32: | ||
{{Note|The following code is sufficiently self-contained, so that it can be put into a separate Nasal module, but also executed as a standalone snippet using the [[Nasal Console]]}} | {{Note|The following code is sufficiently self-contained, so that it can be put into a separate Nasal module, but also executed as a standalone snippet using the [[Nasal Console]]}} | ||
<syntaxhighlight lang="nasal"> | <syntaxhighlight lang="nasal"> | ||
var (width,height) = (320, | var (width,height) = (320,320); | ||
var svg_filename = "/ | var svg_filename = "/Textures/img.svg"; | ||
var title = 'SVGTest: '~svg_filename; | var title = 'SVGTest: '~svg_filename; | ||
# create a new window, dimensions are WIDTH x HEIGHT, using the dialog decoration (i.e. titlebar) | # create a new window, dimensions are WIDTH x HEIGHT, using the dialog decoration (i.e. titlebar) | ||
Line 55: | Line 54: | ||
var svg_symbol = root.createChild('group'); | var svg_symbol = root.createChild('group'); | ||
canvas.parsesvg(svg_symbol, svg_filename); | canvas.parsesvg(svg_symbol, svg_filename); | ||
</syntaxhighlight> | </syntaxhighlight> | ||