/// <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);

            SpriteFont spriteFont = Content.Load<SpriteFont>("TerminalFont");
            TerminalSkin skin = new TerminalSkin(TerminalThemeType.HALLOWEEN_TWO);

            Terminal.Init(this, spriteBatch, spriteFont, GraphicsDevice);
            Terminal.SetSkin(skin);

            Components.Add(ScreenManager);

            //Watch out "trickey" assignment
            Top = CollideDemo.BoxOnBox();
        }
Пример #2
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);

            // TODO: use this.Content to load your game content here
            StarterMap = new Map(@"TestMap2_City_XML.tmx", GraphicsDevice);
            Point a = StarterMap.camera.GetOffsetFromOrigin(Units.Tile, Coordinates.World);
            Point b = StarterMap.camera.GetOffsetFromOrigin(Units.Pixel, Coordinates.World);
            Point c = StarterMap.camera.GetOffsetFromOrigin(Units.Tile, Coordinates.Screen);
            Point d = StarterMap.camera.GetOffsetFromOrigin(Units.Pixel, Coordinates.Screen);
            Stream textureStream = new FileStream(@"Brendan_Walking.png", FileMode.Open, FileAccess.Read, FileShare.Read);
            Texture2D texture = Texture2D.FromStream(GraphicsDevice, textureStream);
            Player.Load(texture, spriteBatch, @"Brendan_Walking.xml");
            Player.Visible = true;
            Player.Enabled = true;
            Player.FrameDuration = 115;

            //d = new World();
            //d.EnabledChanged += new EventHandler<EventArgs>(d_EnabledChanged);

            spriteFont = Content.Load<SpriteFont>("SpriteFont1");

            Terminal.Init(this, spriteBatch, spriteFont, GraphicsDevice);
            TerminalSkin ts = new TerminalSkin(TerminalThemeType.WHITE_ON_BLACK_GRADIENT, TerminalThemeSHType.WHITE_ON_BLACK_GRADIENT);
            Terminal.SetSkin(ts);
        }