DrawText() private method

private DrawText ( float x, float y, float scale, Vector4 color, string text, float adjust, int limit, int style, int cursor ) : int
x float
y float
scale float
color Vector4
text string
adjust float
limit int
style int
cursor int
return int
示例#1
0
        public void Draw(float x, float y)
        {
            if (_visible == false)
            {
                return;
            }

            CalculateClientRectangle(0, 0);

            _context.FontFamily = _fontFamily;

            _drawRect.Offset(x, y);
            _clientRect.Offset(x, y);
            _textRect.Offset(x, y);

            SetupTransforms(x, y);

            if ((_flags & WindowFlags.NoClip) == WindowFlags.NoClip)
            {
                _context.ClippingEnabled = false;
            }

            DrawBackground(_drawRect);
            DrawBorderAndCaption(_drawRect);

            if (_textShadow > 0)
            {
                string shadowText = idHelper.RemoveColors(_text);

                idRectangle shadowRect = _textRect;
                shadowRect.X += _textShadow;
                shadowRect.Y += _textShadow;

                _context.DrawText(shadowText, _textScale, _textAlign, idColor.Black, shadowRect, (_flags & WindowFlags.NoWrap) == 0, -1);
            }

            _context.DrawText(_text, _textScale, _textAlign, _foreColor, _textRect, (_flags & WindowFlags.NoWrap) == 0, -1);
            _context.SetTransformInformation(Vector3.Zero, Matrix.Identity);

            if ((_flags & WindowFlags.NoClip) == WindowFlags.NoClip)
            {
                _context.ClippingEnabled = true;
            }

            _drawRect.Offset(-x, -y);
            _clientRect.Offset(-x, -y);
            _textRect.Offset(-x, -y);
        }