def __init__( self, name="A PyperCard Application :-)", data_store=None, stack=None, font=None ): """ Setup with a clean state. """ super().__init__() # A simple key/value store for application state / data. if data_store is None: self.data_store = {} else: # User supplied dict allows for default states. self.data_store = data_store # Define the nature and duration of the transition between cards. transition = FadeTransition() transition.duration = 0.1 # Will become a reference to play any sounds. self.player = None # Custom font. self.font = font # The screen manager containing all the screens that make up the stack # of cards. self.screen_manager = ScreenManager(transition=transition) # Contains the card objects which drive the application. self.cards = {} self.sound = None # Populate with the default stack (if it exists) if stack: for card in stack: self.add_card(card) # Set the window title to the app's name. self.title = name
def __init__(self, name="A PyperCard Application :-)", data_store=None): """ Setup with a clean state. """ super().__init__() # A simple key/value store for application state / data. if data_store is None: self.data_store = {} else: # User supplied dict allows for default states. self.data_store = data_store # Contains the card objects which drive the application. self.cards = {} # Define the nature and duration of the transition between cards. transition = FadeTransition() transition.duration = 0.1 # The screen manager containing all the screens that make up the stack # of cards. self.screen_manager = ScreenManager(transition=transition) # Set the window title to the app's name. self.title = name
def init(): global s_mgr if s_mgr: return Config.set('kivy', 'desktop', 1) Config.set('graphics', 'width', '1200') Config.set('graphics', 'height', '600') fader = FadeTransition() fader.duration = 0.25 s_mgr = ScreenManager(transition=fader) s_mgr.add_widget(ReplayBrowserScreen(name='s_replay_browser')) s_mgr.add_widget(MatchPerformanceScreen(name='s_match_perf')) s_mgr.add_widget(PlayerPerformanceScreen(name='s_player_perf')) s_mgr.add_widget(PreferencesScreen(name='s_preferences')) if CFG['api_key'] is None: s_mgr.current = 's_preferences' else: s_mgr.current = 's_replay_browser'