New answers tagged


If you measured the time in ms from the start of the animation, the formula would be: var frame_nr = Math.floor(FPS * time / 1000); This way if your time was say 500 [ms] and your FPS was 60, the frame_nr would be 30. You'd need to handle the case when the frame_nr exceeds your animation's length. If you wanted the animation to loop, you could use the ...


Rather than using entire sprite sheet animation, I would recommend a 2D skeletal approach. Tools like Spine can help you here and are supported by cocos2d-x framework. The class in question is the SkeletonAnimation object. Here is a sample code on how to initialize the same source- cpp tests from cocos2d-x //initilize the object with animation atlas ... ...


Well, I don't know why you get this tearing. Perhaps the spritesheet itself is too small and unity is messing up. I suggest you try two things to solve your problem. 1. Up the resolution of the sprite and see if that solves the problem 2. If the animation is bobbing up and down you dont need a frame by frame animation. Just animate the transform component ...


Actually I don't think that's possible. Sprite Editor is just a tool to help prepare your spritesheet before you can actually "use" it in your game.

Top 50 recent answers are included