local scrolltext={}
local fontImage
local quads={}
local SCALE=1.5
local GLYPH_H=86
local fontPositions={
[" "]={xStart=1720,width=30},
["!"]={xStart=1780,width=24},
["#"]={xStart=1804,width=55},
[","]={xStart=1859,width=26},
["."]={xStart=1885,width=24},
["/"]={xStart=1909,width=100},
[":"]={xStart=1951,width=24},
[";"]={xStart=1975,width=26},
["+"]={xStart=2001,width=43},
["-"]={xStart=2044,width=43},
["="]={xStart=2087,width=44},
["_"]={xStart=2131,width=53},
["["]={xStart=2222,width=39},
["]"]={xStart=2184,width=38},
["?"]={xStart=2261,width=39},
["0"]={xStart=1669,width=45},
["1"]={xStart=1269,width=29},
["2"]={xStart=1298,width=48},
["3"]={xStart=1346,width=49},
["4"]={xStart=1395,width=46},
["5"]={xStart=1441,width=48},
["6"]={xStart=1489,width=45},
["7"]={xStart=1534,width=43},
["8"]={xStart=1577,width=46},
["9"]={xStart=1623,width=46},
["A"]={xStart=2,width=46},
["B"]={xStart=48,width=47},
["C"]={xStart=95,width=49},
["D"]={xStart=144,width=49},
["E"]={xStart=193,width=48},
["F"]={xStart=241,width=46},
["G"]={xStart=287,width=48},
["H"]={xStart=335,width=48},
["I"]={xStart=383,width=30},
["J"]={xStart=413,width=49},
["K"]={xStart=462,width=50},
["L"]={xStart=512,width=43},
["M"]={xStart=555,width=59},
["N"]={xStart=614,width=51},
["O"]={xStart=665,width=47},
["P"]={xStart=712,width=48},
["Q"]={xStart=760,width=49},
["R"]={xStart=809,width=48},
["S"]={xStart=857,width=50},
["T"]={xStart=907,width=48},
["U"]={xStart=956,width=48},
["V"]={xStart=1004,width=51},
["W"]={xStart=1055,width=65},
["X"]={xStart=1120,width=51},
["Y"]={xStart=1171,width=48},
["Z"]={xStart=1219,width=49} }
local text="                                                                                                                                                                           WHAZZZZAAAAAA YOU BEAUTIFUL WEIRDOS!                 NOBODY EXPECTS THE DRACONIAN INQUISITION! OUR CHIEF WEAPON IS FIRE... FIRE AND CHAOS... CHAOS AND FIRE... OUR TWO WEAPONS ARE CHAOS AND FIRE... AND AN UNHOLY APPETITE FOR DESTRUCTION... OUR THREE WEAPONS ARE CHAOS, FIRE, AND AN UNHOLY APPETITE FOR DESTRUCTION... AND AN ALMOST FANATICAL LOVE FOR WRECKING THINGS...                I HOPE EVERYONE IS HAVING A GREAT GERP 2026! KEEP CALM AND MOV AX!"
local scrollSpeed=750
local textX=1920
local textY=919
local totalBaseWidth=0
local totalScaledWidth=0
function scrolltext.load()
fontImage=love.graphics.newImage("font.png")
fontImage:setFilter("nearest","nearest")
for char,pos in pairs(fontPositions)do
quads[char]=love.graphics.newQuad(pos.xStart,0,pos.width,GLYPH_H,fontImage:getDimensions())
end
totalBaseWidth=0
for i=1,#text do
local ch=text:sub(i,i)
local p=fontPositions[ch]
if p then totalBaseWidth=totalBaseWidth+p.width end
end
totalScaledWidth=totalBaseWidth*SCALE
end
function scrolltext.update(dt)
textX=textX-scrollSpeed*dt
if textX+totalScaledWidth<0 then
textX=love.graphics.getWidth()
end end
function scrolltext.draw()
love.graphics.setColor(1,1,1,1)
local x=textX
for i=1,#text do
local char=text:sub(i,i)
local quad=quads[char]
if quad then
love.graphics.draw(fontImage,quad,x,textY,0,SCALE,SCALE)
x=x+fontPositions[char].width*SCALE
end end end
return scrolltext