1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 import os
26 multitouch = False
28 """initialization before Player.play()
29 Use this only when needed, e.g. for
30 Words.addFontDir(). Do not forget to call
31 super(YourApp, self).__init__(parentNode)"""
32 self.__isRunning = False
33 self._parentNode = parentNode
34 self._starter = None
35
37 """main initialization
38 build node hierarchy under self.__parentNode."""
39 pass
40
42 """enter the application, internal interface.
43 override this and start all animations, intervals
44 etc. here"""
45 pass
46
48 """leave the application, internal interface.
49 override this and stop all animations, intervals
50 etc. Take care your application does not use any
51 non-needed resources after this."""
52 pass
53
54 - def enter(self, onLeave = lambda: None):
55 """enter the application, external interface.
56 Do not override this."""
57 self.__isRunning = True
58 self._onLeave = onLeave
59 self._enter()
60
62 """leave the application, external interface.
63 Do not override this."""
64 self.__isRunning = False
65 self._onLeave()
66 self._leave()
67
69 """returns bool indicating if the event was handled
70 by the application """
71 return False
72
74 return self.__isRunning
75
77 self._starter = starter
78
79 @classmethod
80 - def start(cls, *args, **kwargs):
88