예제 #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);

            Util.UI.Elements.Button.ButtonFont     = ContentManager.Load <SpriteFont>("Arial");
            Util.UI.Elements.TextView.TextViewFont = ContentManager.Load <SpriteFont>("ArialSmall");

            PrimitiveDrawer       = new Primitive(Graphics.GraphicsDevice, spriteBatch);
            PrimitiveDrawer.Depth = 1.0f;

            Hud = new Hud();

            Camera.LoadContent();
            Hud.LoadContent();

            MovingEntityRenderer.LoadContent();
            GameRenderer.LoadContent();

            Player.Init();
            Player.ConnectToWorld();

            LivingEntityType.Create(new WorldPosition(WorldGrid.BlockSize.X * 3, WorldGrid.BlockSize.Y * 3, Interior.Outside), LivingEntityType.lookup[3]).ConnectToWorld();

            AppDomain.CurrentDomain.ProcessExit += new EventHandler((object sender, EventArgs e) =>
            {
                SaveAndExit();
            });
        }
예제 #2
0
        public void LoadContent(Game game)
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            Renderer.CreateSpriteBatch(game);

            Global.init(game, game.Content, game.Services);
            Renderer.LoadContent(game.Content);

            InitializeTextGlow();
        }