Esempio n. 1
0
        public bool LoadScene()
        {
            if (!ContentLoader.Exists(UIName, ContentType.Scene))
            {
                return(true);                //ncrunch: no coverage
            }
            editorService.Viewport.DestroyRenderedEntities();
            Messenger.Default.Send("ClearScene", "ClearScene");
            var scene = new Scene();

            Scene = new Scene();
            try
            {
                scene = ContentLoader.Load <Scene>(UIName);
                foreach (var control in scene.Controls)
                {
                    ActivateControl((Control)control);
                }
            }
            catch
            {
                foreach (var control in EntitiesRunner.Current.GetEntitiesOfType <Control>())
                {
                    ActivateControl((Control)control);
                }
            }
            UISceneGrid.DrawGrid();
            uiSceneGrid.UpdateGridOutline(SceneResolution);
            controlTransformer = new ControlTransformer(editorService);
            return(false);
        }
Esempio n. 2
0
 public void CreateNewGrid()
 {
     uiSceneGrid.CreateGritdOutline();
     uiSceneGrid.UpdateGridOutline(SceneResolution);
     UISceneGrid.DrawGrid();
     foreach (var line in UISceneGrid.LinesInGridList)
     {
         line.RenderLayer = 1;
     }
 }
Esempio n. 3
0
        public void ChangeGrid(string grid)
        {
            SelectedResolution = grid;
            var newGridWidthAndHeight = grid.Trim(new[] { ' ' });
            var gridwidthAndHeight    = newGridWidthAndHeight.Split((new[] { '{', ',', '}', 'x' }));
            int width;

            int.TryParse(gridwidthAndHeight[0], out width);
            int height;

            int.TryParse(gridwidthAndHeight[1], out height);
            if (width <= 0 || height <= 0)
            {
                return;
            }
            SetGridWidthAndHeight(width, height);
            UISceneGrid.DrawGrid();
        }