I am trying to make a game and I am trying to render a lot of text. When the text renders, the rest of the text goes off the screen. Is there any easy way to make the text g
Created this function that could help a bit :) Just make sure that each new paragraph is a new item on the list you are calling on this function.
def multilineText(Surface, textAsList: list, font: str, size: int, colour, antialias: bool, centerTupleCoord: tuple, spaceBetweenLines: int):
xPosition = centerTupleCoord[0]
yPosition = centerTupleCoord[1]
for paragraph in textAsList:
fontObjsrt = pygame.font.SysFont(font, size)
TextSurf = fontObjsrt.render(paragraph, antialias, colour)
TextRect = TextSurf.get_rect()
TextRect.center = (xPosition, yPosition)
Surface.blit(TextSurf, TextRect)
yPosition += spaceBetweenLines