Did I find the right examples for you? yes no

All Samples(4)  |  Call(2)  |  Derive(0)  |  Import(2)

src/q/u/questgame-HEAD/mapobj.py   questgame(Download)
from pygame.locals import *
 
from utils import wrap_text, load_image, characters, trees
from movements import *
 
        max_width = self.text_surface.get_width() - 40;
        if size[0] > max_width:
            texts = wrap_text(self.font, self.text, max_width)
        else:
            texts = [self.text]

src/q/u/questgame-HEAD/game.py   questgame(Download)
from pygame.locals import *
 
from utils import wrap_text, load_image, load_config
from questmap import Map
from mapobj import Tree, Guy, RemoteGuy
    def paint_chat(self):
        self.screen.blit(self.chat_surface, (0, self.screen.get_height() - self.chat_surface.get_height()))
        texts = wrap_text(self.font, self.text, self.screen.get_width() - 40)
        for i, t in enumerate(texts):
            font_surface = self.font.render(t, True, pygame.Color(0, 0, 0))