| Package | org.flintparticles.common.counters |
| Class | public class PerformanceAdjusted |
| Implements | Counter |
| Property | Defined by | ||
|---|---|---|---|
| complete : Boolean [read-only]
Indicates if the counter has emitted all its particles.
| PerformanceAdjusted | ||
| rateMax : Number
The maximum number of particles to emit per second.
| PerformanceAdjusted | ||
| rateMin : Number
The minimum number of particles to emit per second.
| PerformanceAdjusted | ||
| targetFrameRate : Number
The frame rate that the counter should aim for.
| PerformanceAdjusted | ||
| Method | Defined by | ||
|---|---|---|---|
|
PerformanceAdjusted(rateMin:Number = 0, rateMax:Number = 0, targetFrameRate:Number = 24)
The constructor creates a PerformanceAdjusted counter for use by an
emitter.
| PerformanceAdjusted | ||
|
resume():void
Resumes the emitter after a stop
| PerformanceAdjusted | ||
|
startEmitter(emitter:Emitter):uint
Initilizes the counter.
| PerformanceAdjusted | ||
|
stop():void
Stops the emitter from emitting particles
| PerformanceAdjusted | ||
|
updateEmitter(emitter:Emitter, time:Number):uint
Uses the time and current rate to calculate how many particles the
emitter should emit now.
| PerformanceAdjusted | ||
| complete | property |
complete:Boolean [read-only]Indicates if the counter has emitted all its particles. For this counter this will always be false.
Implementation public function get complete():Boolean
| rateMax | property |
rateMax:Number [read-write]The maximum number of particles to emit per second. the counter will start at this rate and adjust downwards if the frame rate is below the target frame rate.
Implementation public function get rateMax():Number
public function set rateMax(value:Number):void
| rateMin | property |
rateMin:Number [read-write]The minimum number of particles to emit per second. The counter will never drop the rate below this value.
Implementation public function get rateMin():Number
public function set rateMin(value:Number):void
| targetFrameRate | property |
targetFrameRate:Number [read-write]The frame rate that the counter should aim for. Always set this slightly below your actual frame rate since flash will drop frames occasionally even when performance is fine. So, for example, if your movie's frame rate is 30fps and you want to target this rate, set the target rate to 26fps.
Implementation public function get targetFrameRate():Number
public function set targetFrameRate(value:Number):void
| PerformanceAdjusted | () | constructor |
public function PerformanceAdjusted(rateMin:Number = 0, rateMax:Number = 0, targetFrameRate:Number = 24)The constructor creates a PerformanceAdjusted counter for use by an emitter. To add a PerformanceAdjusted counter to an emitter use the emitter's counter property.
ParametersrateMin:Number (default = 0) — The minimum number of particles to emit per second.
The counter will never drop the rate below this value.
|
|
rateMax:Number (default = 0) — The maximum number of particles to emit per second.
The counter will start at this rate and adjust downwards if the frame
rate is below the target.
|
|
targetFrameRate:Number (default = 24) — The frame rate that the counter should aim for.
Always set this slightly below your actual frame rate since flash will
drop frames occasionally even when performance is fine. So, for example,
if your movie's frame rate is 30fps and you want to target this rate,
set the target rate to 26fps.
|
| resume | () | method |
public function resume():voidResumes the emitter after a stop
| startEmitter | () | method |
public function startEmitter(emitter:Emitter):uintInitilizes the counter. Returns 0 to indicate that the emitter should emit no particles when it starts.
This method is called within the emitter's start method and need not be called by the user.
Parametersemitter:Emitter — The emitter.
|
uint — 0
|
See also
| stop | () | method |
public function stop():voidStops the emitter from emitting particles
| updateEmitter | () | method |
public function updateEmitter(emitter:Emitter, time:Number):uintUses the time and current rate to calculate how many particles the emitter should emit now. Also monitors the frame rate and adjusts the emission rate down if the frame rate drops below the target.
This method is called within the emitter's update loop and need not be called by the user.
Parametersemitter:Emitter — The emitter.
|
|
time:Number — The time, in seconds, since the previous call to this method.
|
uint — the number of particles the emitter should create.
|
See also