Packagepegas.draw
Classpublic dynamic class RectanglePen
InheritanceRectanglePen Inheritance Pen Inheritance flash.utils.Proxy
SubclassesCornerRectanglePen, RoundedComplexRectanglePen, RoundedRectanglePen

This pen draw a rectangle shape with a Graphics object.

Example :

     import pegas.draw.Align ;
     import pegas.draw.RectanglePen ;
     import pegas.draw.FillStyle ;
     import pegas.draw.LineStyle ;
     
     stage.scaleMode = StageScaleMode.NO_SCALE ;
     stage.align = "" ;
     
     var shape:Shape = new Shape() ;
     shape.x = 740 / 2 ;
     shape.y = 420 / 2 ;
     
     var pen:RectanglePen = new RectanglePen( shape.graphics , 0, 0, 50, 50,  Align.CENTER ) ;
     pen.useClear   = true ;
     
     pen.useEndFill = true ;
     pen.fill       = new FillStyle( 0xFF0000 , 0.5 ) ;
     pen.line       = new LineStyle( 2, 0xFFFFFF , 1 ) ;
     pen.draw() ;
     



Public Properties
 PropertyDefined by
 Inheritedalign : uint
(read-write) Determinates the align value of the pen.
Pen
 Inheritedfill : IFillStyle
Determinates the fill style object of the pen.
Pen
 Inheritedgraphics : Graphics
Specifies the Graphics object belonging to this Shape object, where vector drawing commands can occur.
Pen
  height : Number
Defines the height of the shape rectangle.
RectanglePen
 Inheritedline : ILineStyle
Determinates the line style object of the pen.
Pen
  rectangle : Rectangle
[read-only] Returns the Rectangle reference of this pen.
RectanglePen
 InheriteduseClear : Boolean = true
Indicates if the clear() method is invoked at the end of the draw method.
Pen
 InheriteduseEndFill : Boolean = true
Indicates if the endFill() method is invoked at the end of the draw method.
Pen
  width : Number
Defines the width of the shape rectangle.
RectanglePen
  x : Number
Defines the x position of the shape rectangle.
RectanglePen
  y : Number
Defines the y position of the shape rectangle.
RectanglePen
Protected Properties
 PropertyDefined by
  _x : Number
The offset x position of the rectangle with the align transformation.
RectanglePen
  _y : Number
The offset y position of the rectangle with the align transformation.
RectanglePen
Public Methods
 MethodDefined by
  
RectanglePen(graphic:*, x:Number = 0, y:Number = 0, width:Number = 0, height:Number = 0, align:uint = 10)
Creates a new RectanglePen instance.
RectanglePen
 Inherited
BF(... arguments):void
Defines a shortcut reference to used the beginBitmapFill method.
Pen
 Inherited
C(... arguments):void
Defines a shortcut reference to used the curveTo method.
Pen
 Inherited
CL():void
Defines a shortcut reference to used the clear method.
Pen
  
draw(... args):void
Draws the shape.
RectanglePen
  
drawShape():void
This method contains the basic drawing shape algorithm.
RectanglePen
 Inherited
EF():void
Defines a shortcut reference to used the endFill method.
Pen
 Inherited
F(... arguments):void
Defines a shortcut reference to used the beginFill method.
Pen
 Inherited
GF(... arguments):void
Defines a shortcut reference to used the beginGradientFill method.
Pen
 Inherited
GS(... arguments):void
Defines a shortcut reference to used the lineGradientStyle method.
Pen
 Inherited
L(... arguments):void
Defines a shortcut reference to used the lineTo method.
Pen
 Inherited
M(... arguments):void
Defines a shortcut reference to used the moveTo method.
Pen
 Inherited
S(... arguments):void
Defines a shortcut reference to used the lineStyle method.
Pen
  
setPen(... args):void
Sets the shape options to defined all values to draw the shape.
RectanglePen
 Inherited
toString():String
Returns the string representation of this object.
Pen
Protected Methods
 MethodDefined by
  
Invoked to refresh the offset x and y position defines by the align property.
RectanglePen
 Inherited
callProperty(methodName:*, ... rest):*
Overrides the behavior of an object property that can be called as a function.
Pen
Property detail
heightproperty
public var height:Number

Defines the height of the shape rectangle.

rectangleproperty 
rectangle:Rectangle  [read-only]

Returns the Rectangle reference of this pen.

Implementation
    public function get rectangle():Rectangle
widthproperty 
public var width:Number

Defines the width of the shape rectangle.

_xproperty 
protected var _x:Number

The offset x position of the rectangle with the align transformation.

xproperty 
public var x:Number

Defines the x position of the shape rectangle.

_yproperty 
protected var _y:Number

The offset y position of the rectangle with the align transformation.

yproperty 
public var y:Number

Defines the y position of the shape rectangle.

Constructor detail
RectanglePen()constructor
public function RectanglePen(graphic:*, x:Number = 0, y:Number = 0, width:Number = 0, height:Number = 0, align:uint = 10)

Creates a new RectanglePen instance.

Parameters
graphic:* — The Graphics reference to control with this helper. You can passed-in a Shape or Sprite/MovieClip reference in argument.
 
x:Number (default = 0) — (optional) The x position of the pen. (default 0)
 
y:Number (default = 0) — (optional) The y position of the pen. (default 0)
 
width:Number (default = 0) — (optional) The width of the pen. (default 0)
 
height:Number (default = 0) — (optional) The height of the pen. (default 0)
 
align:uint (default = 10) — (optional) The align value of the pen. (default Align.TOP_LEFT)
Method detail
_refreshAlign()method
protected function _refreshAlign():void

Invoked to refresh the offset x and y position defines by the align property.

draw()method 
public override function draw(... args):void

Draws the shape.

Parameters
... args — (optional) The x position of the pen.
drawShape()method 
public override function drawShape():void

This method contains the basic drawing shape algorithm.

setPen()method 
public function setPen(... args):void

Sets the shape options to defined all values to draw the shape.

Parameters
... args — (optional) The x position of the pen.