reversing animation in Gamequery
Is there a method to reverse animation seq开发者_如何学运维uence in 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.
Refer to this doc.
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});
and then you call it like this
.addSprite("simpleHorizontal",{animation: simpleHorizontalAnimation, posx: 34})
You can take a further look at https://raw.github.com/onaluf/gameQuery/master/tests/human/Animation/type/test1.html
精彩评论