简体   繁体   中英

reversing animation in Gamequery

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 ?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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