def parse_image(image_data, pos, size, angle): if pos is None: log("Invalid arg pos not defined for Image", 1) return None path = get_element(image_data, "path") if path is not None: path = CONST.path_prefix + path parallax_factor = get_element(image_data, "parallax_factor") if parallax_factor is None: parallax_factor = 1.0 image = Image(pos, size=size, angle=angle, path=path, parallax_factor=parallax_factor) tmp = get_element(image_data, "tmp") if tmp is not None: image.tmp = tmp else: image.tmp = False anim_data = get_element(image_data, "anim") if anim_data: image.anim = Animation.parse_animation(anim_data, image) image.init_image(size) return image
def parse_image(image_data, pos, size, angle): if pos is None: log("Invalid arg pos not defined for Image",1) return None path = get_element(image_data, "path") if path is not None: path = CONST.path_prefix+path image = Image(pos, size=size, angle=angle) anim_data = get_element(image_data, "anim") if anim_data: image.anim = Animation.parse_animation(anim_data, image) image.init_image(size) return image
def parse_animation(anim_data): Animation.parse_animation(anim_data)