diff --git a/iwsy/iwsy.js b/iwsy/iwsy.js index 8660923..f808856 100644 --- a/iwsy/iwsy.js +++ b/iwsy/iwsy.js @@ -524,17 +524,31 @@ const IWSY = (playerElement, scriptObject) => { } }; - // Run a pan-zoom + // Run a pan-zoom (for testing animations) const panzoom = arg => { player.innerText = ``; const vfx = JSON.parse(arg); vfx.container = player; + vfx.startsize = 100; + vfx.startxoff = 0; + vfx.startyoff = 0; + let url; + if (vfx.url[0] === `=`) { + const name = vfx.url.slice(1); + for (const vfx2 of script.vfx) { + if (name === vfx2.name) { + url = vfx2.url; + break; + } + } + } else { + url = vfx.url; + } const image = new Image(); vfx.image = image; - image.src = spec.url; - // image.style.display = `none`; + image.src = url; image.addEventListener(`load`, () => { - initImage(spec); + initImage(vfx); requestAnimationFrame(timestamp => { animatePanzoom(timestamp, vfx); }); diff --git a/iwsy/resources/ecs/vfx.txt b/iwsy/resources/ecs/vfx.txt index 0df5f30..0fa2c0d 100644 --- a/iwsy/resources/ecs/vfx.txt +++ b/iwsy/resources/ecs/vfx.txt @@ -62,7 +62,7 @@ Restart: create Title in Row set the style of Title to `flex:1;font-size:110%;font-weight:bold;background:lightgray;text-align:center;margin-bottom:0.5em` - set the content of Title to `Content Items` + set the content of Title to `VFX Items` create Cell in Row set the style of Cell to `width:1.4em;text-align:center` create Link in Cell