def __init__(self, width, bgcolor, msg): lines = self.gen_lines(msg, width) width = width height = 7 * len(lines) self.bgcolor = bgcolor StaticWidget.__init__(self, (width, height)) self.gen_image(lines)
def __init__(self, msg, size, align="c", bgcolor=(0,0,0)): StaticWidget.__init__(self, size) self.msg = msg self.align = align self.bgcolor = bgcolor self.changed = 0 self.show_msg()
def __init__(self, max=15): size = (max * 14, 20) StaticWidget.__init__(self, size) self.fill((0, 0, 0)) self.text_line = TextLine(" " * max, 14) self.max = max self.text = ""
def __init__(self, images, delay=5): size = images[0].get_size() StaticWidget.__init__(self, size) self.images = images self.bg = pygame.Surface(size) self.delay = delay self.nr = 0 self.timer = Timer(delay) self.active = 0 self.flip()
def __init__(self, size=(160, 22), fontsize=20, text="", blinky="|"): self.text = text self.fsize = fontsize self.text_img = TextLine(self.text, fontsize=fontsize) self.blinky = TextLine(blinky, fontsize=fontsize) self.do_blink = False StaticWidget.__init__(self, size) self.timer = utils.Timer(20) self.changed = 1 self.update()
def __init__(self, dialog): self.done = 0 size = (590, 140) pos = (utils.center(size, GLOBALS["screen_size"])[0], 30) StaticWidget.__init__(self, size) self.set_pos(pos) self.dialog = dialog self.cur_page = 0 #txt and portrait placement self.txt_length = 45 self.txt_pos = (130, 15) self.port_pos = (20, 15) #blinky <press space> textline self.blink_timer = utils.Timer(20) self.draw_textline = 0 self.textline = TextLine("PRESS X", fontsize=12) x = size[0] - self.textline.get_size()[0] - 5 y = size[1] - self.textline.get_size()[1] - 2 self.textline.set_pos((x, y)) self.bg = pygame.Surface(size) #may add some border/decoration
def __init__(self, images, interval=40): StaticWidget.__init__(self, images[0].get_size()) self.images = images self.cur = 0 self.timer = utils.Timer(interval) self.blit(self.images[self.cur], (0, 0))
def __init__(self, size, side="left"): StaticWidget.__init__(self, size) self.side = side self.bgcolor = (0,0,0)