Skip to content

Sheep26/pygameFPS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 

Repository files navigation

pygameFPS

A python package to the show client fps in a pygame project

Install

pip install pygameFPS

Example

import pygame
import pygameFPS as fps
pygame.init()
screen = pygame.display.set_mode((1280, 720))
pygame.display.set_caption('Example')
clock = pygame.time.Clock()
maxFPS = 144
running = True

while running:
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            running = False

    fps.tick()
    # default rendering args(surface)
    fps.render(screen)
    # custom args(surface, x, y, size, color)
    fps.render(screen, 50, 50, 24, (255, 255, 255))
    
    screen.fill("black")
    
    pygame.display.flip()

    clock.tick(maxFPS)

pygame.quit()

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages