main.py 文件源码

python
阅读 17 收藏 0 点赞 0 评论 0

项目:GravBox 作者: GravBoxInterface 项目源码 文件源码
def __init__(self, **kwargs):
        super(UiowaScreen, self).__init__(**kwargs)

        self.layout = FloatLayout()
        self.layout.width = Window.width
        self.layout.height = Window.height
        self.layout.x = 0
        self.layout.y = 0
        self.add_widget(self.layout)

        img = Image(source = self.uiowaImage)
        img.size = (Window.width*1.0, Window.height*1.0)
        img.pos = (0, 0)
        img.opacity = .8
        self.add_widget(img, 1)

        with self.layout.canvas: #sets canvas instructions for the rightlayout and draws a blue rect. filling the entire layout
            Color(1, 1, 1, .7) #WHITE
            Rectangle(pos=(.15 * self.layout.height, .30 * self.layout.height), size=(.45 * self.layout.width, .55 * self.layout.height))  

        qr = Image(source = self.qrCode)
        qr.size_hint = (.39, .39)
        qr.pos_hint = {'x': .56, 'y': .12}
        self.add_widget(qr)

        logo = Image(source=self.uiLogo)
        logo.size_hint = (.33, .33)
        logo.pos_hint = {'x': .59, 'y': .58}
        self.add_widget(logo)        

        uiowaText = Label(text= 'The GravBox project is the result of the hard work of students of the University of Iowa\'s Physics and Astronomy Department. To learn more about physics and astronomy at the University of Iowa, and the research work being done in these areas, please scan the QR code to the right.', valign='middle', halign='center', font_size='24sp', text_size=(.4 * self.layout.width, None), color=(0,0,0,1))
        uiowaText.pos_hint = {'x': -.18, 'y': .075}
        self.add_widget(uiowaText)

        backBtn = MyButton(text = 'BACK') # back button
        backBtn.size_hint = (.1, .1)
        backBtn.pos_hint ={'x': .27, 'y': .16}
        backBtn.background_color = [.4, .4, .4, 1]
        backBtn.bind(on_release = self.backButton) #when the button is released the callback function is called
        self.add_widget(backBtn)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号