Beispiel #1
0
        public void Update(float deltaTime)
        {
            ScreenWidth  = (uint)G.Window.Size.Width;
            ScreenHeight = (uint)G.Window.Size.Height;

            if (IsTakingInput)
            {
                var promptTextWidth = StatusText.Length * Granularity;
                var inputTextWidth  = InputText.Length * Granularity;

                InputCursor.SetPixelBasedPosition(
                    promptTextWidth + inputTextWidth,
                    (int)(ScreenHeight - ActualHeight)
                    );
            }

            InputCursor.Update(deltaTime);
        }
Beispiel #2
0
        public void Draw(RenderContext context)
        {
            var targetTextPosition = new Vector2(0, ScreenHeight - ActualHeight);

            context.Rectangle(
                ShapeMode.Fill,
                new Vector2(
                    0,
                    ScreenHeight - ActualHeight - 2
                    ),
                ScreenWidth,
                ActualHeight + 2,
                EditorColors.ModeLineBackground
                );

            var str = StatusText;

            if (IsTakingInput)
            {
                str = StatusText + InputText;
            }

            context.DrawString(
                _font,
                str,
                targetTextPosition,
                (c, i, p, g) => new GlyphTransformData(p)
            {
                Color = EditorColors.ModeLineForeground
            }
                );


            if (IsTakingInput)
            {
                InputCursor.Draw(context);
            }
        }