Opening the book…
def makeTextObjs(text, font, color):
surf = font.render(text, True, color)
return surf, surf.get_rect()
The makeTextObjs() function just provides us with a shortcut. Given the text, Font object, and a Color object, it calls render() for us and returns the Surface and Rect object for this text. This just saves us from typing out the code to create the Surface and Rect object each time we need them.
This page titled 8.20: makeTextObjs(), A Shortcut Function for Making Text was last modified on Fri, 08 Nov 2019 04:30:02 GMT and is shared under a CC BY-NC-SA 3.0 license and was authored, remixed, and/or curated by Al Sweigart via source content that was edited to the style and standards of the LibreTexts platform.
The book could not be loaded just now.