package tests;

import javafx.application.Platform;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.control.ComboBox;
import javafx.scene.image.Image;
import javafx.scene.layout.Background;
import javafx.scene.layout.BackgroundImage;
import javafx.scene.layout.VBox;
import javafx.scene.paint.Color;

import com.jme3.app.SimpleApplication;
import com.jme3.math.ColorRGBA;
import com.jme3x.jfx.JmeFxContainer;

public class TestJavaFXAlpha extends SimpleApplication {

	private static Group root;
	private static ComboBox<String> comboBox;

	public static void main(String[] args) {
		new TestJavaFXAlpha().start();
	}

	@Override
	public void simpleInitApp() {
		this.setPauseOnLostFocus(false);
		this.flyCam.setDragToRotate(true);
		final JmeFxContainer jmefx = JmeFxContainer.install(this, getGuiNode(), true, null);
		Platform.runLater(new Runnable() {

			@Override
			public void run() {
				jmefx.setScene(createScene(), root);
			}
		});

		this.guiNode.attachChild(jmefx.getJmeNode());

		this.viewPort.setBackgroundColor(ColorRGBA.Black);
	}

	public static Scene createScene() {

		root = new Group();

		Scene scene = new Scene(root, 600, 600, true);
		scene.setFill(new Color(0, 0, 0, 0));

		VBox container = new VBox();
		container.prefWidthProperty().bind(scene.widthProperty());
		container.prefHeightProperty().bind(scene.heightProperty());
		container.setBackground(new Background(new BackgroundImage(new Image("http://i...content-available-to-author-only...r.com/7cJy8nk.png"), null, null, null, null)));

		root.getChildren().add(container);

		return scene;
	}
}
