def _setup_second_scene(self): scene = Scene(self._ctl.main_window) scene.set_background(self.media_path('cliff-file-1600x1200.png'), self.media_path('cliff-file-1920x1080.png')) scene.add_widget( SpeechBubble(text='Thanks!', source=SpeechBubble.BOTTOM, scale=scene.scale_factor), Placement(0.845, 0.08), Placement(0.895, 0.1) ) scene.add_widget( Gtk.Image.new_from_file(self.media_path('cliff-judoka.png')), Placement(0.85, 0.3, 0.92), Placement(0.9, 0.35, 0.96) ) #scene.add_widget( # NextButton(), # Placement(0.5, 0.7, 0), # Placement(0.5, 0.7, 0), # self._ctl.next_stage # # key=Gdk.KEY_space #) scene.schedule(3, self._ctl.next_stage) return scene
def _setup_disconnected_scene(self): scene = Scene(self._ctl.main_window) scene.set_background(self.media_path('space-1-bg-4-3.png'), self.media_path('space-1-bg-16-9.png')) scene.add_widget( Gtk.Image.new_from_file(self.media_path('spaceman.png')), Placement(0.9, 0.9, 0.65), Placement(0.9, 0.9, 0.75)) scene.add_widget( Gtk.Image.new_from_file(self.media_path('console.gif')), Placement(0.35, 0.925, 0.8), Placement(0.367, 0.888), self.second_scene) copy = [ 'Oh no, the connection failed!', 'But we can still play.', ] scene.add_widget( SpeechBubble(text='\n'.join(copy), source=SpeechBubble.BOTTOM, scale=scene.scale_factor), Placement(0.97, 0.57), Placement(0.95, 0.46)) scene.add_widget(NextButton(), Placement(0.5, 0.99, 0), Placement(0.45, 0.99, 0), self.next_stage) scene.schedule(20, self._show_rocket_hint, scene) return scene
def _setup_second_scene(self): scene = Scene(self._ctl.main_window) scene.set_background(self.media_path('cliff-file-1600x1200.png'), self.media_path('cliff-file-1920x1080.png')) scene.add_widget( SpeechBubble(text='Thanks!', source=SpeechBubble.BOTTOM, scale=scene.scale_factor), Placement(0.845, 0.08), Placement(0.895, 0.1)) scene.add_widget( Gtk.Image.new_from_file(self.media_path('cliff-judoka.png')), Placement(0.85, 0.3, 0.92), Placement(0.9, 0.35, 0.96)) #scene.add_widget( # NextButton(), # Placement(0.5, 0.7, 0), # Placement(0.5, 0.7, 0), # self._ctl.next_stage # # key=Gdk.KEY_space #) scene.schedule(3, self._ctl.next_stage) return scene
def _setup_first_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')) # Grey overlay #blur = Gtk.EventBox() #blur.get_style_context().add_class("blur") #screen = Gdk.Screen.get_default() #width = screen.get_width() #height = screen.get_height() #blur.set_size_request(width, height) # This currently blocks the emergency exit button #scene.add_widget( # blur, # Placement(0, 0, 0), # Placement(0, 0, 0), #) # No longer in use. # click_label = Gtk.Label("CLICK") # click_label.get_style_context().add_class("intro_label") # move_label = Gtk.Label("MOVE") # move_label.get_style_context().add_class("intro_label") # hbox = Gtk.Box() # hbox.pack_start(click_label, False, False, 0) # hbox.pack_end(move_label, False, False, 0) # click_label.set_margin_left(30) # move_label.set_margin_right(30) # Create the keyboard and pack it before putting it in the grab_label = Gtk.Label("Click NEXT to start") grab_label.get_style_context().add_class("big_intro_label") keyboard_gif = Gtk.Image.new_from_file( self.media_path("KeyboardClick.gif") ) vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL) vbox.pack_start(grab_label, False, False, 0) vbox.pack_start(keyboard_gif, False, False, 20) scene.add_widget( vbox, Placement(0.5, 0.5, 0), Placement(0.5, 0.5, 0) ) scene.add_widget( NextButton(), Placement(0.5, 0.75, 0), Placement(0.5, 0.75, 0), self.next_stage ) scene.schedule(60, self._show_hint, scene) return scene
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
def _setup_first_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")) # Grey overlay # blur = Gtk.EventBox() # blur.get_style_context().add_class("blur") # screen = Gdk.Screen.get_default() # width = screen.get_width() # height = screen.get_height() # blur.set_size_request(width, height) # This currently blocks the emergency exit button # scene.add_widget( # blur, # Placement(0, 0, 0), # Placement(0, 0, 0), # ) # No longer in use. # click_label = Gtk.Label("CLICK") # click_label.get_style_context().add_class("intro_label") # move_label = Gtk.Label("MOVE") # move_label.get_style_context().add_class("intro_label") # hbox = Gtk.Box() # hbox.pack_start(click_label, False, False, 0) # hbox.pack_end(move_label, False, False, 0) # click_label.set_margin_left(30) # move_label.set_margin_right(30) # Create the keyboard and pack it before putting it in the grab_label = Gtk.Label("Click NEXT to start") grab_label.get_style_context().add_class("big_intro_label") keyboard_gif = Gtk.Image.new_from_file(self.media_path("KeyboardClick.gif")) vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL) vbox.pack_start(grab_label, False, False, 0) vbox.pack_start(keyboard_gif, False, False, 20) scene.add_widget(vbox, Placement(0.5, 0.5, 0), Placement(0.5, 0.5, 0)) scene.add_widget(NextButton(), Placement(0.5, 0.75, 0), Placement(0.5, 0.75, 0), self.next_stage) scene.schedule(60, self._show_hint, scene) return scene
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
def _setup_connected_scene(self): scene = Scene() scene.set_background(self.media_path('space-2-bg-4-3.png'), self.media_path('space-2-bg-16-9.png')) scene.add_widget( Gtk.Image.new_from_file(self.media_path('spaceman.png')), Placement(0.9, 0.9, 0.65), Placement(0.9, 0.9, 0.75)) scene.add_widget( Gtk.Image.new_from_file(self.media_path('rocket.png')), Placement(0.697, 0.597, 0.8), Placement(0.695, 0.275)) copy = 'We have signal! Great work.' scene.add_widget( SpeechBubble(text=copy, source=SpeechBubble.BOTTOM, scale=scene.scale_factor), Placement(0.97, 0.57), Placement(0.95, 0.46)) scene.schedule(3, self.next_stage) return scene
def _setup_third_scene(self): self._toolbar_icons = { "home": { "text": "Click the Home button to\n" + "return to the desktop.", "position": [0, 100], "source_align": 0.2 }, "help": { "text": "If you need Help,\n" + "you can click here.", "position": [19, 100], "source_align": 0.5 }, "profile": { "text": "Here's where you can\n" + "sync your online Profile.", "position": [38, 100], "source_align": 0.5 }, "wifi": { "text": "You can change Internet\n" + "settings here.", "position": [75, 100], "source_align": 0.5 }, "updater": { "text": "Want updates?\n" + "Click on the Updater.", "position": [150, 100], "source_align": 0.5 }, "settings": { "text": "And this is where you can change\n" + "all the system Settings.", "position": [55, 100], "source_align": 0.7 }, "audio": { "text": "Control the volume\n" + "of the system.", "position": [150, 100], "source_align": 1.0 } } self._toolbar_next_button_shown = False scene = Scene(self._ctl.main_window) scene.set_background(self._wallpapers['4-3'], self._wallpapers['16-9']) self._add_profile_icon(scene) self._add_world_icon(scene, offline=(not is_registered())) # Pack the speechbubble into a fixed so it the same distance from # toolbar for all resolutions speechbubble_fixed = Gtk.Fixed() speechbubble_fixed.set_size_request(500, 400) speechbubble_fixed.put( SpeechBubble( text='This is your Taskbar!\n' + 'Click on the different widgets to find\n' + 'out more about what they do.', # 'Use its buttons to change settings,\n' + # 'get updates, and more.', source=SpeechBubble.BOTTOM), 0, 100) scene.add_widget(speechbubble_fixed, Placement(1, 1), Placement(1, 1), name="toolbar_speechbubble") self._add_taskbar(scene, attach_callbacks=True) scene.schedule(30, self._show_toolbar_next_button, scene) return scene