A plain text element for a menu.
Exemple #1
0
        public void LoadContent(ContentManager Content)
        {
            if (mapNames.Count > 0)
            {
                foreach (mapSet ms in mapSets)
                    ms.unselect();
                this.mapSets[selected].select();
                return;
            }

            selectedOverlay = Content.Load<Texture2D>("MenuData/mapcursor");
            menuOverlay = Content.Load<Texture2D>("MenuData/mapselect");

            //Gets a list of all the .map files in our mapdata folder, Platform specific paths
            #if WINDOWS
            maps = Directory.EnumerateFiles(Environment.CurrentDirectory + "\\Content\\MapData", "*.map");
            #elif LINUX
            maps = Directory.EnumerateFiles(Environment.CurrentDirectory + "/Content/MapData", "*.map");
            #endif

            //For each map file, slice off the path to store just the map's name.
            foreach (string path in maps)
            {
                string mapName = path.Remove(0, Environment.CurrentDirectory.Length + "\\Content\\MapData\\".Length);
                mapName = mapName.Replace(".map", "");
                string mapGroup = mapName.Split('_')[0];
                if (!mapNames.ContainsKey(mapGroup))
                {
                    mapNames.Add(mapGroup, new mapSet(mapGroup));
                    mapNames[mapGroup].setBackground(Content.Load<Texture2D>("MapData/" + mapGroup + "_background"));
                    mapNames[mapGroup].setColumn(mapSets.Count);
                    mapSets.Add(mapNames[mapGroup]);
                }
                mapSet group;
                mapNames.TryGetValue(mapGroup, out group);
                group.addMap(mapName);

                //Texture2D mapImage = Content.Load<Texture2D>("MapData/"+mapName + "Color");
                //mapImages.Add(mapImage);

            }

            //Get thumbnails
            foreach(mapSet set in mapSets)
            {
                set.getRandomThumbs(Content);
            }

            //positionThumbs(mapThumbs);

            Vector2 pos = new Vector2(screenSize.X / 2, 50);
            title = new Label(titleString, Content.Load<SpriteFont>("miramo"), pos, new Vector2(0.5f, 0));
            pos.Y += 50;

            mapSets[0].select();
        }
Exemple #2
0
        public void LoadContent(ContentManager Content)
        {
            if (buttons.Count > 0)
                return;

            Vector2 pos = new Vector2(screenSize.X / 2, 50);
            title = new Label(titleString, Content.Load<SpriteFont>("miramo"), pos, new Vector2(0.5f, 0));
            pos.Y += 50;
            foreach (String s in optionsStrings)
            {
                pos.Y += 50;
                buttons.Add(new TextButton(s, Content.Load<SpriteFont>("miramo"), pos, Content.Load<Texture2D>("buttonUp"),
                    Content.Load<Texture2D>("buttonDown"), new Vector2(0.5f, 0)));
            }

            buttons[0].Select();
        }