All Downloads are FREE. Search and download functionalities are using the official Maven repository.

examples.fx.application.StretchApplication Maven / Gradle / Ivy

There is a newer version: 6.0.0
Show newest version
package examples.fx.application;

import br.com.etyllica.commons.animation.AnimationModule;
import br.com.etyllica.commons.animation.script.complex.StretchAndBackVertical;
import br.com.etyllica.commons.context.Application;
import br.com.etyllica.core.graphics.Graphics;
import br.com.etyllica.layer.ImageLayer;

import java.awt.*;

public class StretchApplication extends Application {

	private StretchAndBackVertical animation;

	private int surfaceY = 327;
	private ImageLayer layer;

	public StretchApplication(int w, int h) {
		super(w,h);
	}

	@Override
	public void load() {
		layer = new ImageLayer(300,surfaceY-27,"blue_ninja.png");

		animation = new StretchAndBackVertical(layer, 1200);
		animation.setInterval(1, 1.15);

		AnimationModule.getInstance().add(animation);
	}

	@Override
	public void draw(Graphics g) {
		layer.draw(g);

		g.setColor(Color.BLACK);
		g.drawLine(300, surfaceY, 300+layer.getW(), surfaceY);
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy