indexing description: "[ A simple EM scene ]" date: "$Date: 2006/07/08 12:15:37 $" revision: "$Revision: 1.7 $" class MAIN_SCENE inherit EM_COMPONENT_SCENE rename make_component_scene as make redefine initialize_scene end create make feature {NONE} -- Initialisation initialize_scene is -- Set up Selection stuff do Precursor create selection.make_empty -- This nice line will crash your ISE compiler, so we need to find a way around :( -- selection.set_to_string_agent ( agent {EM_PAIR[ STRING, EM_SCENE ]}.first ) selection.set_to_string_agent ( agent string ) selection.set_dimension ( 300, 600 ) add_component ( selection ) create button.make_from_text ( "load" ) button.set_dimension ( 300, 40 ) button.set_position ( 0, 600 ) button.clicked_event.subscribe ( agent button_click ) add_component ( button ) -- Add a new tutorial here selection.put ( create {EM_PAIR[ STRING, EM_SCENE ]}.make ( "3D Objects", create {OBJECT_SCENE}.make ) ) selection.put ( create {EM_PAIR[ STRING, EM_SCENE ]}.make ( "Nodes, actors and targets", create {NODE_SCENE}.make ) ) selection.put ( create {EM_PAIR[ STRING, EM_SCENE ]}.make ( "Object selection", create {SELECTION_SCENE}.make ) ) selection.put ( create {EM_PAIR[ STRING, EM_SCENE ]}.make ( "Textures & Shaders", create {TEXTURE_SCENE}.make ) ) end string( a_pair: EM_PAIR[ STRING, EM_SCENE ] ): STRING is -- A ISE compiler workaround do result := a_pair.first end button_click is -- Change to the next scene do if selection.selected_element /= void then set_next_scene ( selection.selected_element.second ) start_next_scene end end button: EM_BUTTON selection: EM_TEXTLIST[ EM_PAIR[ STRING, EM_SCENE ] ] end