Skip to content

VFX bug fixes #212

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 18 additions & 4 deletions iwsy/iwsy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
Expand Down
2 changes: 1 addition & 1 deletion iwsy/resources/ecs/vfx.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down