Packageorg.flintparticles.twoD.actions
Classpublic class MouseAntiGravity
InheritanceMouseAntiGravity Inheritance MouseGravity Inheritance ActionBase Inheritance Object

The MouseAntiGravity action applies a force on the particle to push it away from the mouse. The force applied is inversely proportional to the square of the distance from the particle to the mouse. MouseAntiGravity is identical to MouseGravity with a negative power.

See also

MouseGravity


Public Properties
 PropertyDefined By
 Inheritedepsilon : Number
The minimum distance for which the gravity force is calculated.
MouseGravity
  power : Number
[override] The strength of the anti-gravity force.
MouseAntiGravity
 Inheritedpriority : int
Returns a default priority of 0 for this action.
ActionBase
 Inheritedrenderer : DisplayObject
The display object whose coordinate system the mouse position is converted to.
MouseGravity
Protected Properties
 PropertyDefined By
 Inherited_priority : int = 0
ActionBase
Public Methods
 MethodDefined By
  
MouseAntiGravity(power:Number = 0, renderer:DisplayObject = null, epsilon:Number = 1)
The constructor creates a MouseAntiGravity action for use by an emitter.
MouseAntiGravity
 Inherited
addedToEmitter(emitter:Emitter):void
This method does nothing.
ActionBase
 Inherited
This method does nothing.
ActionBase
 Inherited
update(emitter:Emitter, particle:Particle, time:Number):void
[override] Calculates the gravity force on the particle and applies it for the period of time indicated.
MouseGravity
Property Detail
powerproperty
power:Number[override]

The strength of the anti-gravity force.


Implementation
    public function get power():Number
    public function set power(value:Number):void
Constructor Detail
MouseAntiGravity()Constructor
public function MouseAntiGravity(power:Number = 0, renderer:DisplayObject = null, epsilon:Number = 1)

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

Parameters
power:Number (default = 0) — The strength of the anti-gravity force - larger numbers produce a stronger force.
 
renderer:DisplayObject (default = null) — The display object whose coordinate system the mouse position is converted to. This is usually the renderer for the particle system created by the emitter.
 
epsilon:Number (default = 1) — The minimum distance for which gravity is calculated. Particles closer than this distance experience a gravity force as if they were this distance away. This stops the gravity effect blowing up as distances get small.

See also