简体   繁体   English

画布引擎反向精灵表

[英]Canvas engine reverse sprite sheet

I am using sprites for my game in Canvas-Engine and is there possible way to play animation backwards. 我在Canvas-Engine中为游戏使用了精灵,是否有可能向后播放动画。 If I put frames from 10 to 0 it does not work. 如果我将帧数从10设置为0,则无法使用。

animations:{ frames: [10, 0] }

Or is there way to mirror the image at each loop? 还是有办法在每个循环中镜像图像? But in some sprites its not a option. 但是在某些精灵中,这不是一个选择。 Thanks. 谢谢。

I've no idea what you want (you have to be much more specific in your question!) 我不知道你想要什么(你要多少你的问题更具体的!)

But I did this: 但是我这样做:
http://jsfiddle.net/neuroflux/qs37w/2/ http://jsfiddle.net/neuroflux/qs37w/2/

It basically, animates from frame 0 to frame 10 then runs a switch to reverse it. 基本上,它是从第0帧动画到第10帧,然后运行一个开关将其反转。

This runs as fast as the requestAnimFrame runs. 它的运行速度与requestAnimFrame一样快。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM