Esempio n. 1
0
    def _setup_first_scene(self):
        scene = Scene()
        scene.set_background(self.media_path('cliff-file-1600x1200.png'),
                             self.media_path('cliff-file-1920x1080.png'))

        char_pixbuf = GdkPixbuf.Pixbuf.new_from_file(
            self.media_path('judoka-clicked.png')
        )
        char_pixbuf = scene.scale_pixbuf_to_scene(char_pixbuf, 0.92, 0.96)
        judoka = Gtk.Image.new_from_file(self.media_path('cliff-judoka.png'))
        judoka = scene.scale_image_to_scene(judoka, 0.92, 0.96)
        speechbubble = SpeechBubble(
            text='Click on me,\nhold down the mouse button,\nand drag me across!',
            source=SpeechBubble.LEFT,
            source_align=0.0,
            scale=scene.scale_factor
        )
        keyboard = Gtk.Image.new_from_file(self.media_path('Keyboard-Drag.gif'))

        drag_source = DragSource(judoka, char_pixbuf, speechbubble, keyboard)

        # Send the second cb to the scene
        drop_area = DropArea(self.second_scene)
        drop_area.set_size_request(
            0.35 * SCREEN_WIDTH, 0.5 * SCREEN_HEIGHT
        )

        scene.add_widget(
            keyboard,
            Placement(0.5, 1, 0),
            Placement(0.5, 1, 0)
        )

        scene.add_widget(
            speechbubble,
            Placement(0.34, 0.23),
            Placement(0.4, 0.23),
            name='speech'
        )

        scene.add_widget(
            drag_source,
            Placement(0.15, 0.25),
            Placement(0.25, 0.25)
        )

        scene.add_widget(
            drop_area,
            Placement(1, 0),
            Placement(1, 0)
        )

        scene.schedule(40, self._scene_1_hint, speechbubble)

        return scene
Esempio n. 2
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
Esempio n. 3
0
    def _setup_first_scene(self):
        scene = Scene()
        scene.set_background(self.media_path('cliff-file-1600x1200.png'),
                             self.media_path('cliff-file-1920x1080.png'))

        char_pixbuf = GdkPixbuf.Pixbuf.new_from_file(
            self.media_path('judoka-clicked.png'))
        char_pixbuf = scene.scale_pixbuf_to_scene(char_pixbuf, 0.92, 0.96)
        judoka = Gtk.Image.new_from_file(self.media_path('cliff-judoka.png'))
        judoka = scene.scale_image_to_scene(judoka, 0.92, 0.96)
        speechbubble = SpeechBubble(
            text=
            'Click on me,\nhold down the mouse button,\nand drag me across!',
            source=SpeechBubble.LEFT,
            source_align=0.0,
            scale=scene.scale_factor)
        keyboard = Gtk.Image.new_from_file(
            self.media_path('Keyboard-Drag.gif'))

        drag_source = DragSource(judoka, char_pixbuf, speechbubble, keyboard)

        # Send the second cb to the scene
        drop_area = DropArea(self.second_scene)
        drop_area.set_size_request(0.35 * SCREEN_WIDTH, 0.5 * SCREEN_HEIGHT)

        scene.add_widget(keyboard, Placement(0.5, 1, 0), Placement(0.5, 1, 0))

        scene.add_widget(speechbubble,
                         Placement(0.34, 0.23),
                         Placement(0.4, 0.23),
                         name='speech')

        scene.add_widget(drag_source, Placement(0.15, 0.25),
                         Placement(0.25, 0.25))

        scene.add_widget(drop_area, Placement(1, 0), Placement(1, 0))

        scene.schedule(40, self._scene_1_hint, speechbubble)

        return scene