function methods.CreateFadeFunctions(A,p)local l={}for p,A in pairs(p)do l[p]={}for A,G in pairs(A)do l[p][A]={Target=G.FadedIn,Current=p[A],NormalizedExptValue=1}end end local function G(A,G)for l,c in pairs(l)do for c,X in pairs(c)do X.Target=p[l][c].FadedIn X.NormalizedExptValue=G:NormalizedDefaultExptValueInSeconds(A)end end end local function c(A,G)for l,c in pairs(l)do for c,X in pairs(c)do X.Target=p[l][c].FadedOut X.NormalizedExptValue=G:NormalizedDefaultExptValueInSeconds(A)end end end local function X()for p,A in pairs(l)do for A,l in pairs(A)do p[A]=l.Current end end end local function f(p,A)for l,G in pairs(l)do for l,G in pairs(G)do G.Current=A:Expt(G.Current,G.Target,G.NormalizedExptValue,p)end end X()end return G,c,f end function methods.NewBindableEvent(A,p)local l=Instance.new("\066\105\110\100\097\098\108\101\069\118\101\110\116")l.Name=p return l end
-- CreateFadeFunctions usage:
-- fadeObjects is a map of text labels and button to start and end values for a given property.
-- e.g {
--   NameButton = {
--     TextTransparency = {
--       FadedIn = 0.5,
--       FadedOut = 1,
--     }
--   },
--  ImageOne = {
--	  ImageTransparency = {
--       FadedIn = 0,
--       FadedOut = 0.5,
--     }
--   }
-- }
function methods:CreateFadeFunctions(fadeObjects)
	local AnimParams = {}
	for object, properties in pairs(fadeObjects) do
		AnimParams[object] = {}
		for property, values in pairs(properties) do
			AnimParams[object][property] = {
				Target = values.FadedIn,
				Current = object[property],
				NormalizedExptValue = 1,
			}
		end
	end

	local function FadeInFunction(duration, CurveUtil)
		for object, properties in pairs(AnimParams) do
			for property, values in pairs(properties) do
				values.Target = fadeObjects[object][property].FadedIn
				values.NormalizedExptValue = CurveUtil:NormalizedDefaultExptValueInSeconds(duration)
			end
		end
	end

	local function FadeOutFunction(duration, CurveUtil)
		for object, properties in pairs(AnimParams) do
			for property, values in pairs(properties) do
				values.Target = fadeObjects[object][property].FadedOut
				values.NormalizedExptValue = CurveUtil:NormalizedDefaultExptValueInSeconds(duration)
			end
		end
	end

	local function AnimGuiObjects()
		for object, properties in pairs(AnimParams) do
			for property, values in pairs(properties) do
				object[property] = values.Current
			end
		end
	end

	local function UpdateAnimFunction(dtScale, CurveUtil)
		for object, properties in pairs(AnimParams) do
			for property, values in pairs(properties) do
				values.Current = CurveUtil:Expt(values.Current, values.Target, values.NormalizedExptValue, dtScale)
			end
		end

		AnimGuiObjects()
	end

	return FadeInFunction, FadeOutFunction, UpdateAnimFunction
end

function methods:NewBindableEvent(name)
	local bindable = Instance.new("BindableEvent")
	bindable.Name = name
	return bindable
end
