private void LoadAnsi() { _textSurface.Clear(); SadConsole.Ansi.Document doc = new SadConsole.Ansi.Document($"./ansi/{files[fileIndex]}"); SadConsole.Ansi.AnsiWriter writer = new SadConsole.Ansi.AnsiWriter(doc, this); writer.ReadEntireDocument(); Data = new TextSurface(80, 25 + _textSurface.TimesShiftedUp); writer = new SadConsole.Ansi.AnsiWriter(doc, this); writer.ReadEntireDocument(); }
private void LoadAnsi() { Clear(); writer = new SadConsole.Ansi.AnsiWriter(doc, this); writer.ReadEntireDocument(); TextSurface = new BasicSurface(80, 25 + TimesShiftedUp); writer = new SadConsole.Ansi.AnsiWriter(doc, this); writer.ReadEntireDocument(); textSurface.RenderArea = new Rectangle(0, 0, 80, 25); writer = null; }
private void LoadAnsi() { Clear(); ansiSurface = new ScrollingConsole(80, 25); writer = new SadConsole.Ansi.AnsiWriter(doc, ansiSurface); writer.ReadEntireDocument(); Resize(80, ansiSurface.Height + ansiSurface.TimesShiftedUp, true); ViewPort = new Rectangle(0, 0, 80, 25); writer = new SadConsole.Ansi.AnsiWriter(doc, this); writer.ReadEntireDocument(); writer = null; }
public StartScreen(int screenWidth, int screenHeight) { _screenWidth = screenWidth; _screenHeight = screenHeight; _currentPoints = Data.Entities.GetChargenPoints(); UseMouse = true; var bgTxt = new CellSurface(80, 60); var ansiTitle = new SadConsole.Ansi.AnsiWriter(FileLoader.TitleScreen, bgTxt); ansiTitle.ReadEntireDocument(); ansiTitle.Process(0); SetupViews(screenWidth, screenHeight, bgTxt); SetupTraitCheckBoxes(); RegisterEvents(); }
private void LoadAnsi() { this.Clear(); ansiSurface = new Console(80, 25); writer = new SadConsole.Ansi.AnsiWriter(doc, ansiSurface); writer.ReadEntireDocument(); // TODO: Why did I need to add + 2? Wierd. Something broken with ansi :( :( :( this.Resize(80, 23, 80, ansiSurface.Height + ansiSurface.TimesShiftedUp + 2, true); this.View = new Rectangle(0, 0, 80, 25); writer = new SadConsole.Ansi.AnsiWriter(doc, this); writer.ReadEntireDocument(); writer = null; }
private void Form1_Paint(object sender, PaintEventArgs e) { System.Drawing.Graphics graphics = e.Graphics; SadConsole.FontMaster.LoadFont("IBM.font"); // Sets default font if not set var textSurface = new SadConsole.Consoles.TextSurface(80, 24); var console = new SadConsole.Consoles.SurfaceEditor(textSurface); var renderer = new SadConsole.Consoles.TextSurfaceRenderer(); var doc = new SadConsole.Ansi.Document("QS-SIERR.ANS"); var writer = new SadConsole.Ansi.AnsiWriter(doc, console); writer.ReadEntireDocument(); // Get times scrolled if (console.TimesShiftedUp != 0) { textSurface.Dispose(); console.TextSurface = textSurface = new SadConsole.Consoles.TextSurface(80, 24 + console.TimesShiftedUp); console.ClearShiftValues(); writer = new SadConsole.Ansi.AnsiWriter(doc, console); writer.ReadEntireDocument(); } // Create graphics image //Bitmap outputImage = new Bitmap(console.TextSurface.Width * SadConsole.FontMaster.DefaultFont.Size.X, // console.TextSurface.Height * SadConsole.FontMaster.DefaultFont.Size.Y); //Graphics graphics = Graphics.FromImage(outputImage); graphics.Clear(Color.Black); // Draw ansi surface to image renderer.RenderTarget = graphics; renderer.Render((SadConsole.Consoles.TextSurface)console.TextSurface, new Point(0, 0), false); // Save image //outputImage.Save("ansi.png", ImageFormat.Png); // Clean up //graphics.Dispose(); //outputImage.Dispose(); textSurface.Dispose(); }
private void LoadAnsi() { Clear(); writer = new SadConsole.Ansi.AnsiWriter(doc, this); writer.ReadEntireDocument(); TextSurface = new TextSurface(80, 25 + TimesShiftedUp); writer = new SadConsole.Ansi.AnsiWriter(doc, this); writer.ReadEntireDocument(); textSurface.RenderArea = new Rectangle(0, 0, 80, 25); writer = null; }