| Package | org.flintparticles.twoD.actions |
| Class | public class MouseGravity |
| Inheritance | MouseGravity ActionBase Object |
| Subclasses | MouseAntiGravity |
| Property | Defined By | ||
|---|---|---|---|
| epsilon : Number
The minimum distance for which the gravity force is calculated. | MouseGravity | ||
| power : Number
The strength of the gravity force. | MouseGravity | ||
![]() | priority : int
Returns a default priority of 0 for this action. | ActionBase | |
| renderer : DisplayObject
The display object whose coordinate system the mouse position is
converted to. | MouseGravity | ||
| Method | Defined By | ||
|---|---|---|---|
MouseGravity(power:Number = 0, renderer:DisplayObject = null, epsilon:Number = 100)
The constructor creates a MouseGravity action for use by an emitter. | MouseGravity | ||
![]() | addedToEmitter(emitter:Emitter):void
This method does nothing. | ActionBase | |
![]() | removedFromEmitter(emitter:Emitter):void
This method does nothing. | ActionBase | |
[override]
Calculates the gravity force on the particle and applies it for the
period of time indicated. | MouseGravity | ||
| epsilon | property |
epsilon:NumberThe minimum distance for which the gravity force is calculated. Particles closer than this distance experience the gravity as it they were this distance away. This stops the gravity effect blowing up as distances get small.
public function get epsilon():Number public function set epsilon(value:Number):void| power | property |
power:NumberThe strength of the gravity force.
public function get power():Number public function set power(value:Number):void| renderer | property |
renderer:DisplayObjectThe display object whose coordinate system the mouse position is converted to. This is usually the renderer for the particle system created by the emitter.
public function get renderer():DisplayObject public function set renderer(value:DisplayObject):void| MouseGravity | () | Constructor |
public function MouseGravity(power:Number = 0, renderer:DisplayObject = null, epsilon:Number = 100)The constructor creates a MouseGravity action for use by an emitter. To add a MouseGravity to all particles created by an emitter, use the emitter's addAction method.
Parameterspower:Number (default = 0) — The strength of the 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 = 100) — 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. For realistic gravity effects you will want a
small epsilon ( ~1 ), but for stable visual effects a larger epsilon
(~100) is often better.
|
See also
| update | () | method |
override public function update(emitter:Emitter, particle:Particle, time:Number):voidCalculates the gravity force on the particle and applies it for the period of time indicated.
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