| Package | org.flintparticles.twoD.actions |
| Class | public class SpeedLimit |
| Inheritance | SpeedLimit ActionBase Object |
This action has aa priority of -5, so that it executes after all accelerations have occured.
| Property | Defined By | ||
|---|---|---|---|
| isMinimum : Boolean
Whether the speed is a minimum (true) or maximum (false) speed. | SpeedLimit | ||
| limit : Number
The speed limit
| SpeedLimit | ||
![]() | priority : int
Returns a default priority of 0 for this action. | ActionBase | |
| Method | Defined By | ||
|---|---|---|---|
SpeedLimit(speed:Number, isMinimum:Boolean = false)
The constructor creates a SpeedLimit action for use by an emitter. | SpeedLimit | ||
![]() | addedToEmitter(emitter:Emitter):void
This method does nothing. | ActionBase | |
![]() | removedFromEmitter(emitter:Emitter):void
This method does nothing. | ActionBase | |
[override]
Checks whether the particle's speed is above or below the speed limit
as appropriate and, if so, alters its speed to match the speed limit. | SpeedLimit | ||
| isMinimum | property |
isMinimum:BooleanWhether the speed is a minimum (true) or maximum (false) speed.
public function get isMinimum():Boolean public function set isMinimum(value:Boolean):void| limit | property |
limit:NumberThe speed limit
public function get limit():Number public function set limit(value:Number):void| SpeedLimit | () | Constructor |
public function SpeedLimit(speed:Number, isMinimum:Boolean = false)The constructor creates a SpeedLimit action for use by an emitter. To add a SpeedLimit to all particles created by an emitter, use the emitter's addAction method.
Parametersspeed:Number (default = NaN) — The speed limit for the action in pixels per second.
| |
isMinimum:Boolean (default = false) — If true, particles travelling slower than the speed limit
are accelerated to the speed limit, otherwise particles travelling faster
than the speed limit are decelerated to the speed limit.
|
See also
| update | () | method |
override public function update(emitter:Emitter, particle:Particle, time:Number):voidChecks whether the particle's speed is above or below the speed limit as appropriate and, if so, alters its speed to match the speed limit.
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