/// <summary> /// Creates a new theme used by the <see cref="TextBox"/>. /// </summary> public TextBoxTheme() { CaretEffect = new Effects.BlinkGlyph() { GlyphIndex = 95, BlinkSpeed = 0.4f }; }
/// <summary> /// Prints text on the console. /// </summary> /// <param name="text">The text to print.</param> /// <param name="template">The way the text will look when it is printed.</param> /// <param name="templateEffect">Effect to apply to the text as its printed.</param> /// <returns>Returns this cursor object.</returns> public Cursor Print(string text, Cell template, Effects.ICellEffect templateEffect) { ColoredString coloredString; if (UseStringParser) { coloredString = ColoredString.Parse(text, position.Y * editor.TextSurface.Width + position.X, editor.TextSurface, editor, new StringParser.ParseCommandStacks()); } else { coloredString = text.CreateColored(template.Foreground, template.Background, template.Mirror); coloredString.SetEffect(templateEffect); } return(Print(coloredString)); }
/// <summary> /// Changes the effect of a list of cells to the specified effect. /// </summary> /// <param name="cells">The cells for the effect.</param> /// <param name="effect">The desired effect.</param> public void SetEffect(IEnumerable <Cell> cells, Effects.ICellEffect effect) { Effects.SetEffect(cells, effect); textSurface.IsDirty = true; }
/// <summary> /// Changes the effect of a cell to the specified effect. /// </summary> /// <param name="x">The x location of the cell.</param> /// <param name="y">The y location of the cell.</param> /// <param name="effect">The desired effect.</param> public void SetEffect(int x, int y, Effects.ICellEffect effect) { Effects.SetEffect(textSurface[y * textSurface.Width + x], effect); textSurface.IsDirty = true; }
/// <summary> /// Changes the effect of a list of cells to the specified effect. /// </summary> /// <param name="cells">The cells for the effect.</param> /// <param name="effect">The desired effect.</param> public void SetEffect(IEnumerable <Cell> cells, Effects.ICellEffect effect) { Effects.SetEffect(cells, effect); }