To set the rendering style for corners, we use lineStyle( )'s joints parameter. : lineStyle « Graphics « Flash / Flex / ActionScript






To set the rendering style for corners, we use lineStyle( )'s joints parameter.

 

package{
  import flash.display.*;
  
  public class Main extends Sprite{
    public function Main(){

        var triangle:Shape = new Shape(  );
        triangle.graphics.lineStyle(20, 0, 1, false, LineScaleMode.NORMAL,
                                    CapsStyle.ROUND, JointStyle.MITER);
        
        triangle.graphics.beginFill(0xFF0000, 1);
        triangle.graphics.lineStyle(20);
        triangle.graphics.lineTo(125, 125); // Draw a line down and right
        triangle.graphics.lineTo(250, 0);   // Draw a line up and right
        triangle.graphics.lineTo(0, 0);     // Draw a line left
        triangle.graphics.endFill(  );
        addChild(triangle);
    }
  }
}

        








Related examples in the same category

1.To turn the stroke off completely, set thickness to undefined or call lineStyle( ) with no parameters.
2.Set Caps style to Round
3.The following code sets the line style to 1 pixel-thick, solid black:
4.Set the line style to 1 pixel-thick, solid green
5.Set the line style to 2 pixels thick, 50% transparent green
6.Apply a 3 pixel-thick blue stroke
7.Change line style while drawing