diff options
author | Thomas Leyh <leyh.thomas@web.de> | 2016-07-24 08:14:18 +0200 |
---|---|---|
committer | Thomas Leyh <leyh.thomas@web.de> | 2016-07-24 08:14:18 +0200 |
commit | ced3d03bdb3ce866d832e03fb212865140905a9a (patch) | |
tree | 2a16c2063a46d3c354ce1585029dda3124f6ad93 /V3/Widgets/IWidget.cs | |
parent | 0394dccaf06e1009e591a6ff4d645895574724c1 (diff) | |
download | V3-ced3d03bdb3ce866d832e03fb212865140905a9a.tar.gz V3-ced3d03bdb3ce866d832e03fb212865140905a9a.tar.bz2 |
Diffstat (limited to 'V3/Widgets/IWidget.cs')
-rw-r--r-- | V3/Widgets/IWidget.cs | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/V3/Widgets/IWidget.cs b/V3/Widgets/IWidget.cs new file mode 100644 index 0000000..23466fe --- /dev/null +++ b/V3/Widgets/IWidget.cs @@ -0,0 +1,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); + } +} |