PyGame: Scroll Text - Technique and Code Walk Through

Опубликовано: 02 Октябрь 2024
на канале: Professor Gerry Jenkins
3,132
34

I show you the technique to scroll text on a surface in PyGame and then walk though how the code works. This uses the Surface blit method to move the code up to make room for the new line. But it is all in the details.

Code is located at : https://github.com/gerryjenkinslb/pyg...

0:00 Demo
0:05 Technique used
1:25 When and how to scroll
2:14 Actual Code
2:44 main method
4:14 TextScroll constructor
6:05 TextScroll _update_line method
7:17 TextScroll update method
8:19 TextScroll draw method
8:19 run Example1 again
8:56: run Example2 and remove debug rectangle