Package | com.nocircleno.graffiti.tools |
Class | public class ShapeTool |
Inheritance | ShapeTool ![]() |
Implements | ITool |
Language Version : | ActionScript 3.0 |
Runtime Versions : | AIR 1.0, Flash Player 10 - AIR 1.5 |
Property | Defined By | ||
---|---|---|---|
fillAlpha : Number | ShapeTool | ||
fillColor : int | ShapeTool | ||
mode : String | ShapeTool | ||
renderType : String [read-only]
Shape Render Mode
| ShapeTool | ||
strokeAlpha : Number | ShapeTool | ||
strokeColor : int | ShapeTool | ||
strokeWidth : Number | ShapeTool | ||
type : String | ShapeTool |
Method | Defined By | ||
---|---|---|---|
ShapeTool(strokeWidth:Number = 1, strokeColor:int = 0x000000, fillColor:int = 0xFFFFFF, strokeAlpha:Number = 1, fillAlpha:Number = 1, shapeType:String = null, toolMode:String = null)
The ShapeTool constructor. | ShapeTool | ||
apply(drawingTarget:DisplayObject, point1:Point, point2:Point = null):void
The apply method applies the line to the Sprite object passed
to the method. | ShapeTool | ||
resetTool():void
The resetTool method will clear the drawing commands and data. | ShapeTool |
fillAlpha | property |
fillAlpha:Number
[read-write] public function get fillAlpha():Number
public function set fillAlpha(value:Number):void
fillColor | property |
fillColor:int
[read-write] public function get fillColor():int
public function set fillColor(value:int):void
mode | property |
mode:String
[read-write] public function get mode():String
public function set mode(value:String):void
renderType | property |
renderType:String
[read-only] Shape Render Mode
public function get renderType():String
strokeAlpha | property |
strokeAlpha:Number
[read-write] public function get strokeAlpha():Number
public function set strokeAlpha(value:Number):void
strokeColor | property |
strokeColor:int
[read-write] public function get strokeColor():int
public function set strokeColor(value:int):void
strokeWidth | property |
strokeWidth:Number
[read-write] public function get strokeWidth():Number
public function set strokeWidth(value:Number):void
type | property |
type:String
[read-write] public function get type():String
public function set type(value:String):void
ShapeTool | () | Constructor |
public function ShapeTool(strokeWidth:Number = 1, strokeColor:int = 0x000000, fillColor:int = 0xFFFFFF, strokeAlpha:Number = 1, fillAlpha:Number = 1, shapeType:String = null, toolMode:String = null)
The ShapeTool
constructor.
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.
| |
strokeAlpha:Number (default = 1 ) — Stroke Alpha, default is 1.
| |
fillAlpha:Number (default = 1 ) — Fill Alpha, default is 1.
| |
shapeType:String (default = null ) — Type of Shape.
| |
toolMode:String (default = null ) — Tool mode the Shape will be drawing with.
|
// create a rectangle shape with red stroke width of 2 and no fill var rectangleShape:Shape = new Shape(2, 0xFF0000, -1, 1, 1, ShapeType.RECTANGLE);
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.
|
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.