Engine.GameScreen = class extends Engine.Drawable
{

	constructor()
	{

		super();

		this.active = false;
		this.parentGame = null;
		this.screenController = null;
		this.currentScreenWidth = 0;
		this.currentScreenHeight = 0;
		this.onTransitionComplete = new Action();
	}

	resize(width /*int*/, height /*int*/)
	{
		this.currentScreenWidth = width;
		this.currentScreenHeight = height;
	}

	reShow()
	{
		
		this.active = true;
		this.screenController.screenClip.addChild(this);
		this.checkResize();
	}

	checkResize()
	{
		if (this.currentScreenWidth != EngineSettings.screenWidth || this.currentScreenHeight != EngineSettings.screenHeight)
		{
			this.currentScreenWidth = EngineSettings.screenWidth;
			this.currentScreenHeight = EngineSettings.screenHeight;
			this.resize(this.currentScreenWidth, this.currentScreenHeight);
		}
	}

	show()
	{
		this.active = true;
		this.screenController.screenShown(this);
		this.checkResize();
	}

	hide()
	{
		if (this.screenController.screenClip.contains(this)) this.screenController.screenClip.removeChild(this);
		this.screenController.screenHidden(this);
		this.active = false;
	}

	update(timeElapsed /*float*/) {}

	beginHide() {}

	transitionComplete()
	{
		this.onTransitionComplete.call();
	}

	hideTransitionComplete() {}

}