Example #1
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            AudioManager.SoundEffects =
                ContentLoader.ContentLoad <SoundEffect>(Content, "Audio");

            foreach (KeyValuePair <string, SoundEffect> entry in AudioManager.SoundEffects)
            {
                soundNames.Add(entry.Key);
            }
            font = Content.Load <SpriteFont>("font");

            item1 = new MenuItem(Content.Load <Texture2D>("image1"),
                                 soundNames[1],
                                 new Rectangle(10, 10, 100, 50));
            // TODO: use this.Content to load your game content here
        }
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);
            images      = ContentLoader.ContentLoad <Texture2D>(Content, "Characters");
            names       = new string[images.Count];

            int i = 0;

            foreach (var item in images)
            {
                names[i++] = item.Key;
            }
            string choice = names[rgen.Next(0, names.Length)];

            current = images[choice];
            //images.TryGetValue(choice, out current);

            // TODO: use this.Content to load your game content here
        }