Пример #1
0
        public void DrawChars(IEnumerable <char> chars, float width, float height, TextFormatting format, TextDialog dialog, Matrix transform, TextCursorPosition cursorPos)
        {
            float offset = 0;

            var skew = new Matrix(
                1, 0, 0, 0,
                format.Italic ? -4f / 16 : 0, 1, 0, 0,
                0, 0, 1, 0,
                0, 0, 0, 1
                );
            var skewCenter = Matrix.CreateTranslation(-width / 2, -height / 2, 0) * skew * Matrix.CreateTranslation(width / 2, height / 2, 0);

            Scene.PushSpriteBatch(transform: skewCenter * transform);

            DrawAreaDebug(Vector2.Zero, new Vector2(width, height));
            foreach (var chr in chars)
            {
                var par = format.GetParams(cursorPos + new Vector2(offset, 0));
                DrawChar(chr, new Vector2(offset, 0), format, dialog.Transform(par, cursorPos + new Vector2(offset, 0)));
                cursorPos.AddCharacters(1);
                offset += format.GetCharWidth(chr) + 1;
            }
            Scene.PopSpriteBatch();
        }
Пример #2
0
 public void IncrementPosition(ref TextCursorPosition cursorPos)
 {
     cursorPos.AddCharacters(1);
     cursorPos.IncrementElement();
 }
Пример #3
0
 public void IncrementPosition(ref TextCursorPosition cursorPos)
 {
     cursorPos.AddCharacters(BackgroundText.Length);
     cursorPos.IncrementElement();
 }