def openEndCloseGame(self, end):
        '''
        This is an function used to open the Ending of game.

        :param end:
        '''
        clocker(lambda dt: self.openCloseModel('ending', end, ['game']), 'once', .1)
 def focus(self, source):
     if isinstance(source, str):
         animation(self, ({'opacity': 0, 'd': .1}, ))
         clocker(lambda dt: animation(self, ({
             'opacity': 1,
             'd': .3
         }, )), 'once', .12)
         clocker(lambda dt: self._changing(source), 'once', .12)
 def openGame(self, parameter=None):
     '''
     This is an event function used for open Game, when the game is open I need to reset any unnecessary
     model and the game model should be reseted because it's bug if the model is already instanced and
     it instanced again.
     '''
     self.eventCloseModal('SerializePopup')
     self.animationHomeDown()
     clocker(lambda dt: self.openCloseModel('game', parameter, ['home', 'ending', 'game',]), 'once', .1)
    def animation(self, what, instance=None, anime='showing', duration=0):
        '''
        function animation provider
        '''
        if isinstance(what, str) and instance is not None:
            if what == 'layout':
                instance = getattr(self.layout, instance)
            elif what == 'widget':
                instance = getattr(self.widget, instance)

            clocker(lambda dt: getattr(instance, anime)(), 'once', duration)
    def openHome(self, parameter = None):
        '''
        method used for showing home when the intro is done, game is over or even player stop
        the game and back to home.
        '''
        if parameter == 'ending':
            self.animationEndDown()
            clocker(lambda dt: self.openCloseModel('home', None, ['ending']), 'once', .1)

        elif parameter == 'gaming':
            clocker(lambda dt: self.openCloseModel('home', None, ['game']), 'once', .1)

        elif parameter == 'intro':
            clocker(lambda dt: self.openCloseModel('home', None, ['intro']), 'once', .1)
 def focus(self, source):
     if isinstance(source, str):
         animation(self, ({'opacity': 0, 'd': .1},))
         clocker(lambda dt : animation(self, ({'opacity': 1, 'd': .3},)), 'once', .12)
         clocker(lambda dt : self._changing(source), 'once', .12)
 def openIntro(self):
     '''
     used for open intro when game is running for the first time.
     '''
     self.animationIntro()
     clocker(lambda dt: self.openCloseModel('home', None, ['intro']), 'once', 3)