Beispiel #1
0
    def option_boxes_up(self,window):

        begin = end = window.get_time()
        speed = 0.03

        if len(self.option_box):
            #trigger the animation of the option boxes
            while self.option_box[0].y > window.height - self.option_box[0].height:
                end = window.get_time()
                if end > begin + speed:
                    for i in self.option_box:
                        if i.y > window.height-i.height:
                            i.y -= 80
                    begin += speed

                    window.render(menu=self,optionboxes=self.option_box)

            #change the icon of the option bow where mouse is on.
            mouse_x, mouse_y = window.get_mouse_pos()
            for item in self.option_box:
                if item.x < mouse_x < item.x + item.width\
                    and item.y < mouse_y < item.y + item.height:
                    item.onclick_listener(True)
                else:
                    item.onclick_listener(False)

            window.render(menu=self,optionboxes=self.option_box)
Beispiel #2
0
    def option_boxes_down(self,window):

        begin = end = window.get_time()
        speed = 0.03

        if len(self.option_box):
            while self.option_box[0].y < window.height:
                end = window.get_time()
                if end > begin + speed:
                    for i in self.option_box:
                        if i.y < window.height:
                            i.y += 80
                    begin += speed

                    window.render(menu=self,optionboxes=self.option_box)