def __init__(self, size, imgloader, player, gamemanager): self.gamemanager = gamemanager self.player = player self.imgloader = imgloader Container.__init__(self, size, (200, 50)) # set window alpha self.alphavalue = 250 * 0.95 # items offset for gui buttons self.itemsoffset = [32, 20] # selected item self.selecteditem = None self.showborder = False # Selection count self.count = 1 # Tooltip to draw self.tooltip = [None, None] # Create gui self.create_gui() # hide market at load self.hide()
def __init__(self, width, height, imgloader, player, gamemanager): self.gamemanager = gamemanager self.player = player self.imgloader = imgloader Container.__init__(self, width, height, (200, 50)) # set window alpha self.alphavalue = 250 * 0.95 # items offset for gui buttons self.itemsoffset = [32, 20] # selected item self.selecteditem = None self.showborder = False # Selection count self.count = 1 # Tooltip to draw self.tooltip = [None, None] # Create gui self.create_gui() # hide market at load self.hide()
def redraw(self, surface): """redraw :param surface: :return: """ Container.draw(self, surface)
def __init__(self): self.parent = None Container.__init__(self, 800, 600, (0, 0)) self.running = True self.menupos = 0 self.maxmenupos = 1 # background imgpath = os.path.join("images", "gui", "mainmenubg.png") bgimage = pygame.image.load(imgpath).convert_alpha() bg = Image(bgimage, (0, 0)) self.addwidget(bg) # start button self.menucursor = Label("-> ", (230, 120), color=(255, 255, 0), size=20) self.addwidget(self.menucursor) # start button self.startbutton = Button("Start game / Continue", (270, 120), color=(255, 255, 200), labelsize=20) self.startbutton.connect("clicked", self.on_startgame) self.addwidget(self.startbutton) # Quit button self.quitbutton = Button("Quit", (270, 160), color=(255, 0, 0), labelsize=20) self.quitbutton.connect("clicked", self.on_quit) self.addwidget(self.quitbutton) # Show window self.show()
def __init__(self): self.parent = None Container.__init__(self, (800, 600), (0, 0)) self.running = True self.menupos = 0 self.maxmenupos = 1 # background imgpath = os.path.join("images", "gui", "mainmenubg.png") bgimage = pygame.image.load(imgpath).convert_alpha() bg = Image(bgimage, (0, 0)) self.addwidget(bg) # start button self.menucursor = Label("-> ", (230, 200), color=(255, 255, 0), size=20) self.addwidget(self.menucursor) # start button self.startbutton = Button("Start game / Continue", (270, 200), color=(255, 255, 200), labelsize=20) self.startbutton.connect("clicked", self.on_startgame) self.addwidget(self.startbutton) # Quit button self.quitbutton = Button("Quit", (270, 240), color=(255, 0, 0), labelsize=20) self.quitbutton.connect("clicked", self.on_quit) self.addwidget(self.quitbutton) # Show window self.show()
def draw(self, surface): """draw :param surface: :return: """ Container.draw(self, surface) if self.tooltip[0]: self.tooltip[0].draw(surface)
def repaint(self): """repaint :return: """ Container.repaint(self) # self.create_gui() # Mark widgets not modified for widget in self.widgets: widget.mark_modified(False)
def __init__(self, imgloader, player): Container.__init__(self, (400, 500), (200, 50)) self.inventoryoffset = (0, 10) self.inventorysize = (4, 5) self.images = imgloader self.player = player self.notifyfont = pygame.font.Font("dejavusansmono.ttf", 12) # tooltip self.tooltip = [None, None] # Last checksum self.lchecksum = "" self.create_gui()
def draw(self, surface): Container.draw(self, surface) if self.tooltip[0]: self.tooltip[0].draw(surface)
def redraw(self, surface): Container.draw(self, surface)
def draw(self, surface): """Override Winbdow draw function""" Container.draw(self, surface) if self.tooltip[0]: self.tooltip[0].draw(surface)