Packageardisia.layouts
Classpublic class CarouselLayout
InheritanceCarouselLayout Inheritance spark.layouts.supportClasses.LayoutBase

Lays out elements in a carousel pattern. Supports virtualization by restricting the number of displayed elements to the "maxVisibleVirtualElements" property value.

Not a typical layout in the sense that there is no scroll position or overflow along a linear axis. Instead, layout occurs at angles along an arc from 0 to 360 degrees. If layout is not virtualized, all elements are displayed along the arc. If virtualization is enabled, only the visible elements are displayed along the arc.

View the technical documentation on the Ardisia Labs website for more information.



Public Properties
 PropertyDefined By
  alphaFrom : Number
The alpha value for the centered, lowest z value element.
CarouselLayout
  alphaTo : Number
The alpha value for elements at the highest possible z value.
CarouselLayout
  angleOffset : Number
The number of degrees to offset the element angles.
CarouselLayout
  arcLength : Number
The degrees of an arc to render the elements along in degrees.
CarouselLayout
  centerOffsetX : Number
The offset from the center of the carousel in the x direction.
CarouselLayout
  centerOffsetY : Number
The offset from the center of the carousel in the y direction.
CarouselLayout
  fieldOfView : Number
The field of view to apply to the perspective projection on the target.
CarouselLayout
  maxVisibleVirtualElements : int
The maximum number of elements to display for virtual layouts.
CarouselLayout
  perspectiveProjectionCenterOffsetX : Number
The x offset from the center to apply the perspective projection.
CarouselLayout
  perspectiveProjectionCenterOffsetY : Number
The y offset from the center to apply the perspective projection.
CarouselLayout
  radiusX : Number
The radius of the carousel along the x axis.
CarouselLayout
  radiusY : Number
The radius of the carousel along the y axis.
CarouselLayout
  radiusZ : Number
The radius of the carousel along the z axis.
CarouselLayout
  rotationX : Number
The x rotation to apply to the elements.
CarouselLayout
  rotationY : Number
The y rotation to apply to the elements.
CarouselLayout
  rotationZ : Number
The z rotation to apply to the elements.
CarouselLayout
Public Methods
 MethodDefined By
  
getAngleOffsetToElement(index:int):Number
Return the angle offset necessary to center the passed element index in the carousel.
CarouselLayout
Protected Methods
 MethodDefined By
  
getElementAngles():Vector.<Number>
Returns a vector of angles the elements will be displayed at.
CarouselLayout
Property Detail
alphaFromproperty
alphaFrom:Number

The alpha value for the centered, lowest z value element.

The default value is 1.


Implementation
    public function get alphaFrom():Number
    public function set alphaFrom(value:Number):void
alphaToproperty 
alphaTo:Number

The alpha value for elements at the highest possible z value.

The default value is 1.


Implementation
    public function get alphaTo():Number
    public function set alphaTo(value:Number):void
angleOffsetproperty 
angleOffset:Number

The number of degrees to offset the element angles.

Use this property to center a element and iterate this property to animate the carousel.

The default value is 0.


Implementation
    public function get angleOffset():Number
    public function set angleOffset(value:Number):void
arcLengthproperty 
arcLength:Number

The degrees of an arc to render the elements along in degrees.

Defaults to a full circle, E.G. 360 degrees.

Only relevant for non-virtualized layouts.

The default value is 360.


Implementation
    public function get arcLength():Number
    public function set arcLength(value:Number):void
centerOffsetXproperty 
centerOffsetX:Number

The offset from the center of the carousel in the x direction.

The default value is 0.


Implementation
    public function get centerOffsetX():Number
    public function set centerOffsetX(value:Number):void
centerOffsetYproperty 
centerOffsetY:Number

The offset from the center of the carousel in the y direction.

The default value is 0.


Implementation
    public function get centerOffsetY():Number
    public function set centerOffsetY(value:Number):void
fieldOfViewproperty 
fieldOfView:Number

The field of view to apply to the perspective projection on the target.

The default value is 55.


Implementation
    public function get fieldOfView():Number
    public function set fieldOfView(value:Number):void
maxVisibleVirtualElementsproperty 
maxVisibleVirtualElements:int

The maximum number of elements to display for virtual layouts.

The default value is 10.


Implementation
    public function get maxVisibleVirtualElements():int
    public function set maxVisibleVirtualElements(value:int):void
perspectiveProjectionCenterOffsetXproperty 
perspectiveProjectionCenterOffsetX:Number

The x offset from the center to apply the perspective projection.

The default value is 0.


Implementation
    public function get perspectiveProjectionCenterOffsetX():Number
    public function set perspectiveProjectionCenterOffsetX(value:Number):void
perspectiveProjectionCenterOffsetYproperty 
perspectiveProjectionCenterOffsetY:Number

The y offset from the center to apply the perspective projection.

The default value is 0.


Implementation
    public function get perspectiveProjectionCenterOffsetY():Number
    public function set perspectiveProjectionCenterOffsetY(value:Number):void
radiusXproperty 
radiusX:Number

The radius of the carousel along the x axis. Defaults to the radius of the container if NaN.

Note: even though the radius is the same as the container, the carousel will not fill the container's space because the elements are projected back along the z-axis.

The default value is NaN.


Implementation
    public function get radiusX():Number
    public function set radiusX(value:Number):void
radiusYproperty 
radiusY:Number

The radius of the carousel along the y axis. Defaults to the radius of the container along the vertical axis if NaN.

The default value is NaN.


Implementation
    public function get radiusY():Number
    public function set radiusY(value:Number):void
radiusZproperty 
radiusZ:Number

The radius of the carousel along the z axis. If NaN, will be set to the value for radiusX to create a circular 3D carousel appearance.

The default value is NaN.


Implementation
    public function get radiusZ():Number
    public function set radiusZ(value:Number):void
rotationXproperty 
rotationX:Number

The x rotation to apply to the elements.

The default value is 0.


Implementation
    public function get rotationX():Number
    public function set rotationX(value:Number):void
rotationYproperty 
rotationY:Number

The y rotation to apply to the elements.

When set to NaN (the default) the angle will be calculated automatically.

The default value is NaN.


Implementation
    public function get rotationY():Number
    public function set rotationY(value:Number):void
rotationZproperty 
rotationZ:Number

The z rotation to apply to the elements.

The default value is 0.


Implementation
    public function get rotationZ():Number
    public function set rotationZ(value:Number):void
Method Detail
getAngleOffsetToElement()method
public function getAngleOffsetToElement(index:int):Number

Return the angle offset necessary to center the passed element index in the carousel.

Parameters

index:int — the int of the element to get the angleOffset

Returns
Number — a Number of degrees
getElementAngles()method 
protected function getElementAngles():Vector.<Number>

Returns a vector of angles the elements will be displayed at.

Returns
Vector.<Number> — Vector.Number