コード例 #1
0
 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
コード例 #2
0
 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
コード例 #3
0
 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
コード例 #4
0
 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
コード例 #5
0
 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
コード例 #6
0
 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
コード例 #7
0
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)
コード例 #8
0
 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
コード例 #9
0
 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)
コード例 #10
0
def get_void_state():
    title = Title("")
    painter = Painter(None)
    fusionner = _Fusionner(painter, title)
    return State(fusionner)
コード例 #11
0
 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