代码之家  ›  专栏  ›  技术社区  ›  Ian Gallegos

将动画从动画<TextureRegion>移动到另一个Libgdx中

  •  0
  • Ian Gallegos  · 技术社区  · 7 年前

    我需要知道如何将动画的内容移动到另一个动画中。

     animation1 = new Animation;
     animation2 = new Animation; 
     index = 0;
     tempFrames = TextureRegion.split(xxx, xxx.getWidth() / 4, xxx.getHeight() / 2);
            for (int i = 0; i < 4; i++) {
                for (int j = 0; j < 2; j++) {
                    tempAnimationFrames[index] = tempFrames[j][i];
                    index++;
                }
            }
     animation = new Animation<TextureRegion>(1f / 8f, tempAnimationFrames);
    

    如何在animation2中移动动画animation1?

    1 回复  |  直到 7 年前
        1
  •  0
  •   P.Halley    7 年前

    这比你想象的要容易。。。我也有同样的问题,您已经声明了animation2,所以您只需编写:

    animation2 = animation1;