示例#1
0
        /// <summary>
        /// Loads content required by the screen, and initializes the displayed menu.
        /// </summary>
        public override void LoadContent()
        {
            safeArea = ScreenManager.SafeArea;
            // Create our menu entries.
            MenuEntry themeGameMenuEntry = new MenuEntry("Deck");
            MenuEntry returnMenuEntry = new MenuEntry("Return");

            // Hook up menu event handlers.
            themeGameMenuEntry.Selected += ThemeGameMenuEntrySelected;
            returnMenuEntry.Selected += OnCancel;

            // Add entries to the menu.
            MenuEntries.Add(themeGameMenuEntry);
            MenuEntries.Add(returnMenuEntry);

            themes.Add("Red", ScreenManager.Game.Content.Load<Texture2D>(
                @"Images\Cards\CardBack_Red"));
            themes.Add("Blue", ScreenManager.Game.Content.Load<Texture2D>(
                @"Images\Cards\CardBack_Blue"));
            background = ScreenManager.Game.Content.Load<Texture2D>(
                @"Images\UI\table");

            card = new AnimatedGameComponent(ScreenManager.Game,
                themes[MainMenuScreen.Theme])
            {
                CurrentPosition = new Vector2(safeArea.Center().X, safeArea.Center().Y - 50)
            };

            ScreenManager.Game.Components.Add(card);

            base.LoadContent();
        }