CanvasScript3
>
Tests
> Graphics - LineStyle
Code
var stage = new Stage("canvas", 420, 500, 30); var shape; //thickness shape = new Shape(); shape.x = 20; shape.y = 20; shape.graphics.lineStyle(1); shape.graphics.moveTo(0, 0); shape.graphics.lineTo(80, 0); shape.graphics.lineStyle(10); shape.graphics.moveTo(0, 80); shape.graphics.lineTo(80, 80); shape.graphics.lineStyle(20); shape.graphics.moveTo(0, 160); shape.graphics.lineTo(80, 160); stage.addChild(shape); //color shape = new Shape(); shape.x = 140; shape.y = 20; shape.graphics.lineStyle(20, 0xFF0000); shape.graphics.moveTo(0, 0); shape.graphics.lineTo(80, 0); shape.graphics.lineStyle(20, 0x00FF00); shape.graphics.moveTo(0, 80); shape.graphics.lineTo(80, 80); shape.graphics.lineStyle(20, 0x0000FF); shape.graphics.moveTo(0, 160); shape.graphics.lineTo(80, 160); stage.addChild(shape); //alpha shape = new Shape(); shape.x = 260; shape.y = 20; shape.graphics.lineStyle(20, 0x000000, 1); shape.graphics.moveTo(0, 0); shape.graphics.lineTo(80, 0); shape.graphics.lineStyle(20, 0x000000, 0.5); shape.graphics.moveTo(0, 80); shape.graphics.lineTo(80, 80); shape.graphics.lineStyle(20, 0x000000, 0); shape.graphics.moveTo(0, 160); shape.graphics.lineTo(80, 160); stage.addChild(shape); //pixelHinting not supported //scaleMode not supported //caps shape = new Shape(); shape.x = 20; shape.y = 280; shape.graphics.lineStyle(20, 0x000000, 1, false, 'normal', CapsStyle.NONE); shape.graphics.moveTo(0, 0); shape.graphics.lineTo(80, 0); shape.graphics.lineStyle(20, 0x000000, 1, false, 'normal', CapsStyle.ROUND); shape.graphics.moveTo(0, 80); shape.graphics.lineTo(80, 80); shape.graphics.lineStyle(20, 0x000000, 1, false, 'normal', CapsStyle.SQUARE); shape.graphics.moveTo(0, 160); shape.graphics.lineTo(80, 160); stage.addChild(shape); //joints shape = new Shape(); shape.x = 140; shape.y = 280; shape.graphics.lineStyle(20, 0x000000, 1, false, 'normal', CapsStyle.NONE, JointStyle.BEVEL); shape.graphics.moveTo(0, 0); shape.graphics.lineTo(40, 40); shape.graphics.lineTo(80, 0); shape.graphics.lineStyle(20, 0x000000, 1, false, 'normal', CapsStyle.NONE, JointStyle.ROUND); shape.graphics.moveTo(0, 60); shape.graphics.lineTo(40, 100); shape.graphics.lineTo(80, 60); shape.graphics.lineStyle(20, 0x000000, 1, false, 'normal', CapsStyle.NONE, JointStyle.MITER); shape.graphics.moveTo(0, 120); shape.graphics.lineTo(40, 160); shape.graphics.lineTo(80, 120); stage.addChild(shape); //miterLimit shape = new Shape(); shape.x = 260; shape.y = 280; shape.graphics.lineStyle(20, 0x000000, 1, false, 'normal', CapsStyle.NONE, JointStyle.MITER, 0.5); shape.graphics.moveTo(0, 0); shape.graphics.lineTo(40, 40); shape.graphics.lineTo(80, 0); shape.graphics.lineStyle(20, 0x000000, 1, false, 'normal', CapsStyle.NONE, JointStyle.MITER, 1.0); shape.graphics.moveTo(0, 60); shape.graphics.lineTo(40, 100); shape.graphics.lineTo(80, 60); shape.graphics.lineStyle(20, 0x000000, 1, false, 'normal', CapsStyle.NONE, JointStyle.MITER, 2.0); shape.graphics.moveTo(0, 120); shape.graphics.lineTo(40, 160); shape.graphics.lineTo(80, 120); stage.addChild(shape);
Canvas
Output