Exemple #1
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            screenManager = new ScreenManager(Content, GraphicsDevice, Window);
            screenManager.Initialize();

            // Add screen
            screenManager.AddScreen(new LoginScreen(), null);

            //HACK: Defintely don't want this here forever
            Entity._counter = ulong.MaxValue - 10000;

            base.Initialize();
        }
        public void TryToMakeContext()
        {
            // Create our state manager and let's get started
            if (_screenManager == null)
            {
                _screenManager = new ScreenManager(null, GraphicsDevice, null);

                screen = new MapEditScreen(_gameMap);
                _screenManager.AddScreen(screen, null);
                screen.LoadContent();

                screen.Camera2D = new Camera2D(new Vector2(Width, Height), _gameMap.Layers[0].Width, _gameMap.Layers[1].Height, 1f);

                Resize += MapRenderControl_Resize;

                _sb = new SpriteBatch(GraphicsDevice);

            }

            // Since there was a context swap, do it up
            MapEditorGlobals.CurrentActiveTexture = screen._renderer._tilesetTexture;
            //CurrentActiveTexture
        }