Ejemplo n.º 1
0
    /// <summary>
    /// Draws a rectangle.
    /// </summary>
    /// <param name="sb">Sb.</param>
    /// <param name="position">Position.</param>
    /// <param name="size">Size.</param>
    /// <param name="c">C.</param>
    /// <param name="layer">Layer.</param>
    public static void DrawRectangle(SpriteBatch sb, Vector2 position, Vector2 size, Color c, float layer)
    {
        Rectangle r = new Rectangle((int)position.X, (int)position.Y, // position
                                    (int)size.X, (int)size.Y);

        DrawingTools.DrawRectangle(sb, r, c, layer);
    }
Ejemplo n.º 2
0
        public virtual void DrawCursor(SpriteBatch sb)
        {
            CharInfo info = StringHelper.GetCharInfoFrom(_font, Value, _cursor, Position + new Vector2(5, 5), 1f);

            if (info == CharInfo.Empty)
            {
                info = StringHelper.GetCharInfoFrom(_font, " ", 0, Position + new Vector2(5, 5), 1f);
            }

            DrawingTools.DrawRectangle(sb, info.area, new Color(0, 0, 0, 0.5f), LayerDepths.FRONT);
        }
Ejemplo n.º 3
0
 public void Draw(SpriteBatch sb)
 {
     if (Enabled)
     {
         DrawingTools.DrawRectangle(sb,
                                    new Rectangle(0, 0, (int)Util.Resolution.VirtualViewport.Length(), _height),
                                    new Color(0, 0, 0, 0.75f),
                                    LayerDepths.POST_FRONT);
         _input.Draw(sb);
     }
 }
Ejemplo n.º 4
0
        public override void Draw(SpriteBatch sb)
        {
            if (Visible)
            {
                if (Hover)
                {
                    DrawingTools.DrawRectangle(sb, Position, Size, Color.Black, LayerDepths.POST_FRONT);
                }
                else
                {
                    DrawingTools.DrawRectangle(sb, Position, Size, Color.DarkSlateGray, LayerDepths.POST_FRONT);
                }

                DrawText(sb);
            }
        }
Ejemplo n.º 5
0
        private void DrawButton(SpriteBatch sb)
        {
            if (Image != null)
            {
                sb.Draw(Image, Position, Color.White);
            }
            else
            {
                Color c = FlatColors.MIDNIGHT_BLUE;
                if (State == ComponentState.HOVER)
                {
                    c = FlatColors.WET_ASPHALT;
                }

                DrawingTools.DrawRectangle(sb, Position, Size, c, LayerDepths.D3);
            }
        }
Ejemplo n.º 6
0
 public virtual void DrawCheck(SpriteBatch sb)
 {
     // TODO Better checked state drawing by default
     DrawingTools.DrawRectangle(sb, Position + new Vector2(4, 4), Size - new Vector2(8, 8), FlatColors.CONCRETE, LayerDepths.POST_FRONT);
 }
Ejemplo n.º 7
0
 public virtual void DrawBox(SpriteBatch sb)
 {
     DrawingTools.DrawRectangle(sb, Position, Size, FlatColors.MIDNIGHT_BLUE, LayerDepths.POST_FRONT);
 }
Ejemplo n.º 8
0
 public virtual void DrawBar(SpriteBatch sb)
 {
     DrawingTools.DrawRectangle(sb, Position,
                                new Vector2(30, Size.Y),
                                new Color(Color.Black, 0.5f), LayerDepths.BACK);
 }
Ejemplo n.º 9
0
 public virtual void DrawExpandButton(SpriteBatch sb)
 {
     DrawingTools.DrawRectangle(sb, _expandRectangle, Color.Coral, LayerDepths.D3);
 }
Ejemplo n.º 10
0
 public virtual void DrawBackground(SpriteBatch sb)
 {
     DrawingTools.DrawRectangle(sb, Position, Size, FlatColors.MIDNIGHT_BLUE, LayerDepths.D4);
 }