-- events for ui screen


function OnLoad ()
	--CacheSound ("logos/sound.ogg");
end;

timer = 0;

function OnEnter ()
	PopScreen();
	--PlaySound ("logos/sound.ogg");
end;

function OnLeave ()
end;


function OnClick (name)

	Print ("OnClick " .. name .. "\n");
end;


function clamp01 (value)

	value = math.min (value, 1);
	value = math.max (value, 0);
	return value;
end;


function OnUpdate (tdelta)

	timer = timer + tdelta;
	
	t = 1.1 * timer;
	
	trans = GetActiveScreenTransPhase ();

	SetProperty ("logo:alpha", trans * clamp01 (2*(t - 0.5)));
	--SetProperty ("logo:position_offset.y", math.min (0, 2*t * 50));

	
	-- show it for a couple of secs after it's complete, then fade away
	if (t > 2) then
		PopScreen ();
	end;
end;


function OnDraw ()

end;
