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); }
public void CreateNewGrid() { uiSceneGrid.CreateGritdOutline(); uiSceneGrid.UpdateGridOutline(SceneResolution); UISceneGrid.DrawGrid(); foreach (var line in UISceneGrid.LinesInGridList) { line.RenderLayer = 1; } }
private void InitializeClasses() { ScreenSpace.Scene = new SceneScreenSpace(editorService.Viewport.Window, SceneResolution); ControlProcessor = new ControlProcessor(); controlAdder = new ControlAdder(); controlChanger = new ControlChanger(); uiControl = new UIControl(); controlTransformer = new ControlTransformer(editorService); controlAllignmentAndMargins = new ControlAllignmentAndMargins(this); controlMaterialChanger = new ControlMaterialChanger(this); uiSceneGrid = new UISceneGrid(this); }
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(); }