コード例 #1
0
        public static List<UiObject> ParseUI(string config, ContentManager paramContent, Game1 parReference, SpriteFont paramfont)
        {
            font = paramfont;
            Content = paramContent;
            List<UiObject> userInterface = new List<UiObject>();

            btnNormal = Content.Load<Texture2D>("buttonNormal");
            btnHover = Content.Load<Texture2D>("buttonHover");
            btnActive = Content.Load<Texture2D>("buttonActive");

            fs = new FileStream(config, FileMode.Open);
            sr = new StreamReader(fs);

            reference = parReference;

            // foreach menu
            while (sr.ReadLine() == "menu start")
            {
                userInterface.Add(ParseMenu());
            }

            if (sr.ReadLine() != "end")
            {
                // somethings wrong
            }

            sr.Close();
            fs.Close();

            return userInterface;
        }
コード例 #2
0
 /// <summary>
 /// The main entry point for the application.
 /// </summary>
 static void Main(string[] args)
 {
     using (Game1 game = new Game1())
     {
         game.Run();
     }
 }