| Package | com.gestureworks.cml.layouts |
| Class | public class PileLayout |
| Inheritance | PileLayout LayoutFactory ObjectFactory flash.events.EventDispatcher |
var randomRotationPile:Container = getImageContainer();
randomRotationPile.x = 700;
randomRotationPile.y = 200;
randomRotationPile.applyLayout(getPileLayout());
addChild(randomRotationPile);
var fixedRotationPile:Container = getImageContainer();
fixedRotationPile.x = 1000;
fixedRotationPile.y = 500;
fixedRotationPile.applyLayout(getPileLayout(20));
addChild(fixedRotationPile);
function getImageContainer():Container
{
var container:Container = new Container();
container.addChild(getImageElement("plane.jpg"));
container.addChild(getImageElement("plane.jpg"));
container.addChild(getImageElement("plane.jpg"));
container.addChild(getImageElement("plane.jpg"));
container.addChild(getImageElement("plane.jpg"));
container.addChild(getImageElement("plane.jpg"));
return container;
}
function getPileLayout(angle:Number = 0):PileLayout
{
var pileLayout:PileLayout = new PileLayout();
pileLayout.angle = angle;
pileLayout.tween = true;
pileLayout.tweenTime = 1500;
return pileLayout;
}
function getImageElement(source:String):Image
{
var img:Image = new Image();
img.open(source);
img.width = 250;
img.height = 150;
img.resample = true;
return img;
}
See also
| Property | Defined By | ||
|---|---|---|---|
![]() | alpha : Number
Specifies the alpha value of the display objects in the layout
| LayoutFactory | |
| angle : Number | PileLayout | ||
![]() | cacheTransforms : Boolean
Flag indicating the childTransformations are to be cached and reapplied for convenience. | LayoutFactory | |
![]() | centerColumn : Boolean
Flag indicating the alignment of the objects' centers with the center of the column. | LayoutFactory | |
![]() | centerRow : Boolean
Flag indicating the alignment of the objects' centers with the center of the row. | LayoutFactory | |
![]() | cmlIndex : int
sets the index of cml
| ObjectFactory | |
![]() | continuousTransform : Boolean
Flag indicating the application of a transform relative to the current transform. | LayoutFactory | |
![]() | easing : *
Specifies the easing equation. | LayoutFactory | |
![]() | exclusions : Array
An array of objects to exclude from the layout application
| LayoutFactory | |
![]() | id : String
sets the id
| ObjectFactory | |
![]() | marginX : Number | LayoutFactory | |
![]() | marginY : Number
Spacing added to the height of an object
| LayoutFactory | |
![]() | onComplete : Function
Function to call on layout complete
| LayoutFactory | |
![]() | onUpdate : Function
Function to call on layout update
| LayoutFactory | |
![]() | originX : Number
Starting x coordinate of layout relative to the container
| LayoutFactory | |
![]() | _originY : Number = 0 | LayoutFactory | |
![]() | originY : Number
Starting y coordinate of layout relative to the container
| LayoutFactory | |
![]() | propertyStates : Array Deprecated: Please Use state | ObjectFactory | |
| rotation : Number [override]
Since this is a rotation dependent layout, override the rotation mutator to prevent conflicts. | PileLayout | ||
![]() | scale : Number
Specifies the scale value of the display objects in the layout
| LayoutFactory | |
![]() | spacingX : Number
Horizontal distance between the origins of two objects
| LayoutFactory | |
![]() | spacingY : Number
Vertical distance between the origins of two objects
| LayoutFactory | |
![]() | state : Array
property states array
| ObjectFactory | |
![]() | tween : Boolean
Flag indicating the display objects will animate to their layout positions. | LayoutFactory | |
![]() | tweenTime : Number
The time(ms) the display objects will take to move into positions
| LayoutFactory | |
![]() | type : String
Specifies a layout subtype
| LayoutFactory | |
![]() | useMargins : Boolean
Flag indicating the use of margins or spacing
| LayoutFactory | |
| Method | Defined By | ||
|---|---|---|---|
Constructor
| PileLayout | ||
![]() | clone():*
Returns clone of self
| ObjectFactory | |
dispose():void [override]
Disposal function
| PileLayout | ||
![]() | killTween(child:* = null):void
Kills the tweening of the provided child. | LayoutFactory | |
layout(container:DisplayObjectContainer):void [override]
Centers and rotates the container's display objects around a common point. | PileLayout | ||
![]() | parseCML(cml:XMLList):XMLList
parses cml file
| ObjectFactory | |
![]() | postparseCML(cml:XMLList):void
postparse method
| ObjectFactory | |
![]() | updateProperties(state:Number = 0):void
update the properties
| ObjectFactory | |
| angle | property |
angle:Number public function get angle():Number public function set angle(value:Number):void| rotation | property |
rotation:Number[override] Since this is a rotation dependent layout, override the rotation mutator to prevent conflicts.
public function get rotation():Number public function set rotation(value:Number):void| PileLayout | () | Constructor |
public function PileLayout()Constructor
| dispose | () | method |
override public function dispose():voidDisposal function
| layout | () | method |
override public function layout(container:DisplayObjectContainer):voidCenters and rotates the container's display objects around a common point. If the angle of rotation has not been defined, the angle is random.
Parameters
container:DisplayObjectContainer |