每个人, 任何人都可以帮助我知道有没有像在COCOS2D中那样从AndEngine创建AnimateSprite表。
感谢。
答案 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);