Example #1
0
        public Game1()
        {
            XnaUtility.UtilityMethods.CurrentGame = this;

            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";

            atlasHandler = new AtlasHandler(this, "MASTER GAIDEN SHEET", "MASTER GAIDEN SHEET DICT");
            Components.Add(atlasHandler);
            Services.AddService(typeof(AtlasHandler), atlasHandler);
            Services.AddService(typeof(Random), random);
            watch = new XnaWatch(this, Color.White);
            Components.Add(watch);
            Services.AddService(typeof(XnaWatch), watch);
            graphics.PreferredBackBufferHeight = 750;
            graphics.PreferredBackBufferWidth  = 900;
            this.IsMouseVisible = true;
            graphics.ApplyChanges();
            Width  = graphics.PreferredBackBufferWidth;
            Height = graphics.PreferredBackBufferHeight;
        }
Example #2
0
 /// <summary>
 /// Allows the game component to perform any initialization it needs to before starting
 /// to run.  This is where it can query for any required services and load content.
 /// </summary>
 public override void Initialize()
 {
     atlasHandler = (AtlasHandler)Game.Services.GetService(typeof(AtlasHandler));
     spriteBatch  = (SpriteBatch)Game.Services.GetService(typeof(SpriteBatch));
     base.Initialize();
 }