SadConsoleEditor.Editors.SceneEditor.LoadZone C# (CSharp) Method

LoadZone() public method

public LoadZone ( Zone zone ) : bool
zone SadConsole.Game.Zone
return bool
        public bool LoadZone(Zone zone)
        {
            var gameObject = new GameObject(Settings.Config.ScreenFont);
            var animation = new AnimatedTextSurface("default", 10, 10);
            var frame = animation.CreateFrame();
            frame.DefaultBackground = zone.DebugAppearance.Background;

            gameObject.Name = zone.Title;

            Settings.QuickEditor.TextSurface = frame;
            Settings.QuickEditor.Clear();
            Settings.QuickEditor.Print(0, 0, zone.Title, Color.DarkGray);

            gameObject.Animation = animation;
            gameObject.Position = new Point(zone.Area.Left, zone.Area.Top);
            gameObject.Update();

            var resizable = new ResizableObject<Zone>(ResizableObject.ObjectType.Zone, gameObject, zone);
            resizable.RenderOffset = consoleWrapper.Position - consoleWrapper.TextSurface.RenderArea.Location;
            Zones.Add(resizable);

            ZonesPanel.RebuildListBox();

            return true;
        }