-
Hey, I have been scouring the issues and discussion but did not find what I was looking for: |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @floAr I think the quickest way in the current version of Excalibur would be to create a new animation for the "closed" with the frames reversed. This is probably a good new feature to add to create a reversed animation, I'll make an issue for that shortly. Give this a try // Pseudo code
const forwards = ex.Animation({...}); // animation that ends
const backwards = forwards.clone();
backwards.frames.reverse(); // reverses in place, okay because clone() creates a new frames list so the 'forwards' animation should be fine
const actor = new ex.Actor({...});
actor.graphics.use(forwards);
forwards.events.on('end', () => {
actor.graphics.use(backwards);
}); |
Beta Was this translation helpful? Give feedback.
Hi @floAr
I think the quickest way in the current version of Excalibur would be to create a new animation for the "closed" with the frames reversed. This is probably a good new feature to add to create a reversed animation, I'll make an issue for that shortly.
Give this a try