Skip to content

Commit

Permalink
fix v8 compatibility (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
reececomo authored Dec 21, 2024
1 parent 31a162b commit 0d80f99
Show file tree
Hide file tree
Showing 10 changed files with 239 additions and 888 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ ticker.maxUpdatesPerRender = 4;

// set the default logic for opt-in/opt-out containers
ticker.getDefaultInterpolation = ( container ): boolean => {
return container instanceof MyClass;
return !(container instanceof ParticleContainer);
}
```

Expand All @@ -84,7 +84,7 @@ Containers are extended with a few optional properties to make it easy to config

| Property | Description |
| :----- | :------ |
| `interpolation` | Whether interpolation is explicitly enabled or disabled for this container. The default behavior for most containers is `true`, excluding `AnimatedSprite`, `Graphics`, `Mesh`, and `ParticleContainer`. |
| `interpolation` | Whether interpolation is explicitly enabled or disabled for this container. The default behavior for all containers is `true`. |
| `interpolatedChildren` | An array of child containers to include in interpolation. When not set, `children` is used. |
| `interpolationWraparound` | If set, position will smoothly wraparound the given ranges. |

Expand Down
354 changes: 1 addition & 353 deletions dist/index.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.cjs.map

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions dist/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ declare module 'pixi.js' {
* Set `getDefaultInterpolation( container )` on `InterpolatedTicker` to
* modify the default behavior.
*
* The default is true for all containers, excluding `PIXI.AnimatedSprite`,
* `PIXI.Graphics`, `PIXI.Mesh`, and `PIXI.ParticleContainer`.
* The default is true for all containers.
*/
interpolation?: boolean;

Expand Down
354 changes: 1 addition & 353 deletions dist/index.mjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.mjs.map

Large diffs are not rendered by default.

386 changes: 226 additions & 160 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pixijs-interpolated-ticker",
"version": "0.1.2",
"version": "1.0.0",
"author": "Reece Como <[email protected]>",
"authors": [
"Reece Como <[email protected]>"
Expand Down
17 changes: 4 additions & 13 deletions src/InterpolatedTicker.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
import {
Application,
Container,
AnimatedSprite,
Graphics,
ParticleContainer,
Mesh
} from "pixi.js";
import { Application, Container } from "pixi.js";


const _BUFFER_PROPERTIES =
Expand Down Expand Up @@ -270,10 +263,7 @@ export class InterpolatedTicker
*/
public getDefaultInterpolation( container: InterpolatedContainer ): boolean
{
return !(container instanceof AnimatedSprite
|| container instanceof Graphics
|| container instanceof ParticleContainer
|| container instanceof Mesh);
return true;
}

// ----- protected methods: -----
Expand Down Expand Up @@ -339,7 +329,8 @@ export class InterpolatedTicker
{
if ( ! this.getDefaultInterpolation(container) )
{
container.interpolation = false;
container.interpolation = false; // skip check next time

return;
}

Expand Down
3 changes: 1 addition & 2 deletions src/globals.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ declare module 'pixi.js' {
* Set `getDefaultInterpolation( container )` on `InterpolatedTicker` to
* modify the default behavior.
*
* The default is true for all containers, excluding `PIXI.AnimatedSprite`,
* `PIXI.Graphics`, `PIXI.Mesh`, and `PIXI.ParticleContainer`.
* The default is true for all containers.
*/
interpolation?: boolean;

Expand Down

0 comments on commit 0d80f99

Please sign in to comment.