public void SetLayeredSurface(LayeredSurface surface) { this.surface = surface; // Do updates RebuildListBox(); }
public void Resize(int width, int height) { int renderWidth = Math.Min(MainScreen.Instance.InnerEmptyBounds.Width, width); int renderHeight = Math.Min(MainScreen.Instance.InnerEmptyBounds.Height, height); var oldSurface = surface; var newSurface = new LayeredSurface(width, height, Settings.Config.ScreenFont, new Rectangle(0, 0, renderWidth, renderHeight), oldSurface.LayerCount); hotspotSurface = new BasicSurface(renderWidth, renderHeight, Settings.Config.ScreenFont); for (int i = 0; i < oldSurface.LayerCount; i++) { var oldLayer = oldSurface.GetLayer(i); var newLayer = newSurface.GetLayer(i); oldSurface.SetActiveLayer(i); newSurface.SetActiveLayer(i); oldSurface.Copy(newSurface); newLayer.Metadata = oldLayer.Metadata; newLayer.IsVisible = oldLayer.IsVisible; } surface = newSurface; layerManagementPanel.SetLayeredSurface(surface); toolsPanel.SelectedTool = toolsPanel.SelectedTool; if (MainScreen.Instance.ActiveEditor == this) { MainScreen.Instance.RefreshBorder(); } }
/// <summary> /// Creates a new Scene from an existing <see cref="LayeredSurface"/>. /// </summary> /// <param name="surface">The surface for the scene.</param> public Scene(LayeredSurface surface) { baseConsole = new Console(surface); backgroundSurface = surface; Objects = new List <GameObject>(); Zones = new List <Zone>(); Hotspots = new List <Hotspot>(); }