Exemplo n.º 1
0
        protected internal override void Draw(GuiRender render)
        {
            var colorGroup = Contain(Gui.Position) ? Style.Cover : Style.Color;
            var position   = new Point2f(
                (Size.Width - mTextBuffer.Size.Width) * 0.5f,
                (Size.Height - mTextBuffer.Size.Height) * 0.5f);

            render.FillRectangle(
                new Rectanglef(0, 0, Size.Width, Size.Height),
                colorGroup.Background);
            render.DrawText(position, mTextBuffer, colorGroup.Text);
        }
Exemplo n.º 2
0
        protected internal override void Draw(GuiRender render)
        {
            var padding        = 2.0f;
            var cursorHeight   = FontSize * 0.9f;
            var textPosition   = new Point2f(padding * 2, Utility.Center(Size.Height, mTextBuffer.Size.Height));
            var cursorPosition = new Point2f(textPosition.X + (
                                                 Cursor == 0 ? 0 : mTextBuffer.GetCharacterPostLocation(Cursor - 1)), Utility.Center(Size.Height, cursorHeight));
            var area = new Rectanglef(0, 0, Size.Width, Size.Height);

            render.FillRectangle(area, Style.Background);
            render.DrawRectangle(area, Style.Padding, padding);
            render.DrawText(textPosition, mTextBuffer, Style.Text);

            if (mPassTime < HalfDuration || Gui.GlobalElementStatus.FocusElement != this)
            {
                return;
            }

            render.DrawLine(cursorPosition, cursorPosition + new Vector2f(0, cursorHeight), Style.Cursor, padding);
        }
Exemplo n.º 3
0
 protected internal override void Draw(GuiRender render)
 {
     render.DrawText(new Point2f(0, 0), mTextBuffer, Color);
 }