Example #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Game1"/> class.
        /// </summary>
        public Game1() : base(new Point(1024, 768), new Point(1024, 768))
        {

            // Load
            UseVerticalSync = true;
            ShowMouseCursor = true;

            _skinManager = new SkinManager("Default");
            _screenManager = new ScreenManager(this, _skinManager, "Font/Arial", 14);
            GrhInfo.Load(ContentPaths.Build, _screenManager.Content);

            var ts = new TestScreen(_screenManager);
            _screenManager.ActiveScreen = ts;

            Closed += Game1_Closed;

            KeyPressed += Game1_KeyPressed;

            // Shove GUI elements into a texture atlas so we can test them with atlasing
            var guiGrhs = GrhInfo.GrhDatas.SelectMany(x => x.Frames).Distinct()
                .Where(x => x.Categorization.Category.ToString().StartsWith("gui", StringComparison.OrdinalIgnoreCase));

            _guiTextureAtlas = new TextureAtlas(guiGrhs);

            Run();
        }
Example #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Game1"/> class.
        /// </summary>
        public Game1() : base(new Point(1024, 768), new Point(1024, 768))
        {
            UseVerticalSync = true;
            ShowMouseCursor = true;

            _skinManager = new SkinManager("Default");
            _screenManager = new ScreenManager(this, _skinManager, "Font/Arial", 14);
            GrhInfo.Load(ContentPaths.Build, _screenManager.Content);

            var ts = new TestScreen(_screenManager);
            _screenManager.ActiveScreen = ts;

            Closed += Game1_Closed;

            KeyPressed += Game1_KeyPressed;

            Run();
        }
Example #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Game1"/> class.
        /// </summary>
        public Game1() : base(new Point(1024, 768), new Point(1024, 768))
        {
            UseVerticalSync = true;
            ShowMouseCursor = true;

            _skinManager   = new SkinManager("Default");
            _screenManager = new ScreenManager(this, _skinManager, "Font/Arial", 14);
            GrhInfo.Load(ContentPaths.Build, _screenManager.Content);

            var ts = new TestScreen(_screenManager);

            _screenManager.ActiveScreen = ts;

            Closed += Game1_Closed;

            KeyPressed += Game1_KeyPressed;

            Run();
        }