package depart.commun.monde2d;

import ca.ntro.app.fx.controls.World2dMouseEventFx;
import ca.ntro.app.world2d.Object2dFx;
import javafx.scene.canvas.GraphicsContext;
import javafx.scene.image.Image;

public class Terrain2dDepart extends Object2dFx {

	
	private transient Image fond = new Image("/images/fond.jpg");
	
	public Terrain2dDepart() {
		super();
		
		setTopLeftX(0);
		setTopLeftY(0);
	}

	@Override
	public void onAddedToWorld() {
		setWidth(getWorldWidth());
		setHeight(getWorldHeight());
	}

	@Override
	protected boolean onMouseEvent(World2dMouseEventFx mouseEvent) {
		return false;
	}
	
	@Override
	public void onTimePasses(double secondsElapsed) {
		super.onTimePasses(secondsElapsed);
	}

	@Override
	public void drawOnWorld(GraphicsContext gc) {
		gc.drawImage(fond, getTopLeftX(), 
				           getTopLeftY(), 
				           getWidth(), 
				           getHeight());

	}

}
