1
I have a boot class that is a Sprite and has as attribute text that is also a Sprite. I was wondering how to change the position of the text when I change the position of the boot rectum?
import pygame
class Botao(pygame.sprite.Sprite):
def __init__(self, text):
self.image = pygame.image.load("images/botao.png")
self.rect = self.image.get_rect()
self.text = Text(font["alfa_slab_one_40"], text, "#ffffff")
class Text(pygame.sprite.Sprite):
def __init__(self, font, text, cor, fundo=None):
self.image = font.render(text, True, cor, fundo)
self.rect = self,image.get_rect()
botao = Botao("SIM")
botao.rect.center = self.tela_rect.center