def _resolve_params(data, obj_col): """(dict, list) -> NoneType For each object in obj_col, resolve the non-type parameters on it, and render the object if applicable.""" for obj in obj_col: if data["img"]: obj.img = load_img(data["img"]) if data["flip"]: horiz, vert = None, None args = data["flip"].strip("()").split(",") if args[0] == "false": horiz = False else: horiz = True if args[1] == "false": vert = False else: vert = True obj.img = transform.flip(obj.img, horiz, vert) if data["rotate"]: obj.img = transform.rotate(obj.img, int(data["rotate"].split("=")[-1])) if data["scale"]: obj.img = transform.scale(obj.img, tuple(int(i) for i in data["scale"].strip("()").split(","))) obj.render(screen, update_queue)
def load(self): self.img = load_img(self.img_n)