package zero1hd.polyjet.ui.pages;

import com.badlogic.gdx.math.Vector3;
import com.badlogic.gdx.scenes.scene2d.Actor;
import com.badlogic.gdx.scenes.scene2d.actions.Actions;
import com.badlogic.gdx.scenes.scene2d.ui.Button;
import com.badlogic.gdx.scenes.scene2d.ui.Image;
import com.badlogic.gdx.scenes.scene2d.ui.Label;
import com.badlogic.gdx.scenes.scene2d.ui.Skin;
import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener;

public class MusicStatusPage extends Page {
	Label statusText;
	Image loading;
	Button back;

	public MusicStatusPage(Skin skin, final Vector3 v3) {
		super("Info", skin);
		
		back = new Button(skin, "arrow-button");
		back.setPosition(15f, (getHeight()-back.getHeight())/2 -15);
		back.addListener(new ChangeListener() {
			
			@Override
			public void changed(ChangeEvent event, Actor actor) {
				v3.x = 0.5f*getWidth();
			}
		});
		addActor(back);
		
		
		loading = new Image(skin, "loading");
		loading.setPosition((getWidth()-loading.getWidth())/2, (getHeight()-loading.getHeight())/2);
		loading.setOrigin(loading.getWidth()/2, loading.getHeight()/2);
		loading.addAction(Actions.forever(Actions.rotateBy(-360f, 2f)));
		addActor(loading);
	}
}
