--MainFunction

function module:CreateCredits()
	cf:ClearPage(creditsFrame)
	local totalY = 0
	for _, updateGroup in pairs(credits) do
		local aspectRatio = 6
		for i,v in pairs(updateGroup) do
			local label
			if i == 1 then
				label = template1:Clone()
				aspectRatio = v[1]
				label.BackgroundColor3 = Color3.fromRGB(95, 95, 95)
				label.TextLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
				label.TextLabel.Text = v[2]
				label.Parent = creditsFrame
			else
				label = template2:Clone()
				label.Parent = creditsFrame
				label.UIAspectRatioConstraint.AspectRatio = aspectRatio
				label.BackgroundColor3 = cf:GetLabelBackgroundColor(i)
				label.PlrName.Text = v[1]
				label.PlayerImage.Image = cf:GetUserImage(cf:GetUserId(v[1]))
				local labelSizeX = label.PlayerImage.AbsoluteSize.Y
				label.PlayerImage.Size = UDim2.new(0,labelSizeX,1,0)
				for i = 1,3 do
					local descLabel = label:FindFirstChild("Desc"..i)
					if descLabel then
						local desc = v[2][i]
						if desc then
							descLabel.Text = desc
						else
							descLabel.Text = ""
						end
						local xOffset = labelSizeX*1.15
						local yScalePos
						local yScaleSize
						local yScaleSize2
						if aspectRatio <= 5 then
							yScalePos = 0.33+((i-1)*0.25)
							yScaleSize = 0.255
							yScaleSize2 = 0.31
						else
							yScalePos = 0.36+((i-1)*0.25)
							yScaleSize = 0.26 -- Size
							yScaleSize2 = 0.32 -- Pos
						end
						descLabel.Position = UDim2.new(0, xOffset, yScalePos, 0)
						descLabel.Size = UDim2.new(0.75, 0, yScaleSize, 0)
						label.PlrName.Position = UDim2.new(0, xOffset, label.PlrName.Position.Y.Scale, label.PlrName.Position.Y.Offset)
						label.PlrName.Size = UDim2.new(0.75, 0, yScaleSize2, 0)
					end
				end
			end
			label.Name = "Label"
			label.Visible = true
			totalY = totalY + label.AbsoluteSize.Y
		end
	end
	creditsFrame.CanvasSize = UDim2.new(0,0,0,totalY)
end



return module
