go to frame with numbers loops
parent
2e47bde496
commit
fc76ad81ab
|
@ -103,6 +103,12 @@ export class FrameHandler {
|
||||||
const newDiv = document.createElement('div');
|
const newDiv = document.createElement('div');
|
||||||
this.frameViewer.appendChild(newDiv);
|
this.frameViewer.appendChild(newDiv);
|
||||||
newDiv.className = 'frame';
|
newDiv.className = 'frame';
|
||||||
|
|
||||||
|
newDiv.addEventListener('click', () => {
|
||||||
|
this.StopPlayingAnimation();
|
||||||
|
this.GoToFrame(i);
|
||||||
|
this.RefreshFrameViewer();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
10
app/page.ts
10
app/page.ts
|
@ -118,12 +118,16 @@ export class Page {
|
||||||
case 56:
|
case 56:
|
||||||
case 57: {
|
case 57: {
|
||||||
// goto frame w 1234567890
|
// goto frame w 1234567890
|
||||||
|
let targetFrame: number = event.keyCode - 49;
|
||||||
if (event.keyCode === 48) {
|
if (event.keyCode === 48) {
|
||||||
this.frameHandler.GoToFrame(9);
|
targetFrame = 9;
|
||||||
} else {
|
|
||||||
this.frameHandler.GoToFrame(event.keyCode - 49);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
targetFrame %= this.animationData.frames.length;
|
||||||
|
|
||||||
this.frameHandler.StopPlayingAnimation();
|
this.frameHandler.StopPlayingAnimation();
|
||||||
|
this.frameHandler.GoToFrame(targetFrame);
|
||||||
|
this.frameHandler.RefreshFrameViewer();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue