def deselect(self): radius = self.aoe * TILE_H x = self.location[0] - (radius - (self.width / 2)) y = self.location[1] - (radius - (self.height / 2)) blit_subsurface(util.enums.SCREEN, self.bg_back, (x, y)) self.bg_back = None
def select(self): radius = self.aoe * TILE_H x = self.location[0] - (radius - (self.width / 2)) y = self.location[1] - (radius - (self.height / 2)) self.bg_back = util.enums.SCREEN.subsurface(x, y, radius * 2, radius * 2) self.bg_back = self.bg_back.copy() blit_subsurface(util.enums.SCREEN, util.enums.SELECTION, (x, y), resize=True, size=(radius * 2, radius * 2))
elif argv[1] == "ui": hearts = [] org1 = UIElement(enums.RES + "icons/orangebox4.png", (768, 0)) org2 = UIElement(enums.RES + "icons/orangebox3.png", (0, 575)) bananas = UIElement(enums.RES + "icons/pixelbananabunch.png", ui_enums.BUNCH_LOC) gear = UIElement(enums.RES + "icons/gear.png", ui_enums.GEAR_LOC) clicked = 0 bunch_cntr = UIString(": " + str(clicked), (60, 589)) gear_cntr = UIString(": 0", (60, 639)) btn_srf = image.load(enums.RES + "icons/towerbox.png").convert_alpha() ui_util.blit_subsurface(btn_srf, image.load(enums.RES + "towers/proj_0_p.png").convert_alpha(), (5, 5), resize=True, size=(37, 39)) btn = ImageButton(btn_srf, ui_enums.TOWER_LOCS[0], make_new_proj_tower) del btn_srf org1.draw(enums.SCREEN) org2.draw(enums.SCREEN) bananas.draw(enums.SCREEN) gear.draw(enums.SCREEN) bunch_cntr.draw(enums.SCREEN) gear_cntr.draw(enums.SCREEN) btn.draw(enums.SCREEN) for locs in ui_enums.HEART_LOCS: for loc in locs: