Packagecom.nocircleno.graffiti.tools
Classpublic class Shape
InheritanceShape Inheritance Object
Implements ITool

Shape Class allows the user to draw RECTANGLE, SQUARE, OVAL or CIRCLE to the canvas. You can control the stroke and fill of the shape.



Public Properties
 PropertyDefined By
  fillColor : int
Shape
  mode : String
Shape
  renderType : String
[read-only] Shape Render Mode
Shape
  strokeColor : int
Shape
  strokeWidth : Number
Shape
  type : String
Shape
Public Methods
 MethodDefined By
  
Shape(strokeWidth:Number = 1, strokeColor:int = 0x000000, fillColor:int = 0xFFFFFF, shapeType:String = null, toolMode:String = null)
The Shape constructor.
Shape
  
apply(drawingTarget:DisplayObject, point1:Point, point2:Point = null):void
The apply method applies the line to the Sprite object passed to the method.
Shape
Property Detail
fillColorproperty
fillColor:int  [read-write]


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


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

Shape Render Mode


Implementation
    public function get renderType():String
strokeColorproperty 
strokeColor:int  [read-write]


Implementation
    public function get strokeColor():int
    public function set strokeColor(value:int):void
strokeWidthproperty 
strokeWidth:Number  [read-write]


Implementation
    public function get strokeWidth():Number
    public function set strokeWidth(value:Number):void
typeproperty 
type:String  [read-write]


Implementation
    public function get type():String
    public function set type(value:String):void
Constructor Detail
Shape()Constructor
public function Shape(strokeWidth:Number = 1, strokeColor:int = 0x000000, fillColor:int = 0xFFFFFF, shapeType:String = null, toolMode:String = null)

The Shape constructor.

Parameters
strokeWidth:Number (default = 1) — Stroke width.
 
strokeColor:int (default = 0x000000) — Stroke Color, pass -1 for NO stroke on Shape.
 
fillColor:int (default = 0xFFFFFF) — Fill Color, pass -1 for NO fill in Shape.
 
shapeType:String (default = null) — Type of Shape.
 
toolMode:String (default = null) — Tool mode the Shape will be drawing with.

Example
The following code creates a Shape instance.
        // create a rectangle shape with red stroke width of 2 and no fill
        var rectangleShape:Shape = new Shape(2, 0xFF0000, -1, ShapeType.RECTANGLE);
        
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 Shape will draw to.
 
point1:Point — Starting point to apply Shape.
 
point2:Point (default = null) — End point to apply Shape.