Exemplo n.º 1
0
  public SpriteAnimation(String name) {
    this.name = name;

    animation = new Animation();
    animation.setFrames(ImagesLoader.getFrames(name));

    width = ImagesLoader.getImageAt(name, animation.getFrame()).getWidth();
    height = ImagesLoader.getImageAt(name, animation.getFrame()).getHeight();
  }
Exemplo n.º 2
0
  public SpriteAnimation(double x, double y, String name, long delay) {
    this.x = x;
    this.y = y;
    this.name = name;

    animation = new Animation();
    animation.setFrames(ImagesLoader.getFrames(name));
    animation.setDelay(delay);

    width = ImagesLoader.getImageAt(name, animation.getFrame()).getWidth();
    height = ImagesLoader.getImageAt(name, animation.getFrame()).getHeight();
  }