| Package | vegas.display |
| Class | public class Parallaxe |
| Inheritance | Parallaxe Object |
| Property | Defined 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 | ||
| Method | Defined 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 | ||
interpolate():void
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 | ||
| area | property |
area:RectangleThe area Rectangle to defines the limits of the parallaxe effect.
public function get area():Rectangle public function set area(value:Rectangle):void| bounds | property |
public var bounds:RectangleThe optional Rectange to defines the bounds of the parallaxe effect.
| focus | property |
focus:PointIndicates the focus position of the parallaxe.
public function get focus():Point public function set focus(value:Point):void| main | property |
main:DisplayObjectIndicates the main DisplayObject of the parallaxe, this DisplayObject must be registered in the model.
public function get main():DisplayObject public function set main(value:DisplayObject):void| scale | property |
scale:NumberThe scale value of the parallaxe area (default 1).
public function get scale():Number public function set scale(value:Number):void| smoothing | property |
public var smoothing:Number = 10The smoothing value of the parallaxe.
| Parallaxe | () | Constructor |
public function Parallaxe(area:Rectangle)Creates a new Parallaxe instance.
Parametersarea:Rectangle — The area Rectangle reference of the parallaxe effect.
|
| 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.
|
Boolean — true 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():voidRemoves all layers in the parallaxe tool.
| interpolate | () | method |
public function interpolate():voidInterpolates the parallaxe effect and update all layers (equals update(false)).
| isEmpty | () | method |
public function isEmpty():BooleanReturns true if this parallaxe model is empty.
ReturnsBoolean — true if this parallaxe model is empty.
|
| removeLayer | () | method |
public function removeLayer(target:DisplayObject):BooleanRemoves the specified DisplayObject registered in the parallaxe tool (remove this layer).
Parameters
target:DisplayObject |
Boolean — true if the layer is removed with the specified target.
|
| size | () | method |
public function size():uintIndicates the numbers of layers registered in the parallaxe tool.
Returnsuint |
| update | () | method |
public function update(now:Boolean = true):voidUpdates all the layers.
Parameters
now:Boolean (default = true) — Indicates if the update is instant or if use interpolation with the smoothing value.
|