Packageorg.flintparticles.twoD.actions
Classpublic class TweenPosition
InheritanceTweenPosition Inheritance ActionBase Inheritance Object

The TweenPosition action adjusts the particle's position between two locations as it ages. The position is relative to the particle's energy, which changes as the particle ages in accordance with the energy easing function used. This action should be used in conjunction with the Age action.



Public Properties
 PropertyDefined By
  endX : Number
The X value for the particle's position when its energy is 0.
TweenPosition
  endY : Number
The y value for the particle's position when its energy is 0.
TweenPosition
 Inheritedpriority : int
Returns a default priority of 0 for this action.
ActionBase
  startX : Number
The x position for the particle's position when its energy is 1.
TweenPosition
  startY : Number
The y position for the particle's position when its energy is 1.
TweenPosition
Protected Properties
 PropertyDefined By
 Inherited_priority : int = 0
ActionBase
Public Methods
 MethodDefined By
  
TweenPosition(startX:Number = 0, startY:Number = 0, endX:Number = 0, endY:Number = 0)
The constructor creates a TweenPosition action for use by an emitter.
TweenPosition
 Inherited
addedToEmitter(emitter:Emitter):void
This method does nothing.
ActionBase
 Inherited
This method does nothing.
ActionBase
  
update(emitter:Emitter, particle:Particle, time:Number):void
[override] Calculates the current position of the particle based on it's energy.
TweenPosition
Property Detail
endXproperty
endX:Number

The X value for the particle's position when its energy is 0.


Implementation
    public function get endX():Number
    public function set endX(value:Number):void
endYproperty 
endY:Number

The y value for the particle's position when its energy is 0.


Implementation
    public function get endY():Number
    public function set endY(value:Number):void
startXproperty 
startX:Number

The x position for the particle's position when its energy is 1.


Implementation
    public function get startX():Number
    public function set startX(value:Number):void
startYproperty 
startY:Number

The y position for the particle's position when its energy is 1.


Implementation
    public function get startY():Number
    public function set startY(value:Number):void
Constructor Detail
TweenPosition()Constructor
public function TweenPosition(startX:Number = 0, startY:Number = 0, endX:Number = 0, endY:Number = 0)

The constructor creates a TweenPosition action for use by an emitter. To add a TweenPosition to all particles created by an emitter, use the emitter's addAction method.

Parameters
startX:Number (default = 0) — The x value for the particle's position when its energy is 1.
 
startY:Number (default = 0) — The y value for the particle's position when its energy is 1.
 
endX:Number (default = 0) — The x value of the particle's position when its energy is 0.
 
endY:Number (default = 0) — The y value of the particle's position when its energy is 0.

See also

Method Detail
update()method
override public function update(emitter:Emitter, particle:Particle, time:Number):void

Calculates the current position of the particle based on it's energy.

This method is called by the emitter and need not be called by the user.

Parameters

emitter:Emitter — The Emitter that created the particle.
 
particle:Particle — The particle to be updated.
 
time:Number — The duration of the frame - used for time based updates.

See also