Packagecom.nocircleno.graffiti.tools
Classpublic class LineTool
InheritanceLineTool Inheritance Object
Implements ITool

Language Version : ActionScript 3.0
Runtime Versions : AIR 1.0, Flash Player 10 - AIR 1.5

LineTool Class allows the user to draw a SOLID, DASHED or DOTTED line on the canvas.



Public Properties
 PropertyDefined By
  alpha : Number
LineTool
  color : uint
LineTool
  lineWidth : Number
LineTool
  mode : String
LineTool
  renderType : String
[read-only] Line Render Mode
LineTool
  type : String
LineTool
Public Methods
 MethodDefined By
  
LineTool(lineWidth:Number = 4, lineColor:uint = 0x000000, lineAlpha:Number = 1, lineType:String = null, toolMode:String = null)
The LineTool constructor.
LineTool
  
apply(drawingTarget:DisplayObject, point1:Point, point2:Point = null):void
The apply method applies the line to the Sprite object passed to the method.
LineTool
  
resetTool():void
The resetTool method will clear the drawing commands and data.
LineTool
Property Detail
alphaproperty
alpha:Number  [read-write]


Implementation
    public function get alpha():Number
    public function set alpha(value:Number):void
colorproperty 
color:uint  [read-write]


Implementation
    public function get color():uint
    public function set color(value:uint):void
lineWidthproperty 
lineWidth:Number  [read-write]


Implementation
    public function get lineWidth():Number
    public function set lineWidth(value:Number):void
modeproperty 
mode:String  [read-write]


Implementation
    public function get mode():String
    public function set mode(value:String):void
renderTypeproperty 
renderType:String  [read-only]

Line Render Mode


Implementation
    public function get renderType():String
typeproperty 
type:String  [read-write]


Implementation
    public function get type():String
    public function set type(value:String):void
Constructor Detail
LineTool()Constructor
public function LineTool(lineWidth:Number = 4, lineColor:uint = 0x000000, lineAlpha:Number = 1, lineType:String = null, toolMode:String = null)

The LineTool constructor.

Parameters
lineWidth:Number (default = 4) — Line width.
 
lineColor:uint (default = 0x000000) — Line Color.
 
lineAlpha:Number (default = 1) — Type of Line.
 
lineType:String (default = null) — Tool mode the Line will be drawing with.
 
toolMode:String (default = null)

Example
The following code creates a Line instance.
        // create a dotted line of size 8 and the color of red
        var dottedLine:Line = new Line(8, 0xFF0000, 1, LineType.DOTTED);
        
Method Detail
apply()method
public function apply(drawingTarget:DisplayObject, point1:Point, point2:Point = null):void

The apply method applies the line to the Sprite object passed to the method.

Parameters

drawingTarget:DisplayObject — Sprite that the line will draw to.
 
point1:Point — Starting point to apply line.
 
point2:Point (default = null) — End point to apply line.

resetTool()method 
public function resetTool():void

The resetTool method will clear the drawing commands and data. This is used by the GraffitiCanvas after the Mouse has been released.