oh, I think I fixed the movie pausing bug!
This commit is contained in:
parent
08bdf560a4
commit
e8bfc24506
1 changed files with 6 additions and 4 deletions
|
@ -40,11 +40,11 @@ function OutfitCanvas({ children, width, height }) {
|
||||||
// Add the child, then slot it into the right place in the order.
|
// Add the child, then slot it into the right place in the order.
|
||||||
stage.addChild(child);
|
stage.addChild(child);
|
||||||
stage.sortChildren((a, b) => a.DTI_zIndex - b.DTI_zIndex);
|
stage.sortChildren((a, b) => a.DTI_zIndex - b.DTI_zIndex);
|
||||||
// Then update in bulk!
|
|
||||||
stage.update();
|
|
||||||
if (afterFirstDraw) {
|
if (afterFirstDraw) {
|
||||||
stage.on("drawend", afterFirstDraw, null, true);
|
stage.on("drawend", afterFirstDraw, null, true);
|
||||||
}
|
}
|
||||||
|
// NOTE: We don't bother firing an update, because we trust the ticker
|
||||||
|
// to do it on the next frame.
|
||||||
},
|
},
|
||||||
[stage]
|
[stage]
|
||||||
);
|
);
|
||||||
|
@ -52,7 +52,9 @@ function OutfitCanvas({ children, width, height }) {
|
||||||
const removeChild = React.useCallback(
|
const removeChild = React.useCallback(
|
||||||
(child) => {
|
(child) => {
|
||||||
stage.removeChild(child);
|
stage.removeChild(child);
|
||||||
stage.update();
|
// NOTE: We don't bother firing an update, because we trust the ticker
|
||||||
|
// to do it on the next frame. (And, I don't understand why, but
|
||||||
|
// updating here actually paused remaining movies! So, don't!)
|
||||||
},
|
},
|
||||||
[stage]
|
[stage]
|
||||||
);
|
);
|
||||||
|
@ -239,7 +241,7 @@ export function OutfitCanvasMovie({ librarySrc, zIndex }) {
|
||||||
library.properties.height
|
library.properties.height
|
||||||
);
|
);
|
||||||
movieClip.on("tick", () => {
|
movieClip.on("tick", () => {
|
||||||
console.log("clip tick", movieClip.framerate);
|
console.log("clip tick", movieClip.framerate, movieClip.currentFrame);
|
||||||
movieClip.updateCache();
|
movieClip.updateCache();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue