有没有办法像在COCOS 2D中那样从AndEngine创建AnimateSprite Sheet?

时间:2012-06-12 12:33:35

标签: android cocos2d-iphone andengine

每个人,        任何人都可以帮助我知道有没有像在COCOS2D中那样从AndEngine创建AnimateSprite表。

感谢。

1 个答案:

答案 0 :(得分:0)

你走了!我相信这就是你要找的东西。

    AnimatedSprite runner = new AnimatedSprite(0, 0, mRunner);
    // Animate with 100 milliseconds each frame, start at frame 0 and go through 
    // frame 3, set to true for looping otherwise false for no looping.
    runner.animate(new long[] { 100, 100, 100, 100 }, 0, 3, true);
    scene.attachChild(runner);

和inLoadResources()

    this.mRunnerTexture = new Texture(512, 128, TextureOptions.DEFAULT);
    this.mRunner = TextureRegionFactory.createTiledFromAsset(this.mRunnerTexture, this, "gfx/runner.png", 0, 0, 4, 1); // 4 columns and 1 row, a 4x1 animated sprite
    this.mEngine.getTextureManager().loadTextures(this.mRunnerTexture);