aboutsummaryrefslogtreecommitdiff
path: root/V3/Widgets/IWidget.cs
blob: 23466fe80fdd8bcb0ec3b33a26abf9f0af2a6bfc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace V3.Widgets
{
    /// <summary>
    /// A simple widget that has a size and a position and that can be drawn.
    /// </summary>
    public interface IWidget
    {
        /// <summary>
        /// The current position of this widget on the screen.
        /// </summary>
        Vector2 Position { get; set; }

        /// <summary>
        /// The size of this widget on the screen.  The widget should try to
        /// fill this size.  Should not be smaller than the value returned by
        /// GetMinimumSize().
        /// </summary>
        Vector2 Size { get; set; }

        /// <summary>
        /// Returns the minimum size this widgets needs.
        /// </summary>
        Vector2 GetMinimumSize();

        /// <summary>
        /// Drawst this widget on the given sprite batch.  It is assumed that
        /// spriteBatch.Begin() has already been called.
        /// </summary>
        void Draw(SpriteBatch spriteBatch);
    }
}