agenda hud help

Hello, I am working on an agenda hud and I was wondering how I would have the draw.simpletext() func start on a new line once it were to hit a certain length. I was thinking an if statement with surface.gettextsize(), I played around with it a bit but I wasn’t able to figure it out. Thanks for any help!


		-- Agenda

	local agendatxt = LocalPlayer():getDarkRPVar("agenda")
	local agx = 20
	local agy = 20

	if LocalPlayer():Team() == 8 or 2 or 7 then -- temporary teams

		DrawBlurRect(agx, agy, 350, 150, 5, 4)
		surface.SetDrawColor(0,0,0) 
		surface.DrawLine(agx-1, agy-1, agx-1, agy+150+1)
		surface.DrawLine(agx-1, agy+150, agx+350+1, agy+150)
		surface.DrawLine(agx+350, agy+150, agx+350, agy-2)
		surface.DrawLine(agx-1, agy-1, agx+350, agy-1)
		draw.RoundedBox(0, agx, agy, 350, 150, Color(0,0,0,175))
		draw.RoundedBox(0, agx, agy, 350, 25, Color(0,0,0,230))
		draw.SimpleText("Government Agenda","hparmor", agx+5, agy+3, Color(255,155,155))
		
		if agendatxt == nil then return end
		draw.SimpleText(agendatxt, "hparmor", agx+5, agy+30, Color(255,255,255),0,0)

	end


iCharMax = 100
tblAgenda = {}
agendatxt:gsub (".", function (char)
	table.insert (tblStr, char)
end)


for i = 1, #tblAgenda do
	if i % iCharMax == 0 then
		tblAgenda * = ("%s
"):format (tblAgenda *)
	end
end

agendatxt = unpack (tblAgenda)

This will create a new line after every 100 characters.
I don’t think word wrapping is available for draw.SimpleText afaik.