Beispiel #1
0
        //=========================================================================================
        /// <summary>
        /// Constructor. Creates a gui search query. 
        /// </summary>
        /// 
        /// <param name="parent"> 
        /// Gui the search query belongs to. This gui's data is what will be searched. 
        /// This cannot be null !
        /// </param>
        //=========================================================================================
        public GuiSearchQuery( Gui parent )
        {
            // Ensure that this is not null in debug windows:

            #if WINDOWS_DEBUG

                if ( parent == null ) throw new Exception("GuiSearchQuery must have a valid parent gui object");

            #endif

            // Save the gui:

            m_gui = parent;
        }
Beispiel #2
0
        //=========================================================================================
        /// <summary>
        /// Initiliazes the game and loads all it's content.
        /// </summary>
        //=========================================================================================
        protected override void Initialize()
        {
            // Initialise everything

            base.Initialize();

            // Create the graphics system object

            s_graphics_system = new GraphicsSystem( s_graphics_device_manager , Content );

            // Create the audio systems:

            s_effects_audio_system = new AudioSystem
            (
                CONTENT_FOLDER + "\\Sounds\\NinjaGame_Sounds.xgs" ,
                CONTENT_FOLDER + "\\Sounds\\NinjaGame_Sounds.xwb" ,
                CONTENT_FOLDER + "\\Sounds\\NinjaGame_Sounds.xsb" ,
                false
            );

            s_music_audio_system = new AudioSystem
            (
                CONTENT_FOLDER + "\\Sounds\\NinjaGame_Music.xgs"  ,
                CONTENT_FOLDER + "\\Sounds\\NinjaGame_Music.xwb"  ,
                CONTENT_FOLDER + "\\Sounds\\NinjaGame_Music.xsb"  ,
                false
            );

            // Apply all default preferences:

            CorePreferences.ApplyAllSettings();

            // Create the timing system:

            s_timing_system = new TimingSystem();

            // Create the level and gui:

            s_level = new Level(); s_gui = new Gui();

            // On debug load the debug font and debug shader:

            #if DEBUG

                // Load the font

                s_debug_font = new Font("Content\\Fonts\\Game_24px.xml");

                // Load the shader:

                s_debug_shader = s_graphics_system.LoadEffect("Effects\\colored");

                // Windows debug specific:

                #if WINDOWS_DEBUG

                    // Also allow window to be resized:

                    Window.AllowUserResizing = true;

                    // Set to 640x480

                    Graphics.DeviceManager.PreferredBackBufferWidth     = 640;
                    Graphics.DeviceManager.PreferredBackBufferHeight    = 480;

                    Graphics.DeviceManager.ApplyChanges();

                    // Add debug console commands for core game

                    DebugCore.AddDebugCommands();

                #endif

            #endif

            // Load the main menu

            s_gui.Load("Content\\Guis\\Boot.xml");
        }
Beispiel #3
0
        //=========================================================================================
        /// <summary> 
        /// Constructor. Creates the gui data block.
        /// </summary>
        /// 
        /// <param name="parent"> Parent gui the gui data block belongs to. Cannot be null. </param>
        //=========================================================================================
        public GuiData( Gui parent )
        {
            // If the parent gui is null then complain in windows debug:

            #if WINDOWS_DEBUG

                if ( parent == null ) throw new Exception("GuiData must have a valid parent gui object");

            #endif

            // Save parent gui:

            m_gui = parent;
        }