1

Is there a method to reverse animation sequence 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 ?

AurA
  • 12,135
  • 7
  • 46
  • 63
UVM
  • 9,776
  • 6
  • 41
  • 66

1 Answers1

0

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

AurA
  • 12,135
  • 7
  • 46
  • 63
  • in my case , I have sprite sheet and I can only mention the number of frames in the arguement.In this case, it will take from left to right.Here, how can I ask the framework to change it? Please show me some valid examples.Thx – UVM Jun 07 '12 at 05:24
  • Check [this example](http://groups.google.com/group/jquery-gamequery/browse_thread/thread/9855d526f084e7ee), it does some more stuffs with animation. – AurA Jun 07 '12 at 05:56
  • I have also edited my post to add some more useful content and another example... hope it helps. – AurA Jun 07 '12 at 06:02
  • Thanks @AurA.I am looking into that. – UVM Jun 07 '12 at 06:12