| Package | graphics.drawing |
| Class | public class PageFlipPen |
| Inheritance | PageFlipPen Pen flash.utils.Proxy |
| Implements | Directionable |
Map of the page flip algorithm.
TOP_LEFT(0,0) TOP_RIGHT(1,0)
---------------------------------------------------
| <-------------------PW----------------------> |
| ^ Offset(0,0) x--> |
| | |
| | y |
| | | |
| | | |
| | V |
| | pPoints[] |
| | |
| | |
| | |
| | (T3) |
| PH ---|
| | --- /
| | --- /
| | --- /
| | --- /
| | --- /
| | --- /
| | drag --- cPoints[] /
| | \ /
| | \ /
| | \ /
| | \ /
| | \ /
| V \ /
|-------------------------------- \/
BOTTOM_LEFT(0,1) BOTTOM_RIGHT(1,1)
| Property | Defined By | ||
|---|---|---|---|
![]() | align : uint
Determinates the align value of the pen. | Pen | |
| corner : Point
The original position of the dragged point. | PageFlipPen | ||
| direction : String
Indicates the direction value of this object. | PageFlipPen | ||
| drag : Point
Indicates the position of the drag point relative to the upper-left corner. | PageFlipPen | ||
![]() | fill : IFillStyle
Determinates the fill style object of the pen. | Pen | |
![]() | graphics : *
Specifies the Graphics object belonging to this Shape object, where vector drawing commands can occur. | Pen | |
| height : Number
Indicates the height value of the pen. | PageFlipPen | ||
![]() | line : ILineStyle
Determinates the line style object of the pen. | Pen | |
| page1 : BitmapData
Determinates the first page bitmap to flip (left-top aligned). | PageFlipPen | ||
| page2 : BitmapData
Determinates the second page bitmap to flip (left-top aligned). | PageFlipPen | ||
| sensibility : int
Determinates the constraints sensibility. | PageFlipPen | ||
| smoothing : Boolean = true
Indicates whether or not use pixel smoothing render. | PageFlipPen | ||
![]() | useClear : Boolean = true
Indicates if the clear() method is invoked at the end of the draw method. | Pen | |
![]() | useEndFill : Boolean = true
Indicates if the endFill() method is invoked at the end of the draw method. | Pen | |
| width : Number
Determinates the width of this distort pen. | PageFlipPen | ||
| Method | Defined By | ||
|---|---|---|---|
PageFlipPen(graphic:*, page1:BitmapData, page2:BitmapData, ... rest)
Creates a new PageFlipPen instance. | PageFlipPen | ||
![]() | BF(... arguments):void
Defines a shortcut reference to used the beginBitmapFill method. | Pen | |
![]() | C(... arguments):void
Defines a shortcut reference to used the curveTo method. | Pen | |
![]() | CL():void
Defines a shortcut reference to used the clear method. | Pen | |
compute(drag:Point, corner:Point, w:int, h:int, isHorizontal:Boolean, sens:int):Object [static]
Computes and generates a new flip. | PageFlipPen | ||
draw(... args):void [override]
Draws the shape and flip the two pages (BitmapData) into the provided Graphics. | PageFlipPen | ||
drawShape():void [override]
This method contains the basic drawing shape algorithm. | PageFlipPen | ||
![]() | EF():void
Defines a shortcut reference to used the endFill method. | Pen | |
![]() | F(... arguments):void
Defines a shortcut reference to used the beginFill method. | Pen | |
![]() | GF(... arguments):void
Defines a shortcut reference to used the beginGradientFill method. | Pen | |
![]() | GS(... arguments):void
Defines a shortcut reference to used the lineGradientStyle method. | Pen | |
![]() | L(... arguments):void
Defines a shortcut reference to used the lineTo method. | Pen | |
![]() | M(... arguments):void
Defines a shortcut reference to used the moveTo method. | Pen | |
![]() | 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. | PageFlipPen | ||
setSize(width:Number, height:Number):void
Sets the size of this pen and re-initializes the triangular grid. | PageFlipPen | ||
| Method | Defined By | ||
|---|---|---|---|
initialize():void
Initialize the pen. | PageFlipPen | ||
| Constant | Defined By | ||
|---|---|---|---|
| BOTTOM_LEFT : Point [static]
The bottom left position of the page. | PageFlipPen | ||
| BOTTOM_RIGHT : Point [static]
The bottom right position of the page. | PageFlipPen | ||
| TOP_LEFT : Point [static]
The top left position of the page. | PageFlipPen | ||
| TOP_RIGHT : Point [static]
The top right position of the page. | PageFlipPen | ||
| corner | property |
corner:PointThe original position of the dragged point.
You can use the PageFlipPen.BOTTOM_LEFT, PageFlipPen.BOTTOM_RIGHT, PageFlipPen.TOP_LEFT, PageFlipPen.TOP_RIGHT points.
The two possible values for its x and y properties are 0 or 1. pt(0,0) is the upper-left corner, for example, pt (1,1) is the bottom-right one.
public function get corner():Point public function set corner(value:Point):void| direction | property |
direction:StringIndicates the direction value of this object. The values of this property are Direction.HORIZONTAL("horizontal") or Direction.VERTICAL("vertical").
public function get direction():String public function set direction(value:String):voidSee also
| drag | property |
drag:PointIndicates the position of the drag point relative to the upper-left corner.
public function get drag():Point public function set drag(value:Point):void| height | property |
height:NumberIndicates the height value of the pen.
public function get height():Number public function set height(value:Number):void| page1 | property |
page1:BitmapDataDeterminates the first page bitmap to flip (left-top aligned).
public function get page1():BitmapData public function set page1(value:BitmapData):void| page2 | property |
page2:BitmapDataDeterminates the second page bitmap to flip (left-top aligned).
public function get page2():BitmapData public function set page2(value:BitmapData):void| sensibility | property |
sensibility:intDeterminates the constraints sensibility.
This parameter is a multiplicator for the constraints values.
It's intended to prevent some awefull flickering effects. Its possible value is ranged between 0.9 and 1. 0.9 -> when ptd move is free (drag'n'drop), 1 -> when the "drag" point move is progresive (tween when release). At best, you should never swap it from .9 to 1. A progressive incrementation is better. If flickering effects don't disturb you or if your ptd moves is coded, keep this parametter to 1.
public function get sensibility():int public function set sensibility(value:int):void| smoothing | property |
public var smoothing:Boolean = trueIndicates whether or not use pixel smoothing render.
| width | property |
width:NumberDeterminates the width of this distort pen.
public function get width():Number public function set width(value:Number):void| PageFlipPen | () | Constructor |
public function PageFlipPen(graphic:*, page1:BitmapData, page2:BitmapData, ... rest)Creates a new PageFlipPen instance.
Parametersgraphic:* — The Graphics reference to control with this helper. You can passed-in a Shape or Sprite/MovieClip reference in argument.
| |
page1:BitmapData — The first page bitmap (left-top aligned).
| |
page2:BitmapData — The second page bitmap (left-top aligned).
| |
... rest — All the optionals arguments to fill the setPen() method (see this method to defines all optional arguments)
|
| compute | () | method |
public static function compute(drag:Point, corner:Point, w:int, h:int, isHorizontal:Boolean, sens:int):ObjectComputes and generates a new flip.
Parameters
drag:Point — The position of the drag point (the drag one) relative to the upper-left corner.
| |
corner:Point — The original position of the dragged point.
| |
w:int — indicating the sheet width in pixels.
| |
h:int — indicating the sheet height in pixels.
| |
isHorizontal:Boolean — If true, horizontal mode is provided, if false, vertical.
| |
sens:int — The constraints sensibility.
|
Object — A generic object who containing the attributes :
|
| draw | () | method |
override public function draw(... args):voidDraws the shape and flip the two pages (BitmapData) into the provided Graphics.
Parameters
... args — The position of the drag point relative to the upper-left corner.
|
| drawShape | () | method |
override public function drawShape():voidThis method contains the basic drawing shape algorithm.
| initialize | () | method |
protected function initialize():voidInitialize the pen.
| setPen | () | method |
public function setPen(... args):voidSets the shape options to defined all values to draw the shape.
Parameters
... args — The position of the PTD point (the drag one) relative to the upper-left corner.
|
| setSize | () | method |
public function setSize(width:Number, height:Number):voidSets the size of this pen and re-initializes the triangular grid.
Parameters
width:Number — New width.
| |
height:Number — New height.
|
| BOTTOM_LEFT | Constant |
public static const BOTTOM_LEFT:PointThe bottom left position of the page.
| BOTTOM_RIGHT | Constant |
public static const BOTTOM_RIGHT:PointThe bottom right position of the page.
| TOP_LEFT | Constant |
public static const TOP_LEFT:PointThe top left position of the page.
| TOP_RIGHT | Constant |
public static const TOP_RIGHT:PointThe top right position of the page.