Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Too many open files error (fonts related). #63

Closed
ghost opened this issue Sep 29, 2016 · 2 comments
Closed

Too many open files error (fonts related). #63

ghost opened this issue Sep 29, 2016 · 2 comments

Comments

@ghost
Copy link

ghost commented Sep 29, 2016

A lot of games written with pygame uses functions like this:

    @staticmethod
    def display_single_line(line, x, y, screen):
        """Displays a single line of text on Battle screen"""
        txt = pygame.font.Font(None, 36)
        render = txt.render(line[0:13], 0, (255, 255, 255))
        screen.blit(render, (x, y))

So font file being opened every time when function is called. But this error doesn't happen in PyGame.
Maybe we should add caching or something like it?

@ghost
Copy link
Author

ghost commented Oct 3, 2016

@ghost ghost closed this as completed Oct 3, 2016
@hodgestar
Copy link
Member

Tx.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant