def __init__(self, **kwargs): super(UiowaScreen, self).__init__(**kwargs) layout = FloatLayout() layout.width = Window.width layout.height = Window.height layout.x = Window.width / 2 - layout.width / 2 layout.y = Window.height / 2 - layout.height / 2 self.add_widget(layout) img = Image(source=self.uiowaImage) img.size = (Window.width * 1.0, Window.height * 1.0) img.pos = (-Window.width * 0.0, -Window.height * 0.0) img.opacity = 0.4 self.add_widget(img) aboutText = Label(text='UIOWA INFO HERE') aboutText.pos = (.25, .25) self.add_widget(aboutText) backBtn = MyButton(text='BACK') #start button backBtn.size_hint = (.1, .1) backBtn.pos_hint = {'x': 0, 'y': .9} backBtn.background_color = [.4, .4, .4, 1] backBtn.bind( on_release=self.backButton ) #when the button is released the backButton function is called layout.add_widget(backBtn)
def __init__(self, **kwargs): super(AboutScreen, self).__init__(**kwargs) layout = FloatLayout() layout.width = Window.width layout.height = Window.height layout.x = Window.width / 2 - layout.width / 2 layout.y = Window.height / 2 - layout.height / 2 self.add_widget(layout) img = Image(source=self.aboutImage) img.size = (Window.width * 1.0, Window.height * 1.0) img.pos = (-Window.width * 0.0, -Window.height * 0.0) img.opacity = 0.4 self.add_widget(img) aboutText = Label( text= 'GravBox is the interface application for the Augmented Reality (AR) Sandbox for gravitational dynamics simulations designed and built\nby Dr. Hai Fu\'s Introduction to Astrophysics class during the 2016-2017 academic year and beyond.\nGravBox itself was designed by Zachary Luppen, Erin Maier, and Mason Reed.\n\nAR Sandbox is the result of an NSF-funded project on informal science education for freshwater lake and watershed science developed by the\nUC Davis\' W.M. Keck Center for Active Visualization in the Earth Sciences (KeckCAVES),\ntogether with the UC Davis Tahoe Environmental Research Center, Lawrence Hall of Science, and ECHO Lake Aquarium and Science Center.', halign='center', valign='center') aboutText.pos = (.25, .25) self.add_widget(aboutText) backBtn = MyButton(text='BACK') # back button backBtn.size_hint = (.1, .1) backBtn.pos_hint = {'x': 0, 'y': .90} 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)
def initialize_background_image(self, width, height): background_image = Image(source="dashboard/serpent.png") background_image.size = (height, height) background_image.opacity = 0.1 background_image.pos = ((width / 2) - (height / 2), self.size[1] - height) self.add_widget(background_image)
def __init__(self, **kwargs): super(AboutScreen, 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.aboutImage) 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 Color(1, 1, 1, .7) #BLUE Rectangle(pos=(.05 * self.layout.height, .05 * self.layout.height), size=(.45 * self.layout.width, .9 * self.layout.height)) group = Image(source=self.groupPhoto) group.size_hint = (.5, .5) group.pos = (Window.width * .49, Window.height * .37) self.add_widget(group) nameLabel = Label( text= 'From left to right: Jianbo Lu, Jacob Isbell, Sophie Deam, Wyatt Bettis, Ross McCurdy, Erin Maier, Sadie Moore, Zachary Luppen, Mason Reed', text_size=(.45 * self.layout.width, .3 * self.layout.height), halign='center', font_size='18sp', color=(0, 0, 0, 1)) nameLabel.pos = (Window.width * .24, Window.height * -.10) self.add_widget(nameLabel) aboutText = Label( text= 'GravBox is the interface application for the Augmented Reality (AR) Sandbox for gravitational dynamics simulations designed and built at the University of Iowa by Dr. Hai Fu\'s 2016-2017 Introduction to Astrophysics class. \n\nThe GravBox application was developed by Zachary Luppen, Erin Maier, and Mason Reed. The sandbox was designed and built by Wyatt Bettis, Ross McCurdy, and Sadie Moore. The gravitational algorithm was written by Sophie Deam, Jacob Isbell, and Jianbo Lu. Graphic design was contributed by Jeremy Swanston. \n\nThe original AR Sandbox is the result of an NSF-funded project on informal science education for freshwater lake and watershed science developed by the UC Davis\' W.M. Keck Center for Active Visualization in the Earth Sciences, together with the UC Davis Tahoe Environmental Research Center, Lawrence Hall of Science, and ECHO Lake Aquarium and Science Center.\n\n To learn more about the GravBox project, contact Hai Fu at [email protected], or visit our Github at https://github.com/GravBoxInterface/GravBox', valign='middle', halign='center', font_size='19sp', text_size=(.4 * self.layout.width, None), color=(0, 0, 0, 1)) aboutText.pos = (-.39 * self.layout.height, 0) self.add_widget(aboutText) backBtn = MyButton(text='BACK') # back button backBtn.size_hint = (.1, .1) backBtn.pos_hint = {'x': .69, 'y': .12} 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)
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)
def __init__(self, **kwargs): super(WelcomeScreen, self).__init__(**kwargs) layout = FloatLayout( ) #Float Layout for positioning buttons and image anywhere on the screen layout.width = Window.width #the float layout is the size of the window layout.height = Window.height layout.x = Window.width / 2 - layout.width / 2 #sets the x position of the layout to 0 layout.y = Window.height / 2 - layout.height / 2 #sets the y position of the layout to 0 self.add_widget(layout) #adds the layout to the screen img = Image(source=self.welcomeImage) #BACKGROUND IMAGE img.size = (Window.width * 1.0, Window.height * 1.0) img.pos = (-Window.width * 0.0, -Window.height * 0.0) img.opacity = 1.0 #alpha value between 0.0 - 1.0 self.add_widget(img) #adds the image to the screen startBtn = MyButton(text='') #start button startBtn.size_hint = (.21, .09) startBtn.pos_hint = {'x': .395, 'y': .24} startBtn.background_color = [ .306, .325, .4196, .4 ] #backgroundcolor of the button (this is grayish) startBtn.bind( on_release=self.changer ) #when the button is released the changer function is called self.add_widget( startBtn) #adds the button called startButton to the floatlayout aboutBtn = MyButton(text='') #about button aboutBtn.size_hint = (.08, .095) aboutBtn.pos_hint = {'x': .618, 'y': 0} aboutBtn.background_color = [.4, .4, .4, .4] aboutBtn.bind( on_release=self.about ) #when the button is released the about function is called self.add_widget( aboutBtn) #adds the button called aboutBtn to the floatlayout uiowaBtn = MyButton(text='') #uiowa button uiowaBtn.size_hint = (.08, .095) uiowaBtn.pos_hint = {'x': .7, 'y': 0} uiowaBtn.background_color = [.4, .4, .4, .4] uiowaBtn.bind( on_release=self.uiowa ) #when the button is released the uiowa function is called self.add_widget( uiowaBtn) #adds the button called uiowaBtn to the floatlayout
def update_test_image(self, *_): """Regenerate the watermark preview image.""" if self.watermark_settings: test_image = self.watermark_settings.ids['testImage'] test_image.clear_widgets() if os.path.isfile(self.watermark_image): image = KivyImage(source=self.watermark_image) size_x = test_image.size[0] * (self.watermark_size / 100) size_y = test_image.size[1] * (self.watermark_size / 100) image.size = (size_x, size_y) image.size_hint = (None, None) image.opacity = self.watermark_opacity / 100 x_pos = test_image.pos[0] + ((test_image.size[0] - size_x) * (self.watermark_horizontal / 100)) y_pos = test_image.pos[1] + ((test_image.size[1] - size_y) * (self.watermark_vertical / 100)) image.pos = (x_pos, y_pos) test_image.add_widget(image)