Skip to content

plorry/pygame-gradient-vert-bg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

This is a simple pygame class for generating a gradient background. I made it to create a simple "sunset" effect, but it can do any linear gradient from one colour to another.

Simply give it a screen, a rectangle to define its borders, the top colour, the bottom colour, and the number of steps. The gradient will be generated.

A real oversight is that it re-created the gradient with each tick of the game. It's possible it would be more efficient to create the gradient once, save that locally as a static image, and blit that image each tick. But this works.

Limited to two colours (one transition).

About

A class to generate a vertical gradient bg in pygame

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages