Defines a stroke item structure, that is a curve or line segment point or an object such as a circle, ellipse or rectangle.
| StrokeItem | Defines a stroke item structure, that is a curve or line segment point or an object such as a circle, ellipse or rectangle. |
| Public enumeration constants | |
| SEGMENT_START | Start of a line segment/path. |
| SEGMENT_POINT | Continuation of a line segment/path. |
| CIRCLE | Circle shaped object. |
| ELLIPSE | Ellipse shaped object. |
| RECT | Rectangle shaped object. |
| ROUND_RECT | Rectangle shaped object with rounded corners. |
| Public data structure | |
| type | Type of item, one of the Public enumeration constants. |
| style | Line and fill StrokeStyle in effect for the item. |
| strokePoint | Primary stroke point for the item. |
| controlPoint | Secondary control point for the item. |
| cornerPoint | Tertiary corner point only used to define a rounded rectangle’s corner size. |
| strokeSprite | Sprite representing the primary stroke point. |
| controlSprite | Sprite representing the secondary control point. |
| cornerSprite | Sprite representing the tertiary corner point. |
| isDefaultItem | State set to true when a default segment start item is created. |
| Structure creation | |
| StrokeItem | Constructor for creation of a StrokeItem. |
| updateItem | Change type and points on the existing StrokeItem. |
| clone | Returns a deep copy of the StrokeItem instance. |
| createPointSprite | Creates a point sprite representing one of the points defined in a StrokeItem. |
| Structure destruction | |
| dispose | Removes all referenced data from the instance. |
| removeSprites | Remove all point sprites from the display list and the StrokeItem. |
| removeControlPoint | Remove a control point sprite from the display list and the StrokeItem. |
| Structure manipulation | |
| move | Moves the StrokeItem to a new position. |
| scale | Scale the position of a StrokeItem. |
public var type: String
Type of item, one of the Public enumeration constants.
public var style: StrokeStyle
Line and fill StrokeStyle in effect for the item.
public function StrokeItem( itemParent: DisplayObjectContainer, itemType: String, itemStyle: StrokeStyle, strokePt: Point, controlPt: Point = null, cornerPt: Point = null )
Constructor for creation of a StrokeItem.
| itemParent | display object list parent |
| itemType | type of item, one of the Public enumeration constants |
| itemStyle | line and fill StrokeStyle for the item |
| strokePt | stroke point for the item |
| controlPt | optional control point (default null) |
| cornerPt | optional corner point (default null) |
public function updateItem( itemType: String, strokePt: Point, controlPt: Point = null, cornerPt: Point = null ):void
Change type and points on the existing StrokeItem.
| itemType | type of item, one of the Public enumeration constants |
| strokePt | stroke point for the item |
| controlPt | optional control point (default null) |
| cornerPt | optional corner point (default null) |
public function clone():StrokeItem
Returns a deep copy of the StrokeItem instance.
private function createPointSprite( itemParent: DisplayObjectContainer, pos: Point, spriteName: String ):Sprite
Creates a point sprite representing one of the points defined in a StrokeItem.
| itemParent | display object list parent |
| pos | a Point position |
| spriteName | a point type name as defined in <Stroke point names> |
A colored point sprite
public function removeSprites():void
Remove all point sprites from the display list and the StrokeItem.
public function removeControlPoint():void
Remove a control point sprite from the display list and the StrokeItem.
public function move( xPos: Number, yPos: Number, mirrorX: Boolean = false, mirrorY: Boolean = false ):void
Moves the StrokeItem to a new position.
| xPos | new X-axis position |
| yPos | new Y-axis position |
| mirrorX | true if mirrored in the X-axis (default false) |
| mirrorY | true if mirrored in the Y-axis (default false) |
public function scale( xScale: Number, yScale: Number ):void
Scale the position of a StrokeItem. Calls on the StrokeStyle.scale method to scale the style as well.
| xScale | horizontal scale factor |
| yScale | vertical scale factor |
Start of a line segment/path.
public static const SEGMENT_START: String
Continuation of a line segment/path.
public static const SEGMENT_POINT: String
Circle shaped object.
public static const CIRCLE: String
Ellipse shaped object.
public static const ELLIPSE: String
Rectangle shaped object.
public static const RECT: String
Rectangle shaped object with rounded corners.
public static const ROUND_RECT: String
Type of item, one of the Public enumeration constants.
public var type: String
Line and fill StrokeStyle in effect for the item.
public var style: StrokeStyle
Primary stroke point for the item.
public var strokePoint: Point
Secondary control point for the item.
public var controlPoint: Point
Tertiary corner point only used to define a rounded rectangle’s corner size.
public var cornerPoint: Point
Sprite representing the primary stroke point.
public var strokeSprite: Sprite
Sprite representing the secondary control point.
public var controlSprite: Sprite
Sprite representing the tertiary corner point.
public var cornerSprite: Sprite
State set to true when a default segment start item is created.
public var isDefaultItem: Boolean
Constructor for creation of a StrokeItem.
public function StrokeItem( itemParent: DisplayObjectContainer, itemType: String, itemStyle: StrokeStyle, strokePt: Point, controlPt: Point = null, cornerPt: Point = null )
Change type and points on the existing StrokeItem.
public function updateItem( itemType: String, strokePt: Point, controlPt: Point = null, cornerPt: Point = null ):void
Returns a deep copy of the StrokeItem instance.
public function clone():StrokeItem
Creates a point sprite representing one of the points defined in a StrokeItem.
private function createPointSprite( itemParent: DisplayObjectContainer, pos: Point, spriteName: String ):Sprite
Removes all referenced data from the instance.
public function dispose():void
Remove all point sprites from the display list and the StrokeItem.
public function removeSprites():void
Remove a control point sprite from the display list and the StrokeItem.
public function removeControlPoint():void
Moves the StrokeItem to a new position.
public function move( xPos: Number, yPos: Number, mirrorX: Boolean = false, mirrorY: Boolean = false ):void
Scale the position of a StrokeItem.
public function scale( xScale: Number, yScale: Number ):void
Scale the width of the line according the requested scaling and the setting of the LineScaleMode property.
public function scale( xScale: Number, yScale: Number ):void