예제 #1
0
        /// <summary>
        /// Draws a <see cref="ISpatial"/> that is selected, but NOT focused on. This is primarily
        /// intended for when selecting multiple items at once to give an indication on what other
        /// objects are selected but to distinguish that they are not the focused objects.
        /// </summary>
        /// <param name="spatial">The <see cref="ISpatial"/> that is selected but not focused on.</param>
        /// <param name="sb">The <see cref="ISpriteBatch"/> to draw to.</param>
        public static void DrawNotFocused(ISpatial spatial, ISpriteBatch sb)
        {
            if (spatial == null)
            {
                return;
            }

            var r = spatial.ToRectangle();

            RenderRectangle.Draw(sb, r, _nonfocusedColor, _nonfocusedBorderColorInner);

            var r2 = new Rectangle(r.X - 1, r.Y - 1, r.Width + 2, r.Height + 2);

            RenderRectangle.Draw(sb, r2, new Color(0, 0, 0, 0), _nonfocusedBorderColorOuter);
        }
예제 #2
0
        /// <summary>
        /// Draws the <see cref="FocusedSpatialDrawer"/>.
        /// </summary>
        /// <param name="sb">The <see cref="ISpriteBatch"/> to draw to.</param>
        public void Draw(ISpriteBatch sb)
        {
            if (Focused == null)
            {
                return;
            }

            var r = Focused.ToRectangle();

            RenderRectangle.Draw(sb, r, _focusedColor, _focusedBorderColorInner);

            var r2 = new Rectangle(r.X - 1, r.Y - 1, r.Width + 2, r.Height + 2);

            RenderRectangle.Draw(sb, r2, new Color(0, 0, 0, 0), _focusedBorderColorOuter);

            if (_steps > 0)
            {
                RenderRectangle.Draw(sb, ApplyStepping(r, _steps), _trackColor, _trackInnerBorderColor);
                RenderRectangle.Draw(sb, ApplyStepping(r, _steps - 1), _trackColor, _trackOuterBorderColor);
                RenderRectangle.Draw(sb, ApplyStepping(r, _steps + 1), _trackColor, _trackOuterBorderColor);
                _steps -= 4 + (_steps / 10);
            }
        }
 /// <summary>
 /// Draws a highlighted rectangle around the target area.
 /// </summary>
 /// <param name="spriteBatch">The <see cref="ISpriteBatch"/> to use to draw.</param>
 /// <param name="area">The area to draw the highlight at.</param>
 public static void DrawDropHighlight(ISpriteBatch spriteBatch, Rectangle area)
 {
     RenderRectangle.Draw(spriteBatch, area, HighlightInnerColor, HighlightOuterColor, HighlightBorderThickness);
 }
예제 #4
0
        /// <summary>
        /// Draws a border.
        /// </summary>
        /// <param name="sb"><see cref="ISpriteBatch"/> to draw to.</param>
        /// <param name="min">Minimum point to draw.</param>
        /// <param name="max">Maximum point to draw.</param>
        protected virtual void DrawBorder(ISpriteBatch sb, Vector2 min, Vector2 max)
        {
            var drawColor = new Color(255, 0, 0, 175);

            RenderRectangle.Draw(sb, CreateRect(min, max), drawColor);
        }