简体   繁体   English

在Gamequery中反转动画

[英]reversing animation in Gamequery

Is there a method to reverse animation sequence in GameQuery. 是否有一种方法可以反转GameQuery中的动画序列。 Currently, if we specify the number of frames in, it will assume that from left to right. 当前,如果我们指定帧数,则将假设从左到右。 Can we start animation from right to left? 我们可以从右到左开始动画吗? How to choose one out of the multiaminations ? 如何从多元胺中选择一种?

There is setAnimation method on which you pass the animation, just pass a reverse animation thing itself. 有setAnimation方法,您可以通过该方法传递动画,只需传递反向动画本身即可。

Refer to this doc. 请参阅此文档。

http://gamequeryjs.com/documentation/api/#setAnimation http://gamequeryjs.com/documentation/api/#setAnimation

Setting offset animation var simpleHorizontalAnimation = new $.gameQuery.Animation({imageURL: "sh.png", type: $.gameQuery.ANIMATION_HORIZONTAL, numberOfFrame: 4, delta: 32, rate: 300}); 设置偏移动画var simpleHorizo​​ntalAnimation = new $ .gameQuery.Animation({imageURL:“ sh.png”,键入:$ .gameQuery.ANIMATION_HORIZONTAL,numberOfFrame:4,增量:32,速率:300});

and then you call it like this 然后你这样称呼它

.addSprite("simpleHorizontal",{animation: simpleHorizontalAnimation, posx: 34}) .addSprite(“ simpleHorizo​​ntal”,{动画:simpleHorizo​​ntalAnimation,posx:34})

You can take a further look at https://raw.github.com/onaluf/gameQuery/master/tests/human/Animation/type/test1.html 您可以进一步浏览https://raw.github.com/onaluf/gameQuery/master/tests/human/Animation/type/test1.html

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

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