I'm rendering some text on a screen and I want to draw a box behind acting as background. Text is a surface if I know correctly, so you call get_rect() to get it's coordinates, width and height. So when I print(my_text_surface.get_rect()) I get this:
rect(0, 0, 382, 66)>
By this information I assume I can write:
my_suface.get_rect(1)
and get it's x coordinate. But then it's says:
get_rect only accepts keyword arguments
So I'm asking you here if get_rect() can get me a list and, if yes how can I access it?
If you need my code:
font = self.pygame.font.Font("freesansbold.ttf", 64)
spadenpala_text = font.render("Spadenpala", True, (255, 255, 255))
spadenpala_text_position = spadenpala_text.get_rect(center=(self.width/2, 200))
print(spadenpala_text.get_rect([1]))
Thanks, Mirko Dolenc