Пример #1
0
    def _setup_base_temple_scene(self):
        scene = Scene(self._ctl.main_window)
        scene.set_background(self.media_path('blocks-scene-incomplete-1600x1200.png'),
                             self.media_path('blocks-scene-incomplete-1920x1080.png'))

        scene.add_profile_icon()

        scene.add_widget(
            Gtk.Image.new_from_file(self.media_path("boulder.png")),
            Placement(0.65, 0.47),
            Placement(0.63, 0.44)
        )

        scene.add_widget(
            scene.get_user_character_image(),
            Placement(0.22, 0.55, 0.52),
            Placement(0.22, 0.6, 0.52)
        )

        scene.add_widget(
            Gtk.Image.new_from_file(self.media_path("mage-doka.png")),
            Placement(0.8, 0.55),
            Placement(0.8, 0.6)
        )

        return scene
Пример #2
0
    def _setup_second_scene(self):
        self._ctl.main_window.get_window().set_cursor(None)
        scene = Scene(self._ctl.main_window)
        scene.set_background(self.media_path('scene-1600x1200.png'),
                             self.media_path('scene-1920x1080.png'))

        # Need to get the character at this point.
        char_path = os.path.join(os.path.expanduser("~"),
                                 ".character-content/character.png")

        scene.add_widget(Gtk.Image.new_from_file(char_path),
                         Placement(0.5, 0.65, 0.69),
                         Placement(0.45, 0.65, 0.69))

        scene.add_widget(
            Gtk.Image.new_from_file(self.media_path("tailor-judoka.png")),
            Placement(0.85, 0.8, 0.85), Placement(0.85, 0.8, 0.85))

        scene.add_widget(
            SpeechBubble(text="You look amazing!",
                         source=SpeechBubble.BOTTOM,
                         scale=scene.scale_factor), Placement(0.9, 0.4),
            Placement(0.9, 0.4))

        scene.add_profile_icon()

        scene.add_widget(NextButton(),
                         Placement(0.5, 0.95, 0),
                         Placement(0.45, 0.95, 0),
                         self.next_stage,
                         key=Gdk.KEY_space)

        return scene
Пример #3
0
    def _setup_fifth_scene(self):
        scene = Scene(self._ctl.main_window)
        scene.set_background(self.media_path('blocks-scene-complete-1600x1200.png'),
                             self.media_path('blocks-scene-complete-1920x1080.png'))

        scene.add_profile_icon()

        # Move boulder
        scene.add_widget(
            Gtk.Image.new_from_file(self.media_path("boulder.png")),
            Placement(0.8, 0.44),
            Placement(0.8, 0.44)
        )

        scene.add_widget(
            scene.get_user_character_image(),
            Placement(0.22, 0.55, 0.52),
            Placement(0.22, 0.6, 0.52)
        )

        scene.add_widget(
            SpeechBubble(
                text="Awesome, now we can escape!",
                source=SpeechBubble.BOTTOM,
                source_align=0.5,
                scale=scene.scale_factor
            ),
            Placement(0.85, 0.25, 0),
            Placement(0.85, 0.25, 0)
        )

        # Change mage face?
        scene.add_widget(
            Gtk.Image.new_from_file(self.media_path("mage-doka.png")),
            Placement(0.8, 0.55),
            Placement(0.8, 0.6)
        )

        scene.add_widget(
            NextButton(),
            Placement(0.5, 0.8, 0),
            Placement(0.5, 0.87, 0),
            self.next_stage,
            key=Gdk.KEY_space
        )

        return scene
Пример #4
0
    def _setup_third_scene(self):
        scene = Scene()

        scene.set_background(common_media_path("blueprint-bg-4-3.png"),
                             common_media_path("blueprint-bg-16-9.png"))

        scene.add_profile_icon()

        # Altar
        scene.add_widget(Gtk.Image.new_from_file(self.media_path('altar-incomplete.png')),
                         Placement(0.5, 0.5, 1),
                         Placement(0.5, 0.5, 1))

        # Block image for drag source
        block_image = scene.scale_image_to_scene(
            Gtk.Image.new_from_file(self.media_path("kano-block.png")),
            1,
            1
        )

        block_pixbuf = scene.scale_pixbuf_to_scene(
            GdkPixbuf.Pixbuf.new_from_file(self.media_path("kano-block.png")),
            1,
            1
        )

        block_drag_source = DragSource(block_image, block_pixbuf)

        scene.add_widget(
            block_drag_source,
            Placement(0.5, 0.68, 0),
            Placement(0.5, 0.68, 0)
        )

        # Block drop area
        drop_area = DropArea(self.fourth_scene)
        drop_area_width = scene.get_width() * 0.24
        drop_area_height = scene.get_height() * 0.08
        drop_area.set_size_request(drop_area_width, drop_area_height)

        scene.add_widget(
            drop_area,
            Placement(0.505, 0.47, 0),
            Placement(0.505, 0.47, 0)
        )

        return scene
Пример #5
0
    def _setup_second_scene(self):
        self._ctl.main_window.get_window().set_cursor(None)
        scene = Scene(self._ctl.main_window)
        scene.set_background(self.media_path('scene-1600x1200.png'),
                             self.media_path('scene-1920x1080.png'))

        # Need to get the character at this point.
        char_path = os.path.join(
            os.path.expanduser("~"), ".character-content/character.png"
        )

        scene.add_widget(
            Gtk.Image.new_from_file(char_path),
            Placement(0.5, 0.65, 0.69),
            Placement(0.45, 0.65, 0.69)
        )

        scene.add_widget(
            Gtk.Image.new_from_file(self.media_path("tailor-judoka.png")),
            Placement(0.85, 0.8, 0.85),
            Placement(0.85, 0.8, 0.85)
        )

        scene.add_widget(
            SpeechBubble(
                text="You look amazing!",
                source=SpeechBubble.BOTTOM,
                scale=scene.scale_factor
            ),
            Placement(0.9, 0.4),
            Placement(0.9, 0.4)
        )

        scene.add_profile_icon()

        scene.add_widget(
            NextButton(),
            Placement(0.5, 0.95, 0),
            Placement(0.45, 0.95, 0),
            self.next_stage,
            key=Gdk.KEY_space
        )

        return scene
Пример #6
0
    def _setup_fourth_scene(self):
        scene = Scene(self._ctl.main_window)
        scene.set_background(common_media_path("blueprint-bg-4-3.png"),
                             common_media_path("blueprint-bg-16-9.png"))

        scene.add_profile_icon()

        scene.add_widget(
            Gtk.Image.new_from_file(self.media_path("altar-complete.png")),
            Placement(0.5, 0.5, 1),
            Placement(0.5, 0.5, 1),
        )

        scene.add_widget(
            NextButton(),
            Placement(0.5, 0.9, 0),
            Placement(0.5, 0.9, 0),
            self.fifth_scene,
            key=Gdk.KEY_space
        )

        return scene