def __init__(self, img_path, alpha=255, colorkey=None, clip=None, pressed=False, mode=None, hovered=False): self.alpha = alpha self.img_path = img_path self.colorkey = colorkey self.mode = mode ## print("type3",img_path) size = list(self.init_get_img().get_size()) W, H = functions.get_screen_size() if self.mode == "cut": if W < size[0]: size[0] = W if H < size[1]: size[1] = H Painter.__init__(self, size=size, clip=clip, pressed=pressed, hovered=hovered) self._resized = False
def set_size(self, size): # define a way to resize (deform or cut) # refresh self.size W, H = functions.get_screen_size() if self.mode == "cut": if W < size[0]: size[0] = W if H < size[1]: size[1] = H Painter.set_size(self, size) self._resized = size
def __init__(self, size=None, color=None, pressed=False, dark=None, hovered=False, light=None, thick=1, clip=None): """Size : diameter""" size = style.CHECK_SIZE if size is None else size color = style.DEF_COLOR2 if color is None else color Painter.__init__(self, size=size, clip=clip, pressed=pressed, hovered=hovered) self.color = color self.dark = dark self.light = light self.thick = thick
def __init__(self, size=None, color=None, pressed=False, hovered=False, clip=None): color = style.DEF_COLOR if color is None else color Painter.__init__(self, size=size, clip=clip, pressed=pressed, hovered=hovered) self.color = color
def __init__(self, img_path, alpha=255, colorkey=None, clip=None, pressed=False, mode=None, hovered=False): self.alpha = alpha self.img_path = img_path self.colorkey = colorkey self.mode = mode size = list(self.init_get_img().get_size()) W, H = functions.get_screen_size() if self.mode == "cut": if W < size[0]: size[0] = W if H < size[1]: size[1] = H Painter.__init__(self, size=size, clip=clip, pressed=pressed, hovered=hovered) self._resized = False
def get_void_state(): ## from thorpy.miscgui.title import Title ## from thorpy.painting.painter import Painter ## from thorpy.miscgui.fusionner import _Fusionner title = Title("") painter = Painter(None) fusionner = _Fusionner(painter, title) return State(fusionner)
def __init__(self, topleft_path, top_path, size, alpha=255, colorkey=None, clip=None, pressed=False, mode="flip", hovered=False): self.alpha = alpha self.colorkey = colorkey self.mode = mode self.topleft_img = load_image(topleft_path) self.top_img = load_image(top_path) size = self.find_size(size) Painter.__init__(self, size=size, clip=clip, pressed=pressed, hovered=hovered)
def get_void_state(): title = Title("") painter = Painter(None) fusionner = _Fusionner(painter, title) return State(fusionner)