Canvas snippets: Difference between revisions

Jump to navigation Jump to search
m
→‎Adding OpenVG Paths: http://forum.flightgear.org/viewtopic.php?f=4&t=25747&p=238677&hilit=curves#p238677
m (→‎Adding OpenVG Paths: http://forum.flightgear.org/viewtopic.php?f=4&t=25747&p=238677&hilit=curves#p238677)
Line 146: Line 146:
|-
|-
|}
|}
{| class="wikitable"
|-
! Screenshot !! Code
|-
| [[File:Canvas-openvg-quadTo.png|thumb|screen shot showing a simple Canvas GUI dialog demonstrating how to use OpenVG-path drawing via Nasal and Canvas (Canvas/OpenVG quadTo API for drawing curves)]]
| {{Note|This assumes that you are appending this to the snippet shown above.}}
<syntaxhighlight lang="nasal" enclose="div">
var points = [ 60,height-20,
230,height-100,
];
var track = graph.createChild("path", "track")
.moveTo(10, height/2)
.quadTo( points )
.setColor(0,1,0)
.setStrokeLineWidth(4);
</syntaxhighlight>
|-
|}


{| class="wikitable"
{| class="wikitable"

Navigation menu