Exemplo n.º 1
0
  public SpriteAnimation(String name, long delay) {
    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();
  }
Exemplo n.º 2
0
  public SpriteAnimation(double x, double y, String name, long delay, Camera camera) {
    this.x = x + camera.getx();
    this.y = y + camera.gety();
    ;
    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();
  }
Exemplo n.º 3
0
 public void setDelay(long d) {
   animation.setDelay(d);
 }