예제 #1
0
 def __init__(self):
     super(EndGame, self).__init__()
     self.add_layer(
         Layer(position=(0, 0), size=Widget.get_resolution()).fill('191919'),
         0
     )
     self._interface = Interface('interfaces.endgame')
     self.add_layer(self._interface, 100)
     self.listen_key('return')
예제 #2
0
 def __init__(self, path):
     super(Interface, self).__init__(
         position=(0, 0),
         size=Widget.get_resolution()
     )
     self.set_transparent(True)
     self._dom = ResourceLoader().get_raw_resource(path)
     self._index = 0
     self._ids = {}
     self._root = self._dom.getElementsByTagName('interface')[0]
     for node in self._root.childNodes:
         self._build_node(node, None)
예제 #3
0
    def __init__(self, level, image_id):
        super(ComicStrip, self).__init__()

        self.add_layer(
            Layer(position=(0, 0), size=Widget.get_resolution()).fill('ffffff'),
            0
        )

        (res_width,res_height) = Widget.get_resolution()
        self._res_width = res_width
        self._res_height = res_height
        self._level = level

        self._interface = Interface('interfaces.comicstrip')
        self._height = self.loader().get_raw_resource(image_id).get_height()

        self._increment = 100

        self._interface.get('comicstrip').style('background-image', image_id)
        self.add_layer(self._interface, 100)

        self.listen_key('return')
        self.listen_key('down')
        self.listen_key('up')
예제 #4
0
 def __init__(self):
     super(MainMenu, self).__init__()
     self.add_layer(
         Layer(position=(0, 0), size=Widget.get_resolution()).fill('191919'),
         0
     )
     self._interface = Interface('interfaces.mainmenu')
     JukeBox().play('music.intro')
     self.add_layer(self._interface, 100)
     self._choice = 0
     self._up_tap = False
     self._down_tap = False
     self.listen('quit')
     self.listen_key('up')
     self.listen_key('down')
     self.listen_key('return')
예제 #5
0
    def __init__(self):
        super(LoadingScreen, self).__init__()
        self.loader().load_package('loading')
        self.loader().load_package('interfaces')

        resolution = Widget.get_resolution()
        res_width, res_height = resolution
        self.add_layer(
            Layer(position=(0, 0), size=resolution).fill('191919'), 0
        )
        self._animation = AnimatedLayer(
            position=(res_width / 2 - 120, res_height / 2.3), size=(275, 50)
        )
        self._animation.set_animation('loading.tinyrat.walk')
        self.add_layer(self._animation, 1)
        self.listen('quit')
        self._interface = Interface('interfaces.loadingscreen')
        self.add_layer(self._interface, 100)
        self._queue = Queue.Queue()
        self._loading_task = LoadingTask(self.loader(), self._queue)
        self._loading_task.start()
예제 #6
0
 def play(self):
     self._navigator.set_current_view(
         ComicStrip(Lab1(Widget.get_resolution(), self._navigator), 'static.comic_strip_1')
     )