Beispiel #1
0
        /// <summary>
        /// Loads graphics content for this screen. This uses the shared ContentManager
        /// provided by the Game class, so the content will remain loaded forever.
        /// Whenever a subsequent MessageBoxScreen tries to load this same content,
        /// it will just get back another reference to the already loaded data.
        /// </summary>
        public override void LoadContent()
        {
            ContentManager content = new ContentManager(ScreenManager.Game.Services, "Content");

            m_pln_txt = new Texture2D(ScreenManager.GraphicsDevice, 1, 1);
            m_pln_txt.SetData(new Color[] { Color.White });

            m_pong_lvl      = content.Load <Texture2D>("LevelSelection\\pong");
            m_duck_hunt_lvl = content.Load <Texture2D>("LevelSelection\\duckhuntpong");

            m_pong.Texture  = m_pong_lvl;
            m_duckh.Texture = m_duck_hunt_lvl;

            m_grid              = new GridMenu(HelperUtils.SafeBoundary.X + 66, HelperUtils.SafeBoundary.Y + 40, 4, m_pln_txt, m_soundBank);
            m_grid.Spacing      = 30;
            m_grid.SelectedTint = Color.Blue;
            m_grid.AddItem(m_pong, new Selected(PongSelected), "pong");
            m_grid.AddItem(m_duckh, new Selected(DuckHuntSelected), "duckhunt");
        }
        /// <summary>
        /// Loads graphics content for this screen. This uses the shared ContentManager
        /// provided by the Game class, so the content will remain loaded forever.
        /// Whenever a subsequent MessageBoxScreen tries to load this same content,
        /// it will just get back another reference to the already loaded data.
        /// </summary>
        public override void LoadContent()
        {
            ContentManager content = new ContentManager(ScreenManager.Game.Services, "Content");

            m_pln_txt = new Texture2D(ScreenManager.GraphicsDevice, 1, 1);
            m_pln_txt.SetData(new Color[] { Color.White });

            m_pong_lvl = content.Load<Texture2D>("LevelSelection\\pong");
            m_duck_hunt_lvl = content.Load<Texture2D>("LevelSelection\\duckhuntpong");

            m_pong.Texture = m_pong_lvl;
            m_duckh.Texture = m_duck_hunt_lvl;

            m_grid = new GridMenu(HelperUtils.SafeBoundary.X + 66, HelperUtils.SafeBoundary.Y + 40, 4, m_pln_txt, m_soundBank);
            m_grid.Spacing = 30;
            m_grid.SelectedTint = Color.Blue;
            m_grid.AddItem(m_pong, new Selected(PongSelected), "pong");
            m_grid.AddItem(m_duckh, new Selected(DuckHuntSelected), "duckhunt");
        }