def setLayout(self): self.size = (1500, 1000) with self.canvas: Color(.532345, 1.0, .742, 1.0) Rectangle(size=self.size) sound_board_layout = AnchorLayout() sound_board_layout.anchor_x = "center" sound_board_layout.anchor_y = "top" sound_board_layout.size = self.size sound_board_layout.pos = self.pos sound_board_layout.size_hint = (1.0, 1.0) sound_board_layout.spacing = 50 self.title_layout.orientation = "vertical" self.title_layout.size_hint = (1.0, 1.0) self.title_layout.spacing = 10 title_label = Label() title_label.text = "Soundboard" title_label.color = [.6, .2, 1, .5] title_label.font_size = 50 title_label.font_name = "C:\\Windows\\Fonts\\Arial" title_label.size_hint = (1, 1) self.title_layout.add_widget(title_label) self.set_settings_layout() self.set_sounds() self.title_layout.add_widget(self.grid_layout) sound_board_layout.add_widget(self.title_layout) self.add_widget(sound_board_layout)
def setTopImage(self, image, cw=0, ch=0): print('MfxCanvas: setTopImage %s' % image) if self.topImage: self.clear_widgets([self.topImage]) self.topImage = None if image: tex = LImage(texture=image.texture) tex.size_hint = (0.4, 0.4) lay = AnchorLayout(anchor_y='bottom') lay.size = self.size lay.add_widget(tex) self.topImage = lay self.add_widget(self.topImage) return 1