def __init__(self, im, pos, handler=None): self.handler = handler image = pygame.image.load(im).convert() size = (image.get_rect().width, image.get_rect().height) print size self.image = image LcarsWidget.__init__(self, None, pos, size)
def __init__(self, colour, style, pos): image = pygame.image.load("assets/tab.png").convert() if (style == LcarsTab.STYLE_RIGHT): image = pygame.transform.flip(image, False, True) size = (image.get_rect().width, image.get_rect().height) LcarsWidget.__init__(self, colour, pos, size) self.image = image self.applyColour(colour)
def __init__(self, colour, pos, message, size=1.0, background=None): self.colour = colour self.background = background self.font = Font("assets/swiss911.ttf", int(19.0 * size)) self.renderText(message) # center the text if needed if (pos[1] < 0): pos = (pos[0], 400 - self.image.get_rect().width / 2) LcarsWidget.__init__(self, colour, pos, None)
def __init__(self, colour, style, pos): image = pygame.image.load("assets/elbow.png").convert() if (style == LcarsElbow.STYLE_BOTTOM_LEFT): image = pygame.transform.flip(image, False, True) elif (style == LcarsElbow.STYLE_BOTTOM_RIGHT): image = pygame.transform.rotate(image, 180) elif (style == LcarsElbow.STYLE_TOP_RIGHT): image = pygame.transform.flip(image, True, False) self.image = image size = (image.get_rect().width, image.get_rect().height) LcarsWidget.__init__(self, colour, pos, size) self.applyColour(colour)
def __init__(self, colour, pos, text, handler=None): self.handler = handler image = pygame.image.load("assets/button.png").convert() size = (image.get_rect().width, image.get_rect().height) font = Font("assets/swiss911.ttf", 19) textImage = font.render(text, False, colours.BLACK) image.blit(textImage, (image.get_rect().width - textImage.get_rect().width - 10, image.get_rect().height - textImage.get_rect().height - 5)) self.image = image self.colour = colour LcarsWidget.__init__(self, colour, pos, size) self.applyColour(colour) self.highlighted = False self.beep = Sound("assets/audio/panel/202.wav")
def __init__(self, colour, pos): size = (160, 45) LcarsWidget.__init__(self, colour, pos, size)
def __init__(self, colour, pos): size = (100, 20) LcarsWidget.__init__(self, colour, pos, size)
def __init__(self, image, pos): self.image = pygame.image.load(image).convert() LcarsWidget.__init__(self, None, pos, None)
def __init__(self, image): self.image = pygame.image.load(image).convert() # Screen specific scaling self.image = pygame.transform.scale(self.image, (480, 320)) LcarsWidget.__init__(self, None, (0,0), None)