dofile('data/Scripts/Animations/IntroStory.lua');		--// for PlayIntroStory() function

function OnCreateContent()
--	introStoryScreen = screen;
	assert(introStoryScreen);

	CreateButtons();
	introMovieDuration = PlayIntroStory(introStoryScreen);
end

function OnFreeContent()
	introStoryScreen = nil;
end

function OnUpdate(dt)
	--// set movie duration at first update
	if (introMovieDuration ~= nil) then
	    introStoryScreen:SetDuration(introMovieDuration);
		introMovieDuration = nil;
	end
end

function PauseIntroStoryMovie()
	assert(introStoryData.composition ~= nil);
	introStoryData.composition:Stop();
	introStoryData.composition:Rewind(true);
end

------------------------------------------------------------------------------
--// auxiliary functions

function CreateButtons()
	local skipButton = CreateButton('IntroContinueButtonUp','IntroContinueButtonOver','IntroContinueButtonDown', 'MSG_SKIP_INTRO', introStoryScreen);
	skipButton:AttachTo(introStoryScreen);
	skipButton:SetScale(0.7);
	skipButton:SetXY(860.0, 40.0);
	skipButton:SetZ(1000.0);
	skipButton:SetVisible(true);

--// ToDo: bind to Lua and call:	Engine->AudioManager->PlayMusic("introSound");
end
