Skip to content

Commit cec9a87

Browse files
committed
VFX bug fixes
1 parent 701ae18 commit cec9a87

File tree

2 files changed

+19
-5
lines changed

2 files changed

+19
-5
lines changed

iwsy/iwsy.js

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -524,17 +524,31 @@ const IWSY = (playerElement, scriptObject) => {
524524
}
525525
};
526526

527-
// Run a pan-zoom
527+
// Run a pan-zoom (for testing animations)
528528
const panzoom = arg => {
529529
player.innerText = ``;
530530
const vfx = JSON.parse(arg);
531531
vfx.container = player;
532+
vfx.startsize = 100;
533+
vfx.startxoff = 0;
534+
vfx.startyoff = 0;
535+
let url;
536+
if (vfx.url[0] === `=`) {
537+
const name = vfx.url.slice(1);
538+
for (const vfx2 of script.vfx) {
539+
if (name === vfx2.name) {
540+
url = vfx2.url;
541+
break;
542+
}
543+
}
544+
} else {
545+
url = vfx.url;
546+
}
532547
const image = new Image();
533548
vfx.image = image;
534-
image.src = spec.url;
535-
// image.style.display = `none`;
549+
image.src = url;
536550
image.addEventListener(`load`, () => {
537-
initImage(spec);
551+
initImage(vfx);
538552
requestAnimationFrame(timestamp => {
539553
animatePanzoom(timestamp, vfx);
540554
});

iwsy/resources/ecs/vfx.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ Restart:
6262
create Title in Row
6363
set the style of Title to
6464
`flex:1;font-size:110%;font-weight:bold;background:lightgray;text-align:center;margin-bottom:0.5em`
65-
set the content of Title to `Content Items`
65+
set the content of Title to `VFX Items`
6666
create Cell in Row
6767
set the style of Cell to `width:1.4em;text-align:center`
6868
create Link in Cell

0 commit comments

Comments
 (0)