Beispiel #1
0
    def __init__(self):

        ""

        self.ima_ = [
            "vavi/im_vide.png", "vavi/im_vide_activ.png", "vavi/im_novide.png",
            "vavi/im_novide_activ.png"
        ]
        self.ima = []
        self.rect_ima = []

        self.toto = pgwidth.width()

        self.toto.size = [1200, 900]
        self.toto.ima_papier = [255, 255, 255]

        self.toto.width()
        for i in self.ima_:
            self.ima.append(pygame.image.load(i).convert_alpha())
            self.ima[-1] = pygame.transform.scale(self.ima[-1], [12, 25])

        for i in range(50):
            ""
            self.rect_ima.append(pgrect.rect(self.toto.root, self.toto))
            self.rect_ima[-1].size = [12, 25]
            self.rect_ima[-1].pos = [10 + i * 14, 10]
            self.rect_ima[-1].ima_ima = self.ima[0]
            self.toto.act.append(self.rect_ima[-1])
Beispiel #2
0
 def dessi_1(self, n_rect, y):
     for i in range(1, n_rect):
         ""
         self.act.append(pgrect.rect(self.root, self.rt))
         self.act[-1].size = [20, 20]
         self.act[-1].pos = [0 + i * 33, 800 - y * 33]
         self.act[-1].ima_load = self.ima_lo
         self.act[-1].font_text = None
         self.act[-1].name = str([i, y])
         self.act[-1].re_rect()
         self.act[-1].ms_cl1 = self.close_block
         self.rt.act.append(self.act[-1])
Beispiel #3
0
    def __init__(self):

        ""

        self.ima_               = "sprite_megaman.jpg"
        self.toto               =   pgwidth.width()
        
        self.toto.  size        =   [1200,900]
        self.toto.  ima_papier  =   [255,255,255]
        
        self.toto.  width()

        self.sp_im              =   pgrect.rect(self.toto.root,self.toto.rt)
Beispiel #4
0
    def re_rect(self):
        ""
        self.act = []  #purge act en car de re_

        self.rect0_fo = pgrect.rect(self.root, self.rt)
        self.rect0_fo.on = self.on
        self.rect0_fo.ms_touch = None
        self.rect0_fo.move = None
        self.rect0_fo.pos = self.pos
        self.rect0_fo.size = [self.size[0], 20]
        self.rect0_fo.color = self.color_fo
        self.rect0_fo.w = 0
        self.rect0_fo.font_text = None
        self.rect0_fo.ima_load = None

        self.rect_fo = copy.copy(self.rect0_fo)
        self.rect_fo.pos = [self.pos[0], self.pos[1] + 21]
        self.rect_fo.size = self.size

        self.rect0 = copy.copy(self.rect0_fo)
        #î_!
        self.rect_fo.ima_load = self.ima_load

        self.rect0.ms_touch = 1
        self.rect0.move = (1, 0, 0)
        self.rect0.color = self.color

        self.rect0.w0 = self.w0
        self.rect0.w1 = self.w1

        self.rect = copy.copy(self.rect0)
        self.rect.move = None
        self.rect.pos = [self.pos[0], self.pos[1] + 21]
        self.rect.size = self.size

        self.rect_bye = copy.copy(self.rect0_fo)
        self.rect_bye.ms_touch = 1
        self.rect_bye.pos = [self.pos[0] + self.size[0] - 10, self.pos[1] + 1]
        #self.rect_bye.size              =   [self.size[0]-(self.pos[0]+60),self.pos[1]-2]
        self.rect_bye.size = [20, 20]
        self.rect_bye.color = self.color
        self.rect_bye.w0 = 0
        self.rect_bye.w1 = 1

        self.rect0.font_text = self.text
        self.rect0.font_size = self.font_size
        self.rect0.font_color = self.font_color
        self.rect0.re_font()

        self.rt.act.append(self.rect0_fo)
        self.rt.act.append(self.rect_fo)
        self.rt.act.append(self.rect0)
        self.rt.act.append(self.rect_bye)
        self.rt.act.append(self.rect)

        self.act.append(self.rect)
        self.act.append(self)
        self.act.append(self.rect0_fo)
        self.act.append(self.rect_fo)
        self.act.append(self.rect0)
        self.act.append(self.rect_bye)

        self.rect0.ms_cl3 = self.act_rect0_3
        self.rect_bye.ms_cl1 = self.bye

        if self.ima_load != None:
            self.rect_fo.re_ima()
            self.rt.act.remove(self.rect0)
            self.rt.act.remove(self.rect0_fo)

            self.act.remove(self.rect0)
            self.act.remove(self.rect0_fo)
            self.rect.ms_touch = 1
            self.rect.move = (1, 0, 0)

            a = self.rect.pos[0] + self.rect.size[0] - 20
            b = self.rect.pos[1]
            self.rect_bye.pos = [a, b]
Beispiel #5
0
    wi.re_rect()
    a.act.append(wi)

    wi1 = rect(a.root, a)
    wi1.ima_load = "tux noir.jpg"
    wi1.pos = [400, 40]
    wi1.re_rect()
    a.act.append(wi1)

    wt = rect(a.root, a)
    wt.text = "moi toi present"
    wt.pos = [0, 150]
    wt.re_rect()
    wt.rect.font_text = "et apres"
    wt.rect.font_size = 30
    wt.rect.font_color = [250, 55, 120]
    wt.rect.re_font()
    a.act.append(wt)

    wte = pgrect.rect(a.root, a)
    wte.pos = [200, 150]
    wte.size = [180, 70]
    wte.color = [255, 255, 255]
    wte.w = 0
    wte.ms_touch = 1
    wte.ima_load = "tux trans.gif"
    wte.re_ima()
    a.act.append(wte)

    a.mainloop()