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(); }
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(); }
public void setDelay(long d) { animation.setDelay(d); }