Skip to content

Commit

Permalink
Revert Ticker.shared back to app.ticker
Browse files Browse the repository at this point in the history
  • Loading branch information
bbazukun123 committed Dec 22, 2023
1 parent 6204e64 commit 2b7cc43
Show file tree
Hide file tree
Showing 37 changed files with 73 additions and 74 deletions.
4 changes: 2 additions & 2 deletions src/examples/v8.0.0-rc/advanced/collisionDetection.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Application, Assets, Point, Sprite, Texture, Ticker } from 'pixi.js';
import { Application, Assets, Point, Sprite, Texture } from 'pixi.js';

// Based somewhat on this article by Spicy Yoghurt
// URL for further reading: https://spicyyoghurt.com/tutorials/html5-javascript-game-development/collision-detection-physics
Expand Down Expand Up @@ -104,7 +104,7 @@ import { Application, Assets, Point, Sprite, Texture, Ticker } from 'pixi.js';
});

// Listen for animate update
Ticker.shared.add((time) =>
app.ticker.add((time) =>
{
const delta = time.deltaTime;

Expand Down
4 changes: 2 additions & 2 deletions src/examples/v8.0.0-rc/advanced/mouseTrail.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Application, Assets, Point, Sprite, MeshRope, Ticker } from 'pixi.js';
import { Application, Assets, Point, Sprite, MeshRope } from 'pixi.js';

(async () =>
{
Expand Down Expand Up @@ -55,7 +55,7 @@ import { Application, Assets, Point, Sprite, MeshRope, Ticker } from 'pixi.js';
});

// Listen for animate update
Ticker.shared.add(() =>
app.ticker.add(() =>
{
if (!mouseposition) return;

Expand Down
4 changes: 2 additions & 2 deletions src/examples/v8.0.0-rc/advanced/screenShot.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Application, Assets, Container, Sprite, Text, TextStyle, Ticker } from 'pixi.js';
import { Application, Assets, Container, Sprite, Text, TextStyle } from 'pixi.js';

(async () =>
{
Expand Down Expand Up @@ -52,7 +52,7 @@ import { Application, Assets, Container, Sprite, Text, TextStyle, Ticker } from
bunnyContainer.pivot.y = bunnyContainer.height / 2;

// Animate the bunnies container
Ticker.shared.add((time) =>
app.ticker.add((time) =>
{
bunnyContainer.rotation += 0.01 * time.deltaTime;
});
Expand Down
5 changes: 2 additions & 3 deletions src/examples/v8.0.0-rc/advanced/slots.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {
Container,
Texture,
Sprite,
Ticker,
Graphics,
Text,
TextStyle,
Expand Down Expand Up @@ -170,7 +169,7 @@ import {
}

// Listen for animate update.
Ticker.shared.add(() =>
app.ticker.add(() =>
{
// Update the slots.
for (let i = 0; i < reels.length; i++)
Expand Down Expand Up @@ -223,7 +222,7 @@ import {
return tween;
}
// Listen for animate update.
Ticker.shared.add(() =>
app.ticker.add(() =>
{
const now = Date.now();
const remove = [];
Expand Down
4 changes: 2 additions & 2 deletions src/examples/v8.0.0-rc/advanced/spinners.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Application, Assets, Container, Sprite, Point, Graphics, Ticker } from 'pixi.js';
import { Application, Assets, Container, Sprite, Point, Graphics } from 'pixi.js';

(async () =>
{
Expand Down Expand Up @@ -370,7 +370,7 @@ import { Application, Assets, Container, Sprite, Point, Graphics, Ticker } from
];

// Listen for animate update
Ticker.shared.add((time) =>
app.ticker.add((time) =>
{
// Call tick handling for each spinner.
onTick.forEach((cb) =>
Expand Down
4 changes: 2 additions & 2 deletions src/examples/v8.0.0-rc/advanced/starWarp.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Application, Assets, Sprite, Ticker } from 'pixi.js';
import { Application, Assets, Sprite } from 'pixi.js';

(async () =>
{
Expand Down Expand Up @@ -61,7 +61,7 @@ import { Application, Assets, Sprite, Ticker } from 'pixi.js';
}, 5000);

// Listen for animate update
Ticker.shared.add((time) =>
app.ticker.add((time) =>
{
// Simple easing. This should be changed to proper easing function when used for real.
speed += (warpSpeed - speed) / 20;
Expand Down
4 changes: 2 additions & 2 deletions src/examples/v8.0.0-rc/basic/blendModes.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Application, Assets, Sprite, Ticker, Rectangle } from 'pixi.js';
import { Application, Assets, Sprite, Rectangle } from 'pixi.js';

(async () =>
{
Expand Down Expand Up @@ -69,7 +69,7 @@ import { Application, Assets, Sprite, Ticker, Rectangle } from 'pixi.js';
app.screen.height + dudeBoundsPadding * 2,
);

Ticker.shared.add(() =>
app.ticker.add(() =>
{
// Iterate through the dudes and update the positions
for (let i = 0; i < dudeArray.length; i++)
Expand Down
4 changes: 2 additions & 2 deletions src/examples/v8.0.0-rc/basic/container.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Application, Assets, Container, Sprite, Ticker } from 'pixi.js';
import { Application, Assets, Container, Sprite } from 'pixi.js';

(async () =>
{
Expand Down Expand Up @@ -38,7 +38,7 @@ import { Application, Assets, Container, Sprite, Ticker } from 'pixi.js';
container.pivot.y = container.height / 2;

// Listen for animate update
Ticker.shared.add((time) =>
app.ticker.add((time) =>
{
// Continuously rotate the container!
// * use delta to create frame-independent transform *
Expand Down
4 changes: 2 additions & 2 deletions src/examples/v8.0.0-rc/basic/meshPlane.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Application, MeshPlane, Assets, Ticker } from 'pixi.js';
import { Application, MeshPlane, Assets } from 'pixi.js';

(async () =>
{
Expand Down Expand Up @@ -28,7 +28,7 @@ import { Application, MeshPlane, Assets, Ticker } from 'pixi.js';
// Listen for animate update
let timer = 0;

Ticker.shared.add(() =>
app.ticker.add(() =>
{
// Randomize the vertice positions a bit to create movement.
for (let i = 0; i < buffer.data.length; i++)
Expand Down
4 changes: 2 additions & 2 deletions src/examples/v8.0.0-rc/basic/particleContainer.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Application, Assets, Sprite, Ticker, Container, Rectangle } from 'pixi.js';
import { Application, Assets, Sprite, Container, Rectangle } from 'pixi.js';

(async () =>
{
Expand Down Expand Up @@ -69,7 +69,7 @@ import { Application, Assets, Sprite, Ticker, Container, Rectangle } from 'pixi.

let tick = 0;

Ticker.shared.add(() =>
app.ticker.add(() =>
{
// Iterate through the sprites and update their position
for (let i = 0; i < maggots.length; i++)
Expand Down
4 changes: 2 additions & 2 deletions src/examples/v8.0.0-rc/basic/tinting.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Application, Assets, Sprite, Rectangle, Ticker } from 'pixi.js';
import { Application, Assets, Sprite, Rectangle } from 'pixi.js';

(async () =>
{
Expand Down Expand Up @@ -63,7 +63,7 @@ import { Application, Assets, Sprite, Rectangle, Ticker } from 'pixi.js';
app.screen.height + dudeBoundsPadding * 2,
);

Ticker.shared.add(() =>
app.ticker.add(() =>
{
// Iterate through the dudes and update their position
for (let i = 0; i < aliens.length; i++)
Expand Down
4 changes: 2 additions & 2 deletions src/examples/v8.0.0-rc/basic/transparentBackground.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Application, Assets, Sprite, Ticker } from 'pixi.js';
import { Application, Assets, Sprite } from 'pixi.js';

(async () =>
{
Expand Down Expand Up @@ -27,7 +27,7 @@ import { Application, Assets, Sprite, Ticker } from 'pixi.js';
app.stage.addChild(bunny);

// Listen for animate update
Ticker.shared.add(() =>
app.ticker.add(() =>
{
// Just for fun, let's rotate our bunny over time!
bunny.rotation += 0.1;
Expand Down
4 changes: 2 additions & 2 deletions src/examples/v8.0.0-rc/filtersBasic/blur.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Application, Assets, Sprite, BlurFilter, Ticker } from 'pixi.js';
import { Application, Assets, Sprite, BlurFilter } from 'pixi.js';

(async () =>
{
Expand Down Expand Up @@ -47,7 +47,7 @@ import { Application, Assets, Sprite, BlurFilter, Ticker } from 'pixi.js';
let count = 0;

// Animate the blur filters
Ticker.shared.add(() =>
app.ticker.add(() =>
{
count += 0.005;

Expand Down
2 changes: 1 addition & 1 deletion src/examples/v8.0.0-rc/filtersBasic/colorMatrix.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Application, Assets, Container, Sprite, Text, Ticker, ColorMatrixFilter } from 'pixi.js';
import { Application, Assets, Container, Sprite, Text, ColorMatrixFilter } from 'pixi.js';

(async () =>
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Application, Assets, Container, Rectangle, Sprite, Point, Ticker, DisplacementFilter } from 'pixi.js';
import { Application, Assets, Container, Rectangle, Sprite, Point, DisplacementFilter } from 'pixi.js';

(async () =>
{
Expand Down Expand Up @@ -91,7 +91,7 @@ import { Application, Assets, Container, Rectangle, Sprite, Point, Ticker, Displ
let count = 0;

// Animate the maggots
Ticker.shared.add(() =>
app.ticker.add(() =>
{
count += 0.05;

Expand Down
4 changes: 2 additions & 2 deletions src/examples/v8.0.0-rc/filtersBasic/displacementMapFlag.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Application, Assets, Container, Sprite, Ticker, WRAP_MODES, DisplacementFilter } from 'pixi.js';
import { Application, Assets, Container, Sprite, WRAP_MODES, DisplacementFilter } from 'pixi.js';

(async () =>
{
Expand Down Expand Up @@ -46,7 +46,7 @@ import { Application, Assets, Container, Sprite, Ticker, WRAP_MODES, Displacemen
// Apply the filter
flag.filters = [displacementFilter];

Ticker.shared.add(() =>
app.ticker.add(() =>
{
// Offset the sprite position to make vFilterCoord update to larger value.
// Repeat wrapping makes sure there's still pixels on the coordinates.
Expand Down
4 changes: 2 additions & 2 deletions src/examples/v8.0.0-rc/graphics/dynamic.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Application, Graphics, Ticker } from 'pixi.js';
import { Application, Graphics } from 'pixi.js';

(async () =>
{
Expand Down Expand Up @@ -79,7 +79,7 @@ import { Application, Graphics, Ticker } from 'pixi.js';
});

// Animate the moving shape
Ticker.shared.add(() =>
app.ticker.add(() =>
{
count += 0.1;

Expand Down
4 changes: 2 additions & 2 deletions src/examples/v8.0.0-rc/masks/graphics.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Application, Assets, Container, Sprite, Graphics, Text, Ticker } from 'pixi.js';
import { Application, Assets, Container, Sprite, Graphics, Text } from 'pixi.js';

(async () =>
{
Expand Down Expand Up @@ -95,7 +95,7 @@ import { Application, Assets, Container, Sprite, Graphics, Text, Ticker } from '
app.stage.addChild(help);

// Animate the mask
Ticker.shared.add(() =>
app.ticker.add(() =>
{
bg.rotation += 0.01;
bgFront.rotation -= 0.01;
Expand Down
4 changes: 2 additions & 2 deletions src/examples/v8.0.0-rc/masks/sprite.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Application, Assets, Sprite, Point, Ticker } from 'pixi.js';
import { Application, Assets, Sprite, Point } from 'pixi.js';

(async () =>
{
Expand Down Expand Up @@ -49,7 +49,7 @@ import { Application, Assets, Sprite, Point, Ticker } from 'pixi.js';
}

// Animate the mask
Ticker.shared.add(() =>
app.ticker.add(() =>
{
mask.x += (target.x - mask.x) * 0.1;
mask.y += (target.y - mask.y) * 0.1;
Expand Down
4 changes: 2 additions & 2 deletions src/examples/v8.0.0-rc/meshAndShaders/instancedGeometry.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Application, Assets, Mesh, Geometry, Buffer, TYPES, Shader, Ticker } from 'js';
import { Application, Assets, Mesh, Geometry, Buffer, TYPES, Shader } from 'js';

(async () =>
{
Expand Down Expand Up @@ -77,7 +77,7 @@ import { Application, Assets, Mesh, Geometry, Buffer, TYPES, Shader, Ticker } fr

app.stage.addChild(triangles);

Ticker.shared.add(() =>
app.ticker.add(() =>
{
triangles.rotation += 0.01;
});
Expand Down
4 changes: 2 additions & 2 deletions src/examples/v8.0.0-rc/meshAndShaders/mergingGeometry.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Application, Assets, Mesh, Geometry, Shader, Ticker } from 'js';
import { Application, Assets, Mesh, Geometry, Shader } from 'js';

(async () =>
{
Expand Down Expand Up @@ -76,7 +76,7 @@ import { Application, Assets, Mesh, Geometry, Shader, Ticker } from 'js';

app.stage.addChild(quad);

Ticker.shared.add((delta) =>
app.ticker.add((delta) =>
{
quad.rotation += 0.01;
});
Expand Down
4 changes: 2 additions & 2 deletions src/examples/v8.0.0-rc/meshAndShaders/shaderToyMesh.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Application, Assets, Mesh, Shader, WRAP_MODES, Geometry, Ticker } from 'js';
import { Application, Assets, Mesh, Shader, WRAP_MODES, Geometry } from 'js';

(async () =>
{
Expand Down Expand Up @@ -157,7 +157,7 @@ gl_FragColor = vec4(col, 1.);
// start the animation..
let time = 0;

Ticker.shared.add(() =>
app.ticker.add(() =>
{
time += 1 / 60;
quad.shader.uniforms.time = time;
Expand Down
4 changes: 2 additions & 2 deletions src/examples/v8.0.0-rc/meshAndShaders/sharedShader.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Application, Assets, Geometry, Shader, Mesh, Ticker } from 'js';
import { Application, Assets, Geometry, Shader, Mesh } from 'js';

(async () =>
{
Expand Down Expand Up @@ -109,7 +109,7 @@ import { Application, Assets, Geometry, Shader, Mesh, Ticker } from 'js';

app.stage.addChild(triangle2, triangle);

Ticker.shared.add((delta) =>
app.ticker.add((delta) =>
{
triangle.rotation += 0.01;
triangle2.rotation -= 0.005;
Expand Down
4 changes: 2 additions & 2 deletions src/examples/v8.0.0-rc/meshAndShaders/sharingGeometry.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Application, Assets, Geometry, Texture, Mesh, Shader, Ticker } from 'js';
import { Application, Assets, Geometry, Texture, Mesh, Shader } from 'js';

(async () =>
{
Expand Down Expand Up @@ -89,7 +89,7 @@ import { Application, Assets, Geometry, Texture, Mesh, Shader, Ticker } from 'js

app.stage.addChild(triangle3, triangle2, triangle);

Ticker.shared.add((delta) =>
app.ticker.add((delta) =>
{
triangle.rotation += 0.01;
triangle2.rotation -= 0.01;
Expand Down
4 changes: 2 additions & 2 deletions src/examples/v8.0.0-rc/meshAndShaders/texturedMeshAdvanced.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Application, Assets, Point, MeshRope, Graphics, Ticker } from 'pixi.js';
import { Application, Assets, Point, MeshRope, Graphics } from 'pixi.js';

(async () =>
{
Expand Down Expand Up @@ -41,7 +41,7 @@ import { Application, Assets, Point, MeshRope, Graphics, Ticker } from 'pixi.js'
app.stage.addChild(g);

// Start animating
Ticker.shared.add(() =>
app.ticker.add(() =>
{
count += 0.1;

Expand Down
4 changes: 2 additions & 2 deletions src/examples/v8.0.0-rc/meshAndShaders/texturedMeshBasic.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Application, Assets, Point, Container, MeshRope, Ticker } from 'pixi.js';
import { Application, Assets, Point, Container, MeshRope } from 'pixi.js';

(async () =>
{
Expand Down Expand Up @@ -41,7 +41,7 @@ import { Application, Assets, Point, Container, MeshRope, Ticker } from 'pixi.js
snakeContainer.addChild(strip);

// Animate the rope points
Ticker.shared.add(() =>
app.ticker.add(() =>
{
count += 0.1;

Expand Down
Loading

0 comments on commit 2b7cc43

Please sign in to comment.