@sepveneto/dao 0.1.9 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app/Application.d.ts +2 -2
- package/dist/assets/Assets.d.ts +4 -4
- package/dist/assets/loader/Loader.d.ts +2 -2
- package/dist/dao.cjs +1 -1
- package/dist/dao.cjs.map +1 -1
- package/dist/dao.js +1941 -1686
- package/dist/dao.js.map +1 -1
- package/dist/events/FederatedEvent.d.ts +2 -2
- package/dist/events/FederatedEventMap.d.ts +2 -2
- package/dist/main.d.ts +5 -5
- package/dist/maths/Bounds.d.ts +6 -3
- package/dist/maths/Matrix.d.ts +6 -10
- package/dist/maths/Point.d.ts +1 -1
- package/dist/maths/getLocalBounds.d.ts +4 -0
- package/dist/maths/index.d.ts +2 -2
- package/dist/maths/shapes/Polygon.d.ts +5 -2
- package/dist/maths/shapes/Rectangle.d.ts +3 -1
- package/dist/maths/utils.d.ts +17 -0
- package/dist/renderer/CanvasPool.d.ts +2 -2
- package/dist/renderer/RenderPipe.d.ts +1 -1
- package/dist/renderer/index.d.ts +15 -15
- package/dist/renderer/texture/RenderTexture.d.ts +1 -1
- package/dist/renderer/texture/Texture.d.ts +1 -1
- package/dist/renderer/texture/TextureSource.d.ts +3 -3
- package/dist/scene/ViewContainer.d.ts +3 -3
- package/dist/scene/batcher/Batcher.d.ts +1 -1
- package/dist/scene/batcher/BatcherPipe.d.ts +6 -6
- package/dist/scene/container/Container.d.ts +20 -20
- package/dist/scene/container/RenderGroup.d.ts +3 -3
- package/dist/scene/container/__tests__/DummyEffect.d.ts +1 -1
- package/dist/scene/container/__tests__/DummyView.d.ts +1 -1
- package/dist/scene/container/mixins/childrenHelperMixin.d.ts +1 -1
- package/dist/scene/container/mixins/effectMixin.d.ts +3 -3
- package/dist/scene/container/mixins/measureMixin.d.ts +1 -1
- package/dist/scene/graphics/Graphics.d.ts +7 -2
- package/dist/scene/graphics/GraphicsContext.d.ts +18 -32
- package/dist/scene/graphics/GraphicsPipe.d.ts +2 -2
- package/dist/scene/graphics/__tests__/Graphics.Bounds.test.d.ts +1 -0
- package/dist/scene/graphics/__tests__/Graphics.test.d.ts +1 -0
- package/dist/scene/graphics/__tests__/bounds.test.d.ts +1 -0
- package/dist/scene/graphics/path/GraphicsPath.d.ts +2 -2
- package/dist/scene/graphics/path/ShapePath.d.ts +5 -3
- package/dist/scene/graphics/utils/FillTypes.d.ts +28 -0
- package/dist/scene/graphics/utils/convertInputToStyle.d.ts +15 -0
- package/dist/scene/graphics/utils/getMaxMiterRatio.d.ts +11 -0
- package/dist/scene/index.d.ts +1 -1
- package/dist/scene/mask/StencilMask.d.ts +2 -2
- package/dist/scene/mask/StencilMaskPipe.d.ts +1 -1
- package/dist/scene/sprite/Sprite.d.ts +2 -2
- package/dist/scene/sprite/SpritePipe.d.ts +1 -1
- package/dist/scene/text/Text.d.ts +4 -4
- package/dist/scene/text/TextPipe.d.ts +3 -3
- package/dist/scene/text/TextStyle.d.ts +3 -3
- package/dist/scene/text/TextSystem.d.ts +1 -1
- package/dist/scene/text/utils.d.ts +18 -18
- package/dist/system/CanvasContextSystem.d.ts +1 -1
- package/dist/system/EventSystem.d.ts +10 -5
- package/dist/system/ExtractSystem.d.ts +2 -2
- package/dist/system/ViewSystem.d.ts +2 -2
- package/dist/ticker/Ticker.d.ts +243 -243
- package/dist/ticker/TickerListener.d.ts +5 -5
- package/dist/utils/color.d.ts +8 -0
- package/dist/utils/index.d.ts +0 -1
- package/dist/utils/pool/Pool.d.ts +17 -0
- package/dist/utils/pool/PoolGroup.d.ts +6 -0
- package/package.json +20 -26
package/dist/ticker/Ticker.d.ts
CHANGED
|
@@ -1,284 +1,284 @@
|
|
|
1
1
|
export type TickerCallback<T> = (this: T, ticker: Ticker) => any;
|
|
2
2
|
export declare class Ticker {
|
|
3
3
|
/**
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
4
|
+
* Target frame rate in frames per millisecond.
|
|
5
|
+
* Used for converting deltaTime to a scalar time delta.
|
|
6
|
+
* @example
|
|
7
|
+
* ```ts
|
|
8
|
+
* // Default is 0.06 (60 FPS)
|
|
9
|
+
* console.log(Ticker.targetFPMS); // 0.06
|
|
10
|
+
*
|
|
11
|
+
* // Calculate target frame duration
|
|
12
|
+
* const frameDuration = 1 / Ticker.targetFPMS; // ≈ 16.67ms
|
|
13
|
+
*
|
|
14
|
+
* // Use in custom timing calculations
|
|
15
|
+
* const deltaTime = elapsedMS * Ticker.targetFPMS;
|
|
16
|
+
* ```
|
|
17
|
+
* @remarks
|
|
18
|
+
* - Default is 0.06 (equivalent to 60 FPS)
|
|
19
|
+
* - Used in deltaTime calculations
|
|
20
|
+
* - Affects all ticker instances
|
|
21
|
+
* @default 0.06
|
|
22
|
+
* @see {@link Ticker#deltaTime} For time scaling
|
|
23
|
+
* @see {@link Ticker#FPS} For actual frame rate
|
|
24
|
+
*/
|
|
25
25
|
static targetFPMS: number;
|
|
26
26
|
/**
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
27
|
+
* Whether or not this ticker should invoke the method {@link Ticker#start|start}
|
|
28
|
+
* automatically when a listener is added.
|
|
29
|
+
* @example
|
|
30
|
+
* ```ts
|
|
31
|
+
* // Default behavior (manual start)
|
|
32
|
+
* const ticker = new Ticker();
|
|
33
|
+
* ticker.autoStart = false;
|
|
34
|
+
* ticker.add(() => {
|
|
35
|
+
* // Won't run until ticker.start() is called
|
|
36
|
+
* });
|
|
37
|
+
*
|
|
38
|
+
* // Auto-start behavior
|
|
39
|
+
* const autoTicker = new Ticker();
|
|
40
|
+
* autoTicker.autoStart = true;
|
|
41
|
+
* autoTicker.add(() => {
|
|
42
|
+
* // Runs immediately when added
|
|
43
|
+
* });
|
|
44
|
+
* ```
|
|
45
|
+
* @default false
|
|
46
|
+
* @see {@link Ticker#start} For manually starting the ticker
|
|
47
|
+
* @see {@link Ticker#stop} For manually stopping the ticker
|
|
48
|
+
*/
|
|
49
49
|
autoStart: boolean;
|
|
50
50
|
/**
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
51
|
+
* Scalar representing the delta time factor.
|
|
52
|
+
* This is a dimensionless value representing the fraction of a frame at the target framerate.
|
|
53
|
+
* At 60 FPS, this value is typically around 1.0.
|
|
54
|
+
*
|
|
55
|
+
* This is NOT in milliseconds - it's a scalar multiplier for frame-independent animations.
|
|
56
|
+
* For actual milliseconds, use {@link Ticker#deltaMS}.
|
|
57
|
+
* @example
|
|
58
|
+
* ```ts
|
|
59
|
+
* // Frame-independent animation using deltaTime scalar
|
|
60
|
+
* ticker.add((ticker) => {
|
|
61
|
+
* // Rotate sprite by 0.1 radians per frame, scaled by deltaTime
|
|
62
|
+
* sprite.rotation += 0.1 * ticker.deltaTime;
|
|
63
|
+
* });
|
|
64
|
+
* ```
|
|
65
|
+
*/
|
|
66
66
|
deltaTime: number;
|
|
67
67
|
/**
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
68
|
+
* Scalar time elapsed in milliseconds from last frame to this frame.
|
|
69
|
+
* Provides precise timing for animations and updates.
|
|
70
|
+
*
|
|
71
|
+
* This value is capped by setting {@link Ticker#minFPS|minFPS}
|
|
72
|
+
* and is scaled with {@link Ticker#speed|speed}.
|
|
73
|
+
*
|
|
74
|
+
* If the platform supports DOMHighResTimeStamp,
|
|
75
|
+
* this value will have a precision of 1 µs.
|
|
76
|
+
*
|
|
77
|
+
* Defaults to target frame time
|
|
78
|
+
*
|
|
79
|
+
* > [!NOTE] The cap may be exceeded by scaling.
|
|
80
|
+
* @example
|
|
81
|
+
* ```ts
|
|
82
|
+
* // Animation timing
|
|
83
|
+
* ticker.add((ticker) => {
|
|
84
|
+
* // Use millisecond timing for precise animations
|
|
85
|
+
* const progress = (ticker.deltaMS / animationDuration);
|
|
86
|
+
* sprite.alpha = Math.min(1, progress);
|
|
87
|
+
* });
|
|
88
|
+
* ```
|
|
89
|
+
* @default 16.66
|
|
90
|
+
*/
|
|
91
91
|
deltaMS: number;
|
|
92
92
|
/**
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
93
|
+
* Time elapsed in milliseconds from the last frame to this frame.
|
|
94
|
+
* This value is not capped or scaled and provides raw timing information.
|
|
95
|
+
*
|
|
96
|
+
* Unlike {@link Ticker#deltaMS}, this value is unmodified by speed scaling or FPS capping.
|
|
97
|
+
* @example
|
|
98
|
+
* ```ts
|
|
99
|
+
* ticker.add((ticker) => {
|
|
100
|
+
* console.log(`Raw frame time: ${ticker.elapsedMS}ms`);
|
|
101
|
+
* });
|
|
102
|
+
* ```
|
|
103
|
+
*/
|
|
104
104
|
elapsedMS: number;
|
|
105
105
|
/**
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
106
|
+
* The last time update was invoked, in milliseconds since epoch.
|
|
107
|
+
* Similar to performance.now() timestamp format.
|
|
108
|
+
*
|
|
109
|
+
* Used internally for calculating time deltas between frames.
|
|
110
|
+
* @example
|
|
111
|
+
* ```ts
|
|
112
|
+
* ticker.add((ticker) => {
|
|
113
|
+
* const currentTime = performance.now();
|
|
114
|
+
* const timeSinceLastFrame = currentTime - ticker.lastTime;
|
|
115
|
+
* console.log(`Time since last frame: ${timeSinceLastFrame}ms`);
|
|
116
|
+
* });
|
|
117
|
+
* ```
|
|
118
|
+
*/
|
|
119
119
|
lastTime: number;
|
|
120
120
|
/**
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
121
|
+
* Factor of current {@link Ticker#deltaTime|deltaTime}.
|
|
122
|
+
* Used to scale time for slow motion or fast-forward effects.
|
|
123
|
+
* @example
|
|
124
|
+
* ```ts
|
|
125
|
+
* // Basic speed adjustment
|
|
126
|
+
* ticker.speed = 0.5; // Half speed (slow motion)
|
|
127
|
+
* ticker.speed = 2.0; // Double speed (fast forward)
|
|
128
|
+
*
|
|
129
|
+
* // Temporary speed changes
|
|
130
|
+
* function slowMotion() {
|
|
131
|
+
* const normalSpeed = ticker.speed;
|
|
132
|
+
* ticker.speed = 0.2;
|
|
133
|
+
* setTimeout(() => {
|
|
134
|
+
* ticker.speed = normalSpeed;
|
|
135
|
+
* }, 1000);
|
|
136
|
+
* }
|
|
137
|
+
* ```
|
|
138
|
+
*/
|
|
139
139
|
speed: number;
|
|
140
140
|
/**
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
141
|
+
* Whether or not this ticker has been started.
|
|
142
|
+
*
|
|
143
|
+
* `true` if {@link Ticker#start|start} has been called.
|
|
144
|
+
* `false` if {@link Ticker#stop|Stop} has been called.
|
|
145
|
+
*
|
|
146
|
+
* While `false`, this value may change to `true` in the
|
|
147
|
+
* event of {@link Ticker#autoStart|autoStart} being `true`
|
|
148
|
+
* and a listener is added.
|
|
149
|
+
* @example
|
|
150
|
+
* ```ts
|
|
151
|
+
* // Check ticker state
|
|
152
|
+
* const ticker = new Ticker();
|
|
153
|
+
* console.log(ticker.started); // false
|
|
154
|
+
*
|
|
155
|
+
* // Start and verify
|
|
156
|
+
* ticker.start();
|
|
157
|
+
* console.log(ticker.started); // true
|
|
158
|
+
* ```
|
|
159
|
+
*/
|
|
160
160
|
started: boolean;
|
|
161
161
|
/**
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
162
|
+
* Internal tick method bound to ticker instance.
|
|
163
|
+
* This is because in early 2015, Function.bind
|
|
164
|
+
* is still 60% slower in high performance scenarios.
|
|
165
|
+
* Also separating frame requests from update method
|
|
166
|
+
* so listeners may be called at any time and with
|
|
167
|
+
* any animation API, just invoke ticker.update(time).
|
|
168
|
+
* @param time - Time since last tick.
|
|
169
|
+
*/
|
|
170
170
|
private readonly _tick;
|
|
171
171
|
/** Internal current frame request ID */
|
|
172
172
|
private _requestId;
|
|
173
173
|
/**
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
174
|
+
* Internal value managed by minFPS property setter and getter.
|
|
175
|
+
* This is the maximum allowed milliseconds between updates.
|
|
176
|
+
*/
|
|
177
177
|
private _maxElapsedMS;
|
|
178
178
|
/**
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
179
|
+
* Internal value managed by maxFPS property setter and getter.
|
|
180
|
+
* This is the minimum allowed milliseconds between updates.
|
|
181
|
+
*/
|
|
182
182
|
private _minElapsedMS;
|
|
183
183
|
/** The last time keyframe was executed. Maintains a relatively fixed interval with the previous value. */
|
|
184
184
|
private _lastFrame;
|
|
185
185
|
private _head;
|
|
186
186
|
constructor();
|
|
187
187
|
/**
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
188
|
+
* Triggers an update.
|
|
189
|
+
*
|
|
190
|
+
* An update entails setting the
|
|
191
|
+
* current {@link Ticker#elapsedMS|elapsedMS},
|
|
192
|
+
* the current {@link Ticker#deltaTime|deltaTime},
|
|
193
|
+
* invoking all listeners with current deltaTime,
|
|
194
|
+
* and then finally setting {@link Ticker#lastTime|lastTime}
|
|
195
|
+
* with the value of currentTime that was provided.
|
|
196
|
+
*
|
|
197
|
+
* This method will be called automatically by animation
|
|
198
|
+
* frame callbacks if the ticker instance has been started
|
|
199
|
+
* and listeners are added.
|
|
200
|
+
* @example
|
|
201
|
+
* ```ts
|
|
202
|
+
* // Basic manual update
|
|
203
|
+
* const ticker = new Ticker();
|
|
204
|
+
* ticker.update(performance.now());
|
|
205
|
+
* ```
|
|
206
|
+
* @param currentTime - The current time of execution (defaults to performance.now())
|
|
207
|
+
* @see {@link Ticker#deltaTime} For frame delta value
|
|
208
|
+
* @see {@link Ticker#elapsedMS} For raw elapsed time
|
|
209
|
+
*/
|
|
210
210
|
update(currentTime?: number): void;
|
|
211
211
|
/**
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
212
|
+
* The frames per second at which this ticker is running.
|
|
213
|
+
* The default is approximately 60 in most modern browsers.
|
|
214
|
+
* > [!NOTE] This does not factor in the value of
|
|
215
|
+
* > {@link Ticker#speed|speed}, which is specific
|
|
216
|
+
* > to scaling {@link Ticker#deltaTime|deltaTime}.
|
|
217
|
+
* @example
|
|
218
|
+
* ```ts
|
|
219
|
+
* // Basic FPS monitoring
|
|
220
|
+
* ticker.add(() => {
|
|
221
|
+
* console.log(`Current FPS: ${Math.round(ticker.FPS)}`);
|
|
222
|
+
* });
|
|
223
|
+
* ```
|
|
224
|
+
* @readonly
|
|
225
|
+
*/
|
|
226
226
|
get FPS(): number;
|
|
227
227
|
/**
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
228
|
+
* Manages the minimum amount of milliseconds required to
|
|
229
|
+
* elapse between invoking {@link Ticker#update|update}.
|
|
230
|
+
*
|
|
231
|
+
* This will effect the measured value of {@link Ticker#FPS|FPS}.
|
|
232
|
+
*
|
|
233
|
+
* If it is set to `0`, then there is no limit; PixiJS will render as many frames as it can.
|
|
234
|
+
* Otherwise it will be at least `minFPS`.
|
|
235
|
+
*
|
|
236
|
+
* If `maxFPS` is set below the current `minFPS`, `minFPS` is automatically lowered to match.
|
|
237
|
+
* This keeps the two limits consistent.
|
|
238
|
+
* @example
|
|
239
|
+
* ```ts
|
|
240
|
+
* // Cap the frame rate
|
|
241
|
+
* const ticker = new Ticker();
|
|
242
|
+
* ticker.maxFPS = 60; // Never go above 60 FPS
|
|
243
|
+
*
|
|
244
|
+
* // Use with minFPS for frame rate clamping
|
|
245
|
+
* ticker.minFPS = 30;
|
|
246
|
+
* ticker.maxFPS = 60;
|
|
247
|
+
*
|
|
248
|
+
* // maxFPS below minFPS pushes minFPS down
|
|
249
|
+
* ticker.maxFPS = 20; // minFPS is now also 20
|
|
250
|
+
* ```
|
|
251
|
+
* @default
|
|
252
|
+
*/
|
|
253
253
|
get maxFPS(): number;
|
|
254
254
|
set maxFPS(value: number);
|
|
255
255
|
/**
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
256
|
+
* Manages the maximum amount of milliseconds allowed to
|
|
257
|
+
* elapse between invoking {@link Ticker#update|update}.
|
|
258
|
+
*
|
|
259
|
+
* This value is used to cap {@link Ticker#deltaTime|deltaTime},
|
|
260
|
+
* but does not effect the measured value of {@link Ticker#FPS|FPS}.
|
|
261
|
+
*
|
|
262
|
+
* When setting this property it is clamped to a value between
|
|
263
|
+
* `0` and `Ticker.targetFPMS * 1000` (typically 60).
|
|
264
|
+
*
|
|
265
|
+
* If `maxFPS` is currently set (non-zero) and `minFPS` is set above it,
|
|
266
|
+
* `maxFPS` is automatically raised to match. This keeps the two limits consistent.
|
|
267
|
+
* @example
|
|
268
|
+
* ```ts
|
|
269
|
+
* // Set minimum acceptable frame rate
|
|
270
|
+
* const ticker = new Ticker();
|
|
271
|
+
* ticker.minFPS = 30; // Never go below 30 FPS
|
|
272
|
+
*
|
|
273
|
+
* // Use with maxFPS for frame rate clamping
|
|
274
|
+
* ticker.minFPS = 30;
|
|
275
|
+
* ticker.maxFPS = 60;
|
|
276
|
+
*
|
|
277
|
+
* // minFPS above maxFPS pushes maxFPS up
|
|
278
|
+
* ticker.minFPS = 50; // maxFPS is raised to 50
|
|
279
|
+
* ```
|
|
280
|
+
* @default
|
|
281
|
+
*/
|
|
282
282
|
get minFPS(): number;
|
|
283
283
|
set minFPS(value: number);
|
|
284
284
|
add<T = any>(fn: TickerCallback<T>, context?: T, priority?: number): this;
|
|
@@ -11,11 +11,11 @@ export declare class TickerListener<T = any> {
|
|
|
11
11
|
match(fn: TickerCallback<T>, context?: any): boolean;
|
|
12
12
|
emit(ticker: Ticker): TickerListener<any>;
|
|
13
13
|
/**
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
* Destroy and don't use after this.
|
|
15
|
+
* @param hard - `true` to remove the `next` reference, this
|
|
16
|
+
* is considered a hard destroy. Soft destroy maintains the next reference.
|
|
17
|
+
* @returns The listener to redirect while emitting or removing.
|
|
18
|
+
*/
|
|
19
19
|
destroy(hard?: boolean): TickerListener<any>;
|
|
20
20
|
connect(previous: TickerListener): void;
|
|
21
21
|
}
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -7,6 +7,5 @@ export declare function loadImage(url: string): Promise<{
|
|
|
7
7
|
w: number;
|
|
8
8
|
h: number;
|
|
9
9
|
}>;
|
|
10
|
-
export declare function createDebug(ns: string): (...args: any[]) => void;
|
|
11
10
|
export declare function updateBounds(bounds: Bounds, anchor: ObservablePoint, texture: Texture): void;
|
|
12
11
|
export declare function applyMixins(base: any, ...mixins: Parameters<typeof Object.getOwnPropertyDescriptors>[0][]): void;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface PoolItem {
|
|
2
|
+
init?: (data: any) => void;
|
|
3
|
+
reset?: () => void;
|
|
4
|
+
destroy?: () => void;
|
|
5
|
+
[key: string]: any;
|
|
6
|
+
}
|
|
7
|
+
export type PoolItemConstructor<K extends PoolItem> = new () => K;
|
|
8
|
+
export declare class Pool<T extends PoolItem, I = NonNullable<T['init']>> {
|
|
9
|
+
readonly _classType: PoolItemConstructor<T>;
|
|
10
|
+
private readonly _pool;
|
|
11
|
+
private _index;
|
|
12
|
+
private _count;
|
|
13
|
+
constructor(ClassType: PoolItemConstructor<T>);
|
|
14
|
+
get(data?: I): T;
|
|
15
|
+
return(item: T): void;
|
|
16
|
+
clear(): void;
|
|
17
|
+
}
|