indexing description: "[ The singleton object of type GUI_GAME_SKIN represents the mask that will be drawn above the world panorama cylinder. The mask consists of a background bitmap with alpha channel and two dialog elements: The repository and the main menu. This class is part of the XAE Extended Adventure Engine Project. ]" author: "Ralph Wiedemeier, ralphw@student.ethz.ch" date: "$Date$" revision: "$Revision$" class GUI_GAME_SKIN inherit GUI_DRAWABLE EM_SHARED_BITMAP_FACTORY export {NONE} all end GUI_SHARED export {NONE} all end OPEN_GL_LIBRARY export {NONE} all end create {GUI_SHARED} make feature -- Initialization make is -- Initialize the game skin do -- Load RGBA image used as foreground skin bitmap_factory.create_bitmap_from_image (gui_constants.path_skin) skin_mask := bitmap_factory.last_bitmap create repository.make_empty create main_menu.make -- create debug dialog create debug_dialog.make_with_text ("No information available", gui_constants.font_normal) debug_dialog.set_position (760, 650) debug_dialog.set_size (250, 100) debug_dialog.set_special_corner_top_right debug_dialog.set_special_corner_size (15) debug_dialog.set_padding (8) debug_dialog.set_border_color_normal (gui_constants.color_yellow) debug_dialog.set_layout_horizontal debug_dialog.set_font_size (0.7) debug_dialog.enable_multiline end feature -- Status repository: GUI_REPOSITORY -- The globally unique game repository main_menu: GUI_MAIN_MENU -- The globally unique main menu set_debug_message (a_string: STRING) is -- Set a debug message displayed in a debug window do debug_message := a_string end debug_message: STRING set_status_message (a_string: STRING) is -- Set a status message displayed below the repository do status_message := a_string end status_message: STRING enable_debug is -- Enable debug output do is_debug_enabled := True end disable_debug is -- Disable debug output do is_debug_enabled := False end is_debug_enabled: BOOLEAN feature -- Operation draw (a_surface: EM_VIDEO_SURFACE) is -- draw all elements of game skin onto 'a_surface' local font: GUI_PROPORTIONAL_FONT do a_surface.draw_bitmap (skin_mask) repository.draw (a_surface) main_menu.draw (a_surface) font := gui_constants.font_normal if status_message /= Void then font.set_gl_scaling (0.8) font.draw_text_line (status_message, a_surface, 8, 705) end if is_debug_enabled and then debug_message /= Void then debug_dialog.set_text (debug_message) debug_dialog.draw (a_surface) end end feature {NONE} -- Internal Variables skin_mask: EM_BITMAP debug_dialog: GUI_SPECIAL_BUTTON end -- class GUI_GAME_SKIN