Ejemplo n.º 1
0
        /// <summary>
        /// Called when the renderer renders the text view.
        /// </summary>
        /// <param name="batch">The batch used in renderering.</param>
        protected virtual void OnAfterRender(SpriteBatch batch)
        {
            if (VirtualCursor.IsVisible)
            {
                int virtualCursorLocationIndex = Consoles.TextSurface.GetIndexFromPoint(
                    new Point(VirtualCursor.Position.X - TextSurface.RenderArea.Left,
                              VirtualCursor.Position.Y - TextSurface.RenderArea.Top), TextSurface.RenderArea.Width);

                if (virtualCursorLocationIndex >= 0 && virtualCursorLocationIndex < textSurface.RenderRects.Length)
                {
                    VirtualCursor.Render(batch, textSurface.Font, textSurface.RenderRects[virtualCursorLocationIndex]);
                }
            }
        }
Ejemplo n.º 2
0
        protected override void OnAfterRender()
        {
            if (VirtualCursor.IsVisible)
            {
                int virtualCursorLocationIndex = CellSurface.GetIndexFromPoint(new Point(VirtualCursor.Position.X - ViewArea.Location.X, VirtualCursor.Position.Y - ViewArea.Location.Y), ViewArea.Width);

                if (virtualCursorLocationIndex >= 0 && virtualCursorLocationIndex < _renderAreaRects.Length)
                {
                    VirtualCursor.Render(Batch, Font, _renderAreaRects[virtualCursorLocationIndex]);
                }
            }

            base.OnAfterRender();
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Called before the renderer applies a tint color.
        /// </summary>
        /// <param name="batch">The batch used in renderering.</param>
        protected virtual void OnBeforeRenderTint(SpriteBatch batch)
        {
            if (VirtualCursor.IsVisible)
            {
                // Bug - Virtual cursor position index is incorrectly positioned in the render area when the render area
                //       is smaller than width.
                //       Render

                int virtualCursorLocationIndex = BasicSurface.GetIndexFromPoint(
                    new Point(VirtualCursor.Position.X - TextSurface.RenderArea.Left,
                              VirtualCursor.Position.Y - TextSurface.RenderArea.Top), TextSurface.RenderArea.Width);

                if (virtualCursorLocationIndex >= 0 && virtualCursorLocationIndex < textSurface.RenderRects.Length)
                {
                    VirtualCursor.Render(batch, textSurface.Font, textSurface.RenderRects[virtualCursorLocationIndex]);
                }
            }
        }