enter image description hereHow I can get width of pygame bar? I mean the gray taskbar. I've tried to to following but it does not work properly.
import pygame
pygame.init()
disp = pygame.display.set_mode((640, 480))
disp.fill((0, 0, 0))
pygame.display.flip()
title = 'text'
pygame.display.set_caption(title)
while True:
for event in pygame.event.get():
if event.type == pygame.QUIT:
exit()
But the text is positioned to the left side. I I use pygame.display.set_caption(f"{title: > 320}") it goes out of window.
Try to figure how to get width of the bar and then position text to center.