コード例 #1
0
 def __init__(self):
     self.loop = 0
     ui.set_bg_img(self.create_bg_img())
     setattr(self, "draw_anim", self.draw_anim_)
     system.event(0, self.draw_anim)
コード例 #2
0
ファイル: ui_progress_bar.py プロジェクト: vamoosebbf/MaixUI
        self.__bar_color = color
        self.draw()

    def set_bar_border(self, color, thickness):
        self.__bar_border_color = color
        self.__bar_border_thickness = thickness
        self.draw()

    def get_value(self):
        return self.__current


if __name__ == '__main__':
    import time
    ui.set_bg_color((75, 0, 75))
    ui.set_bg_img("res/images/bg.jpg")

    # # create button
    bar1 = ProgressBar(40, 280, 400, 30, 0)
    bar1.set_bg_color((255, 255, 255))
    bar2 = ProgressBar(40, 240, 400, 30, 1)
    bar2.set_bg_color((255, 255, 255))
    bar3 = ProgressBar(440, 20, 30, 200, 2)
    bar3.set_bg_color((255, 255, 255))
    bar6 = ProgressBar(40, 20, 30, 200, 3)
    bar6.set_bg_color((255, 255, 255))

    system.event(0, ui.display)
    clock = time.clock()
    val = 1
    dir = True
コード例 #3
0
        for widget in self.widgets_list:
            widget[0].set_pos_size(self.__x + widget_x, self.__y + widget_y,
                                   self.__widget_w * widget[1], self.__h)
            widget_x += self.__widget_w * widget[1] + self.__widget_spc


if __name__ == '__main__':
    try:
        from ui_label import Label
        from ui_text_edit import TextEdit
    except:
        from ui.ui_label import Label
        from ui.ui_text_edit import TextEdit

    img = image.Image("res/images/bg.jpg")
    ui.set_bg_img(img)

    li = HLayout(10, 10, 450, 40)
    li.set_widget_spc(10)

    lab = Label()
    lab.set_text("apple", color=(255, 0, 0), scale=2)
    lab.set_border((255, 255, 0), 2)
    li.add_widgets(lab, 1)

    lab1 = Label()
    lab1.set_text("banana", color=(255, 0, 0), scale=2)
    lab1.set_border((255, 0, 255), 2)
    li.add_widgets(lab1, 2)

    te1 = TextEdit()
コード例 #4
0
ファイル: launch_page.py プロジェクト: vamoosebbf/MaixUI
 def __init__(self):
     ui.set_bg_img(self.create_bg_img())
     self.draw_bar()