indexing description: "Screen that shows the image that was solved and congratulates the user." author: "Stefan Hildenbrand and Team UC" date: "$Date$" revision: "$Revision$" class FINISH_SCREEN inherit EM_DRAWABLE_SCENE undefine is_equal, copy end EM_DRAWABLE_CONTAINER [EM_DRAWABLE] undefine default_create redefine make end UC_SHARED_ITEMS rename height as window_height, width as window_width undefine default_create, is_equal, copy end MEMORY undefine default_create, is_equal, copy end create make_from_image feature -- Access make is -- Initialize empty scene. do default_create precursor-- {EM_DRAWABLE_SCENE} main_container := current end make_from_image(image: EM_BITMAP) is -- create this scene local a_string : EM_STRING cont_button : BUTTON do make_scene event_loop.start make if not player.is_stopped then player.stop end main_container.extend(image) image.set_x_y((window_width-image.width)//2, (window_height-image.height)//2) create a_string.make ("Great! You did it.", uc_gui_elements_default_font) a_string.set_x_y((window_width-a_string.width)//2, 50) main_container.extend (a_string) set_background_color (uc_background_color) create cont_button.make_with_name("continue", event_loop) cont_button.set_x_y ((window_width-cont_button.width)//2, 80) main_container.extend (cont_button) cont_button.button_clicked_event.subscribe (agent handle_continue) -- play applaus player.play_song ("sound/applaus") end handle_continue is -- continue with menu local new : UC_INTERFACE do event_loop.stop -- stop event_loop collect -- first, clean up memory, perhaps do a full_collect ? create new -- create a new interface, perhaps somehow reuse the old one ? player.stop next_scene := new -- and launch it end end -- class FINISH_SCREEN