Skip to content

Rendering longer (paragraph) text in pygbag / pygame #90

Answered by larstuff
larstuff asked this question in Q&A
Discussion options

You must be logged in to vote

My suggestion is to use pygame.font.font("somefont.otf") [or ttf] in combinations with wordwrap and a list of sentences for the whole text, and to render each sentence as an image, than blitting these to the display surface, in a suitable distance from eachother, vertically. You could accoplish that by finding the height of a word containing both the "t" and the "y" characters, and use that as the sentence-distance.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by larstuff
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant