class CountiesApp(App): def build(self): self.root = Viewport(size=(1920,2160)) self.bottom_display = BottomDisplay() self.top_display = TopDisplay() self.root.add_widget(self.bottom_display) self.root.add_widget(self.top_display) return self.root
def _launch_game_round(dt=None): width = BLOCK_SIZE[0] * GAME_AREA_SIZE[0] height = BLOCK_SIZE[1] * GAME_AREA_SIZE[1] game_scene = Viewport(width=width, height=height) game = MoonRabbitGame() game_scene.add_widget(game) self.context.scene = game_scene Clock.schedule_once(game_scene.fit_to_window, -1)
def _launch_game_round(dt=None): width = BLOCK_SIZE[0]*GAME_AREA_SIZE[0] height = BLOCK_SIZE[1]*GAME_AREA_SIZE[1] game_scene = Viewport(width=width, height=height) game = MoonRabbitGame() game_scene.add_widget(game) self.context.scene = game_scene Clock.schedule_once(game_scene.fit_to_window, -1)
def build(self): vp = Viewport(size=(par_width, par_height)) mw = MainWidget() vp.add_widget(mw) mw.initial_load() return vp
class GameApp(App): def build(self): self.root = Viewport(size=Window.size) self.root.add_widget(Menu()) return self.root
class ViewportApp(App): def build(self): self.root = Viewport(size=(1080, 1920)) self.root.add_widget(Factory.Button(text="ViewportApp")) return self.root