示例#1
0
文件: Ogmo.cs 项目: tlzyh/Ogmo-Editor
        static private void Initialize()
        {
            //Figure out the program directory
            ProgramDirectory = Application.ExecutablePath.Remove(Application.ExecutablePath.IndexOf(Path.GetFileName(Application.ExecutablePath)));

            //Initialize global pens/brushes/bitmaps
            DrawUtil.Initialize();

            //Make sure the recent project list is valid
            InitRecentProjects();

            //The levels holder
            Levels            = new List <Level>();
            CurrentLevelIndex = -1;

            //The windows
            MainWindow            = new MainWindow();
            MainWindow.Shown     += new EventHandler(MainWindow_Shown);
            LayersWindow          = new LayersWindow();
            ToolsWindow           = new ToolsWindow();
            TilePaletteWindow     = new TilePaletteWindow();
            EntitiesWindow        = new EntitiesWindow();
            EntitySelectionWindow = new EntitySelectionWindow();

            LayersWindow.Show(MainWindow);
            ToolsWindow.Show(MainWindow);
            TilePaletteWindow.Show(MainWindow);
            EntitiesWindow.Show(MainWindow);
            EntitySelectionWindow.Show(MainWindow);
            LayersWindow.EditorVisible = ToolsWindow.EditorVisible = TilePaletteWindow.EditorVisible = EntitiesWindow.EditorVisible = EntitySelectionWindow.EditorVisible = false;

            //Add the exit event
            Application.ApplicationExit += onApplicationExit;
        }
示例#2
0
        public EditTileMapState(TilePaletteWindow tilePalette, InputSystem inputSystem, Renderer renderer)
        {
            _tilePalette = tilePalette;
            _inputSystem = inputSystem;
            _renderer    = renderer;

            _renderer.Add(this);
        }