Exemple #1
0
        public void Draw(ITextContainer parent, Matrix baseTransform, FontRenderer renderer, TextCursorPosition cursorPos)
        {
            renderer.DrawChars(BackgroundText, Width, Height, FormatBack, Dialog, Position.Transform * baseTransform, cursorPos);
            var offset = GetBackgroundWidth() - GetForegroundWidth();

            renderer.DrawChars(ForegroundText, Width, Height, FormatFront, Dialog, Matrix.CreateTranslation(offset, 0, 0) * Position.Transform * baseTransform, cursorPos);
        }
Exemple #2
0
        public void Draw(ITextContainer parent, Matrix baseTransform, FontRenderer renderer, TextCursorPosition cursorPos)
        {
            float offsetX = (Width - GetWidth()) * 1f;

            switch (Alignment)
            {
            case (LineAlignment.Left):
                offsetX = 0;
                break;

            case (LineAlignment.Center):
                offsetX *= 0.5f;
                break;

            case (LineAlignment.Right):
                break;
            }

            renderer.DrawChars(Text, Width, Height, Format, Dialog, Position.Transform * baseTransform * Matrix.CreateTranslation(offsetX, 0, 0), cursorPos);
        }
 public void Draw(ITextContainer parent, Matrix baseTransform, FontRenderer renderer, TextCursorPosition cursorPos)
 {
     renderer.DrawChars(Text, Width, Height, Format, Dialog, Position.Transform * baseTransform, cursorPos);
 }