Note that there are some explanatory texts on larger screens.

plurals
  1. POImage shifts right after animation completes
    primarykey
    data
    text
    <p>I have an animation I'm running from a spritesheet. On the last frame of the animation, the image seems to move to the bottom-right of the sprite boundary. There's a video here:</p> <p><a href="http://vimeo.com/27347999" rel="nofollow">http://vimeo.com/27347999</a></p> <p>I can't find anything wrong with my code; the problem may be with the spritesheet property list, which I made with Zwoptex. Here's the property list:</p> <p><a href="https://gist.github.com/1128291" rel="nofollow">https://gist.github.com/1128291</a></p> <p>And the relevant source: </p> <pre><code> //initialize [[CCSpriteFrameCache sharedSpriteFrameCache] addSpriteFramesWithFile:[images objectForKey:@"elephantPlist"]]; elephantSpritesheet = [CCSpriteBatchNode batchNodeWithFile:[images objectForKey:@"elephantSpritesheet"]]; elephant = [TouchableSprite spriteWithSpriteFrameName:@"elephant_1.png"]; elephant.delegate = self; [self addChild:elephantSpritesheet]; [elephantSpritesheet addChild:elephant]; </code></pre> <p>.</p> <pre><code>- (void)animateElephant{ NSArray *frames = [self makeFrameNames:@"elephant" numFrames:15]; CCAnimation *animation = [CCAnimation animationWithFrames:frames delay:0.05f]; CCAnimate *animate = [CCAnimate actionWithAnimation:animation]; [elephant runAction:animate]; } </code></pre> <p>One more thing, changing the frame that the animation stops on does not fix the problem. That is, if I only use frames 1 through 10 instead of through 15, the 10th frame will jump downward and to the left, just like the 15th did.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload