Packagevegas.display
Classpublic class Parallaxe
InheritanceParallaxe Inheritance Object

This container register DisplayObjects to creates a layers parallaxe effect.



Public Properties
 PropertyDefined By
  area : Rectangle
The area Rectangle to defines the limits of the parallaxe effect.
Parallaxe
  bounds : Rectangle
The optional Rectange to defines the bounds of the parallaxe effect.
Parallaxe
  focus : Point
Indicates the focus position of the parallaxe.
Parallaxe
  main : DisplayObject
Indicates the main DisplayObject of the parallaxe, this DisplayObject must be registered in the model.
Parallaxe
  scale : Number
The scale value of the parallaxe area (default 1).
Parallaxe
  smoothing : Number = 10
The smoothing value of the parallaxe.
Parallaxe
Public Methods
 MethodDefined By
  
Parallaxe(area:Rectangle)
Creates a new Parallaxe instance.
Parallaxe
  
addLayer(target:DisplayObject, main:Boolean = false, dimension:Rectangle = null, offset:Point = null, scaling:Boolean = false):Boolean
Parallaxe
  
clear():void
Removes all layers in the parallaxe tool.
Parallaxe
  
Interpolates the parallaxe effect and update all layers (equals update(false)).
Parallaxe
  
isEmpty():Boolean
Returns true if this parallaxe model is empty.
Parallaxe
  
removeLayer(target:DisplayObject):Boolean
Removes the specified DisplayObject registered in the parallaxe tool (remove this layer).
Parallaxe
  
size():uint
Indicates the numbers of layers registered in the parallaxe tool.
Parallaxe
  
update(now:Boolean = true):void
Updates all the layers.
Parallaxe
Property Detail
areaproperty
area:Rectangle

The area Rectangle to defines the limits of the parallaxe effect.


Implementation
    public function get area():Rectangle
    public function set area(value:Rectangle):void
boundsproperty 
public var bounds:Rectangle

The optional Rectange to defines the bounds of the parallaxe effect.

focusproperty 
focus:Point

Indicates the focus position of the parallaxe.


Implementation
    public function get focus():Point
    public function set focus(value:Point):void
mainproperty 
main:DisplayObject

Indicates the main DisplayObject of the parallaxe, this DisplayObject must be registered in the model.


Implementation
    public function get main():DisplayObject
    public function set main(value:DisplayObject):void
scaleproperty 
scale:Number

The scale value of the parallaxe area (default 1).


Implementation
    public function get scale():Number
    public function set scale(value:Number):void
smoothingproperty 
public var smoothing:Number = 10

The smoothing value of the parallaxe.

Constructor Detail
Parallaxe()Constructor
public function Parallaxe(area:Rectangle)

Creates a new Parallaxe instance.

Parameters
area:Rectangle — The area Rectangle reference of the parallaxe effect.
Method Detail
addLayer()method
public function addLayer(target:DisplayObject, main:Boolean = false, dimension:Rectangle = null, offset:Point = null, scaling:Boolean = false):Boolean

Parameters

target:DisplayObject — The DisplayObject reference of the layer.
 
main:Boolean (default = false) — Indicates if the target is the main layer of the parallaxe container.
 
dimension:Rectangle (default = null) — An optional Rectangle to defines a custom area size of the layer. By default the target parameter is used to defines this property.
 
offset:Point (default = null) — The optional offset position of the layer (default [0,0]).
 
scaling:Boolean (default = false) — Indicates if the layer can be scalled.

Returns
Booleantrue if the target is a new DisplayObject, if the target is already registered this layer change only and the method return false.
clear()method 
public function clear():void

Removes all layers in the parallaxe tool.

interpolate()method 
public function interpolate():void

Interpolates the parallaxe effect and update all layers (equals update(false)).

isEmpty()method 
public function isEmpty():Boolean

Returns true if this parallaxe model is empty.

Returns
Boolean — true if this parallaxe model is empty.
removeLayer()method 
public function removeLayer(target:DisplayObject):Boolean

Removes the specified DisplayObject registered in the parallaxe tool (remove this layer).

Parameters

target:DisplayObject

Returns
Booleantrue if the layer is removed with the specified target.
size()method 
public function size():uint

Indicates the numbers of layers registered in the parallaxe tool.

Returns
uint
update()method 
public function update(now:Boolean = true):void

Updates all the layers.

Parameters

now:Boolean (default = true) — Indicates if the update is instant or if use interpolation with the smoothing value.