@fibbojs / core / ThrottledPipeline
Class: abstract
ThrottledPipeline
A throttled pipeline is similar to a StandardPipeline (also based on requestAnimationFrame
), but it only calls the frame method if enough time has passed. This means the given frameRate is not guaranteed, but it will try to match it as close as possible.
Extends
Constructors
new ThrottledPipeline()
new ThrottledPipeline():
ThrottledPipeline
Returns
Overrides
Defined in
core/src/pipeline/ThrottledPipeline.ts:15
Methods
frame()
abstract
frame(delta
):void
The frame method is the main method that is called by the pipeline. It should implement the desired behavior of the pipeline.
Parameters
• delta: number
Returns
void
Inherited from
Defined in
core/src/pipeline/Pipeline.ts:40
start()
start():
void
Start the pipeline
Returns
void
Overrides
Defined in
core/src/pipeline/ThrottledPipeline.ts:20
stop()
stop():
void
Stop the pipeline
Returns
void
Overrides
Defined in
core/src/pipeline/ThrottledPipeline.ts:25
Properties
frameRate
frameRate:
number
The frame rate of the pipeline. This is the number of frames per second that the pipeline will run at. e.g. 30 will run the pipeline at 30 frames per second. The default value is 30.
Inherited from
Defined in
core/src/pipeline/Pipeline.ts:28
lastTime
lastTime:
number
The last time the frame was called. This is used to determine if enough time has passed to call the frame method again.
Defined in
core/src/pipeline/ThrottledPipeline.ts:13
state
state:
PipelineState
The current state of the pipeline.