Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ------------------------------------------------
- -- printText v1.00 by Zeb/SLP (21-Jun-2022) --
- -- --
- -- Purpose: Centre text on the screen --
- -- --
- -- pen: color (default=12) --
- -- align: 0=left, 1=centre (default), 2=right --
- ------------------------------------------------
- function printText(txt,yPos,pen,align)
- if (align==nil) then align=1 end
- if (pen==nil) then pen=12 end
- local len=string.len(txt)-1
- local xPos=0
- if (align==1) then
- xPos=120-((len*6)/2)
- elseif (align==2) then
- xPos=240-(len*6)
- end
- print(txt,xPos,yPos,pen)
- end --printText
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement