def __init__(self, parentState, text, pos, size=32, fixed=True): StaticImage.__init__(self, None, None, parentState, fixed) self.labelText = pygame.font.Font(os.path.join("data", "fonts", "PD-tarzeau_-_Atari_Small.ttf"), size) self.text = text self.image = self.labelText.render(text, False, pygame.Color(0, 0, 0)) self.rect = self.image.get_rect() self.rect.topleft = pos
def __init__(self, parentState, text, pos, size=32, fixed=True): StaticImage.__init__(self, None, None, parentState, fixed) self.labelText = pygame.font.Font( os.path.join("data", "fonts", "PD-tarzeau_-_Atari_Small.ttf"), size) self.text = text self.image = self.labelText.render(text, False, pygame.Color(0, 0, 0)) self.rect = self.image.get_rect() self.rect.topleft = pos
def __init__( self, image, pos, parentState=None, fixed=False ): StaticImage.__init__( self, image, pos, parentState, fixed )
def __init__( self, rect, parentState ): StaticImage.__init__( self, None, None, parentState ) self.image = pygame.Surface( ( rect.w, rect.h ) ).convert_alpha() self.image.fill( self.empty ) self.rect = rect.copy().move( -parentState.x, -parentState.y ) pygame.draw.rect( self.image, self.red, self.rect.move( -(self.rect.left), -(self.rect.top) ), 2 )
def __init__(self, image, pos, parentState=None, fixed=False): StaticImage.__init__(self, image, pos, parentState, fixed)