Esempio n. 1
0
        protected override void LoadContent()
        {
            _s = new SpriteBatch(GraphicsDevice);

            Global.Game = this;

            Settings settings = Utility.LoadJson <Settings>("Settings.json");

            _graphics.PreferredBackBufferWidth  = settings.Width;
            _graphics.PreferredBackBufferHeight = settings.Height;
            IsFixedTimeStep = settings.IsFixedTimeStep;
            _graphics.SynchronizeWithVerticalRetrace = settings.IsVSync;
            _graphics.ApplyChanges();

            _historyHandler = new HistoryHandler(null);

            _quadtree         = new Quadtree <Entity>();
            _selectedEntities = new Quadtree <Entity>();
            Camera.Setup();
            _selection = new RectEdit();
            _edit      = new RectEdit();

            Assets.LoadFonts(Content, GraphicsDevice);
            Assets.Setup(Content);

            InputHelper.Setup(this);
        }
Esempio n. 2
0
        public Editor(World world, GraphicsDevice graphicsDevice)
        {
            _world    = world;
            _aabbTree = _world.AABBTree;
            _entities = _world.Entities;

            _historyHandler   = new HistoryHandler(null);
            _selectedEntities = new AABBTree <Entity>();

            _selection = new RectEdit();
            _edit      = new RectEdit();

            _ui = new IMGUI();

            _pathEditor = new PathEditor(_world.Woods);

            WindowResize(graphicsDevice.Viewport.Width, graphicsDevice.Viewport.Height);
        }