Commits

Tobias Bohnen committed daaa125

* removed that TwoD stuff

  • Participants
  • Parent commits 3a63459

Comments (0)

Files changed (20)

File Projects/Examples/Axiom/AxiomDemo.cs

 
     using Miyagi;
     using Miyagi.Common;
-    using Miyagi.TwoD.Layers;
 
     [Launcher(Name = "Axiom", HasExamples = true, RenderSystems = "DirectX9;OpenGL")]
     public class AxiomDemo : Launcher
             // update the Guis and capture the inputdevices
             if (!this.miyagiSystem.IsDisposed)
             {
-                var mgr = this.miyagiSystem.TwoDManager;
-                if (mgr.GetElement("FPS") != null)
+                var mgr = this.miyagiSystem.GUIManager;
+                if (mgr.GetControl("FPS") != null)
+                {                    
+                    ((Miyagi.UI.Controls.Label)mgr.GetControl("FPS")).Text = "FPS: " + this.window.LastFPS;
+                }
+                if (mgr.GetControl("Batch") != null)
                 {
-                    mgr.GetElement<TextOverlay>("FPS").Text = "FPS: " + this.window.LastFPS;
+                    ((Miyagi.UI.Controls.Label)mgr.GetControl("Batch")).Text = "Batch: " + this.window.LastBatchCount;
                 }
-                if (mgr.GetElement("Batch") != null)
+                if (mgr.GetControl("Vertex") != null)
                 {
-                    mgr.GetElement<TextOverlay>("Batch").Text = "Batch: " + this.window.LastBatchCount;
-                }
-                if (mgr.GetElement("Vertex") != null)
-                {
-                    mgr.GetElement<TextOverlay>("Vertex").Text = "Vertex: " + this.window.LastTriangleCount * 3;
+                    ((Miyagi.UI.Controls.Label)mgr.GetControl("Vertex")).Text = "Vertex: " + this.window.LastTriangleCount * 3;
                 }
 
                 this.miyagiSystem.Update();

File Projects/Examples/Common/Examples.csproj

     <Compile Include="Examples\ControlSlider.cs" />
     <Compile Include="Examples\ControlTabControl.cs" />
     <Compile Include="Examples\ExampleDockAnchor.cs" />
-    <Compile Include="Examples\TwoDTextOverlay.cs" />
     <Compile Include="Helper\Example.cs" />
     <Compile Include="Helper\ExampleAttribute.cs" />
     <Compile Include="Helper\ExampleSelector.cs">
       <SubType>Form</SubType>
     </Compile>
-    <Compile Include="Examples\TwoDSpriteTransformation.cs" />
     <Compile Include="Examples\SpecialControlsCharting.cs" />
     <Compile Include="Helper\ExampleSelector.Designer.cs">
       <DependentUpon>ExampleSelector.cs</DependentUpon>
     <Compile Include="Program.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
     <Compile Include="Helper\Resources.cs" />
-    <Compile Include="Examples\TwoDTileMap.cs" />
     <Compile Include="Scripts.Designer.cs">
       <AutoGen>True</AutoGen>
       <DesignTime>True</DesignTime>

File Projects/Examples/Common/Examples/ExampleGUI.cs

         {
             base.StartCore(system);
             this.CreateGUI();
-            Utilities.CreateDebugOverlay(system.TwoDManager);
+            Utilities.CreateDebugOverlay(system.GUIManager);
         }
 
         #endregion Protected Methods

File Projects/Examples/Common/Examples/ExamplePopupGUI.cs

         {
             base.StartCore(system);
             this.CreateGUI();
-            Utilities.CreateDebugOverlay(system.TwoDManager);
+            Utilities.CreateDebugOverlay(system.GUIManager);
         }
 
         #endregion Protected Methods

File Projects/Examples/Common/Examples/TwoDSpriteTransformation.cs

-namespace Examples
-{
-    using Examples.Helper;
-
-    using Miyagi.Common;
-    using Miyagi.Common.Data;
-    using Miyagi.Common.Resources;
-    using Miyagi.TwoD.Layers;
-    using Miyagi.UI;
-    using Miyagi.UI.Controls;
-    using Miyagi.UI.Controls.Layout;
-    using Miyagi.UI.Controls.Styles;
-
-    [Example(Description = "TwoDSpriteTransformation", NodePath = "TwoD/Sprite Transformation")]
-    public class TwoDSpriteTransformation : Example
-    {
-        #region Fields
-
-        private Panel controlPanel;
-        private GUI gui;
-        private Binding rotationBinding;
-        private Label rotationLabel;
-        private Slider rotationSlider;
-        private Binding rotationTextBinding;
-        private Binding scaleBinding;
-        private Slider scaleSlider;
-        private Binding scaleXBinding;
-        private Label scaleXLabel;
-        private Slider scaleXSlider;
-        private Binding scaleXTextBinding;
-        private Binding scaleYBinding;
-        private Label scaleYLabel;
-        private Slider scaleYSlider;
-        private Binding scaleYTextBinding;
-        private Binding skewBinding;
-        private Slider skewSlider;
-        private Binding skewXBinding;
-        private Label skewXLabel;
-        private Slider skewXSlider;
-        private Binding skewXTextBinding;
-        private Binding skewYBinding;
-        private Label skewYLabel;
-        private Slider skewYSlider;
-        private Binding skewYTextBinding;
-        private TextureOverlay textureOverlay;
-        private Binding translationBinding;
-        private Slider translationSlider;
-        private Binding translationXBinding;
-        private Label translationXLabel;
-        private Slider translationXSlider;
-        private Binding translationXTextBinding;
-        private Binding translationYBinding;
-        private Label translationYLabel;
-        private Slider translationYSlider;
-        private Binding translationYTextBinding;
-
-        #endregion Fields
-
-        #region Methods
-
-        #region Public Methods
-
-        public override void Stop()
-        {
-            this.rotationBinding.Dispose();
-            this.rotationTextBinding.Dispose();
-            this.scaleXBinding.Dispose();
-            this.scaleYBinding.Dispose();
-            this.scaleBinding.Dispose();
-            this.scaleXTextBinding.Dispose();
-            this.scaleYTextBinding.Dispose();
-            this.skewBinding.Dispose();
-            this.skewXBinding.Dispose();
-            this.skewYBinding.Dispose();
-            this.skewXTextBinding.Dispose();
-            this.skewYTextBinding.Dispose();
-            this.translationBinding.Dispose();
-            this.translationXBinding.Dispose();
-            this.translationXTextBinding.Dispose();
-            this.translationYBinding.Dispose();
-            this.translationYTextBinding.Dispose();
-            base.Stop();
-        }
-
-        #endregion Public Methods
-
-        #region Protected Methods
-
-        protected override void StartCore(MiyagiSystem system)
-        {
-            base.StartCore(system);
-
-            GUIManager guiMgr = system.GUIManager;
-
-            // controls
-            this.gui = new GUI();
-            guiMgr.GUIs.Add(this.gui);
-
-            this.CreateControlPanel();
-            this.CreateLabels();
-
-            // 2D texture
-            var layer = new Layer();
-
-            this.textureOverlay = new TextureOverlay
-                                  {
-                                      Location = new Point(600, 350),
-                                      Size = new Size(300, 300),
-                                      Texture = new Texture("epic.png")
-                                  };
-
-            layer.Elements.Add(textureOverlay);
-            system.TwoDManager.Layers.Add(layer);
-
-            // Binding
-            this.CreateBindings();
-        }
-
-        #endregion Protected Methods
-
-        #region Private Methods
-
-        private void CreateBindings()
-        {
-            // one-way binding
-            this.rotationBinding = new Binding(this.rotationSlider, "Value", textureOverlay, "Rotation");
-            this.scaleXBinding = new Binding(this.scaleXSlider, "Value", textureOverlay, "ScaleX");
-            this.scaleYBinding = new Binding(this.scaleYSlider, "Value", textureOverlay, "ScaleY");
-            this.translationXBinding = new Binding(this.translationXSlider, "Value", textureOverlay, "TranslationX");
-            this.translationYBinding = new Binding(this.translationYSlider, "Value", textureOverlay, "TranslationY");
-            this.skewXBinding = new Binding(this.skewXSlider, "Value", textureOverlay, "SkewX");
-            this.skewYBinding = new Binding(this.skewYSlider, "Value", textureOverlay, "SkewY");
-
-            // custom one-way binding
-            this.scaleBinding = new Binding(this.scaleSlider, "Value", val =>
-                                                                       {
-                                                                           this.scaleXSlider.Value = (float)val;
-                                                                           this.scaleYSlider.Value = (float)val;
-                                                                       });
-
-            this.translationBinding = new Binding(this.translationSlider, "Value", val =>
-                                                                                   {
-                                                                                       this.translationXSlider.Value = (float)val;
-                                                                                       this.translationYSlider.Value = (float)val;
-                                                                                   });
-
-            this.skewBinding = new Binding(this.skewSlider, "Value", val =>
-                                                                     {
-                                                                         this.skewXSlider.Value = (float)val;
-                                                                         this.skewYSlider.Value = (float)val;
-                                                                     });
-
-            // two-way binding
-            this.rotationTextBinding = new Binding(this.rotationLabel, "Text", this.rotationSlider, "Value");
-            this.scaleXTextBinding = new Binding(this.scaleXLabel, "Text", this.scaleXSlider, "Value");
-            this.scaleYTextBinding = new Binding(this.scaleYLabel, "Text", this.scaleYSlider, "Value");
-            this.translationXTextBinding = new Binding(this.translationXLabel, "Text", this.translationXSlider, "Value");
-            this.translationYTextBinding = new Binding(this.translationYLabel, "Text", this.translationYSlider, "Value");
-            this.skewXTextBinding = new Binding(this.skewXLabel, "Text", this.skewXSlider, "Value");
-            this.skewYTextBinding = new Binding(this.skewYLabel, "Text", this.skewYSlider, "Value");
-        }
-
-        private void CreateControlPanel()
-        {
-            this.controlPanel = new Panel
-                                {
-                                    Padding = new Thickness(5),
-                                    ResizeMode = ResizeModes.None,
-                                    Size = new Size(400, 600),
-                                    Location = new Point(0, 0),
-                                    Skin = Resources.Skins["PanelSkin"]
-                                };
-
-            this.gui.Controls.Add(this.controlPanel);
-
-            var sliderSize = new Size(125, 25);
-            var thumbStyle = new ThumbStyle
-                             {
-                                 Size = new Size(32, 32)
-                             };
-
-            var textStyle = new TextStyle
-                            {
-                                HorizontalAlignment = HorizontalAlignment.Right,
-                                VerticalAlignment = VerticalAlignment.Center,
-                                ForegroundColour = Colours.White,
-                            };
-
-            // rotation slider
-            this.rotationSlider = new Slider
-                                  {
-                                      Text = "Rotation",
-                                      TextStyle = textStyle,
-                                      Size = sliderSize,
-                                      Location = new Point(5, 30),
-                                      DefaultKeysEnabled = true,
-                                      Max = 360,
-                                      SmallChange = 5,
-                                      ThumbStyle = thumbStyle,
-                                      Skin = Resources.Skins["SliderHSkin"]
-                                  };
-
-            this.controlPanel.Controls.Add(this.rotationSlider);
-
-            // scale slider
-            this.scaleXSlider = new Slider
-                                {
-                                    Text = "ScaleX",
-                                    TextStyle = textStyle,
-                                    Size = sliderSize,
-                                    Location = new Point(5, 100),
-                                    DefaultKeysEnabled = true,
-                                    Min = 0,
-                                    Max = 3,
-                                    Value = 1,
-                                    SmallChange = 0.125f,
-                                    ThumbStyle = thumbStyle,
-                                    Skin = Resources.Skins["SliderHSkin"]
-                                };
-
-            this.controlPanel.Controls.Add(this.scaleXSlider);
-
-            this.scaleYSlider = new Slider
-                                {
-                                    Text = "ScaleY",
-                                    TextStyle = textStyle,
-                                    Size = sliderSize,
-                                    Location = new Point(140, 100),
-                                    DefaultKeysEnabled = true,
-                                    Min = 0,
-                                    Max = 3,
-                                    Value = 1,
-                                    SmallChange = 0.125f,
-                                    ThumbStyle = thumbStyle,
-                                    Skin = Resources.Skins["SliderHSkin"]
-                                };
-
-            this.controlPanel.Controls.Add(this.scaleYSlider);
-
-            this.scaleSlider = new Slider
-                               {
-                                   Text = "Scale",
-                                   TextStyle = textStyle,
-                                   Size = sliderSize,
-                                   Location = new Point(65, 160),
-                                   DefaultKeysEnabled = true,
-                                   Min = 0,
-                                   Max = 3,
-                                   Value = 1,
-                                   SmallChange = 0.125f,
-                                   ThumbStyle = thumbStyle,
-                                   Skin = Resources.Skins["SliderHSkin"]
-                               };
-
-            this.controlPanel.Controls.Add(this.scaleSlider);
-
-            // translation slider
-            this.translationXSlider = new Slider
-                                      {
-                                          Text = "TransX",
-                                          TextStyle = textStyle,
-                                          Size = sliderSize,
-                                          Location = new Point(5, 220),
-                                          DefaultKeysEnabled = true,
-                                          Min = -200,
-                                          Max = 200,
-                                          Value = 0,
-                                          SmallChange = 5,
-                                          ThumbStyle = thumbStyle,
-                                          Skin = Resources.Skins["SliderHSkin"]
-                                      };
-
-            this.controlPanel.Controls.Add(this.translationXSlider);
-
-            this.translationYSlider = new Slider
-                                      {
-                                          Text = "TransY",
-                                          TextStyle = textStyle,
-                                          Size = sliderSize,
-                                          Location = new Point(140, 220),
-                                          DefaultKeysEnabled = true,
-                                          Min = -200,
-                                          Max = 200,
-                                          Value = 0,
-                                          SmallChange = 5,
-                                          ThumbStyle = thumbStyle,
-                                          Skin = Resources.Skins["SliderHSkin"]
-                                      };
-
-            this.controlPanel.Controls.Add(this.translationYSlider);
-
-            this.translationSlider = new Slider
-                                     {
-                                         Text = "Trans",
-                                         TextStyle = textStyle,
-                                         Size = sliderSize,
-                                         Location = new Point(65, 280),
-                                         DefaultKeysEnabled = true,
-                                         Min = -200,
-                                         Max = 200,
-                                         Value = 0,
-                                         SmallChange = 5,
-                                         ThumbStyle = thumbStyle,
-                                         Skin = Resources.Skins["SliderHSkin"]
-                                     };
-
-            this.controlPanel.Controls.Add(this.translationSlider);
-
-            // skew slider
-            this.skewXSlider = new Slider
-                               {
-                                   Text = "SkewX",
-                                   TextStyle = textStyle,
-                                   Size = sliderSize,
-                                   Location = new Point(5, 340),
-                                   DefaultKeysEnabled = true,
-                                   Min = 0,
-                                   Max = 200,
-                                   Value = 0,
-                                   SmallChange = 1,
-                                   ThumbStyle = thumbStyle,
-                                   Skin = Resources.Skins["SliderHSkin"]
-                               };
-
-            this.controlPanel.Controls.Add(this.skewXSlider);
-
-            this.skewYSlider = new Slider
-                               {
-                                   Text = "SkewY",
-                                   TextStyle = textStyle,
-                                   Size = sliderSize,
-                                   Location = new Point(140, 340),
-                                   DefaultKeysEnabled = true,
-                                   Min = 0,
-                                   Max = 200,
-                                   Value = 0,
-                                   SmallChange = 1,
-                                   ThumbStyle = thumbStyle,
-                                   Skin = Resources.Skins["SliderHSkin"]
-                               };
-
-            this.controlPanel.Controls.Add(this.skewYSlider);
-
-            this.skewSlider = new Slider
-                              {
-                                  Text = "Skew",
-                                  TextStyle = textStyle,
-                                  Size = sliderSize,
-                                  Location = new Point(65, 400),
-                                  DefaultKeysEnabled = true,
-                                  Min = 0,
-                                  Max = 200,
-                                  Value = 0,
-                                  SmallChange = 1,
-                                  ThumbStyle = thumbStyle,
-                                  Skin = Resources.Skins["SliderHSkin"]
-                              };
-
-            this.controlPanel.Controls.Add(this.skewSlider);
-        }
-
-        private void CreateLabels()
-        {
-            var tablelayout = new TableLayoutPanel
-                              {
-                                  ColumnCount = 7,
-                                  RowCount = 2,
-                                  Dock = DockStyle.Bottom,
-                                  Size = new Size(100, 50),
-                                  Skin = Resources.Skins["SliderHSkin"]
-                              };
-
-            var tls = new TableLayoutStyle(SizeType.Percent, 50);
-            tablelayout.RowStyles.AddRange(new[] { tls, tls });
-            var tls2 = new TableLayoutStyle(SizeType.Percent, 20);
-            tablelayout.ColumnStyles.AddRange(new[] { tls2, tls2, tls2, tls2, tls2, tls2, tls2 });
-
-            var textStyle = new TextStyle
-                            {
-                                HorizontalAlignment = HorizontalAlignment.Center,
-                                VerticalAlignment = VerticalAlignment.Center,
-                                ForegroundColour = Colours.White,
-                            };
-
-            tablelayout.Controls.AddRange(
-                new Label
-                {
-                    Dock = DockStyle.Fill,
-                    Text = "Rotation",
-                    TextStyle = textStyle
-                },
-                new Label
-                {
-                    Dock = DockStyle.Fill,
-                    Text = "ScaleX",
-                    TextStyle = textStyle
-                },
-                new Label
-                {
-                    Dock = DockStyle.Fill,
-                    Text = "ScaleY",
-                    TextStyle = textStyle
-                },
-                new Label
-                {
-                    Dock = DockStyle.Fill,
-                    Text = "TransX",
-                    TextStyle = textStyle
-                },
-                new Label
-                {
-                    Dock = DockStyle.Fill,
-                    Text = "TransY",
-                    TextStyle = textStyle
-                },
-                new Label
-                {
-                    Dock = DockStyle.Fill,
-                    Text = "SkewX",
-                    TextStyle = textStyle
-                },
-                new Label
-                {
-                    Dock = DockStyle.Fill,
-                    Text = "SkewY",
-                    TextStyle = textStyle
-                });
-
-            this.rotationLabel = new Label
-                                 {
-                                     Dock = DockStyle.Fill,
-                                     TextStyle = textStyle
-                                 };
-
-            tablelayout.Controls.Add(this.rotationLabel);
-
-            this.scaleXLabel = new Label
-                               {
-                                   Dock = DockStyle.Fill,
-                                   TextStyle = textStyle
-                               };
-
-            tablelayout.Controls.Add(this.scaleXLabel);
-
-            this.scaleYLabel = new Label
-                               {
-                                   Dock = DockStyle.Fill,
-                                   TextStyle = textStyle
-                               };
-
-            tablelayout.Controls.Add(this.scaleYLabel);
-
-            this.translationXLabel = new Label
-                                     {
-                                         Dock = DockStyle.Fill,
-                                         TextStyle = textStyle
-                                     };
-
-            tablelayout.Controls.Add(this.translationXLabel);
-
-            this.translationYLabel = new Label
-                                     {
-                                         Dock = DockStyle.Fill,
-                                         TextStyle = textStyle
-                                     };
-
-            tablelayout.Controls.Add(this.translationYLabel);
-
-            this.skewXLabel = new Label
-                              {
-                                  Dock = DockStyle.Fill,
-                                  TextStyle = textStyle
-                              };
-
-            tablelayout.Controls.Add(this.skewXLabel);
-
-            this.skewYLabel = new Label
-                              {
-                                  Dock = DockStyle.Fill,
-                                  TextStyle = textStyle
-                              };
-
-            tablelayout.Controls.Add(this.skewYLabel);
-
-            this.controlPanel.Controls.Add(tablelayout);
-        }
-
-        #endregion Private Methods
-
-        #endregion Methods
-    }
-}

File Projects/Examples/Common/Examples/TwoDTextOverlay.cs

-namespace Examples
-{
-    using Examples.Helper;
-
-    using Miyagi.Common;
-    using Miyagi.Common.Data;
-    using Miyagi.TwoD.Layers;
-
-    [Example(Description = "TwoDTextOverlay", NodePath = "TwoD/TextOverlay")]
-    public class TwoDTextOverlay : Example
-    {
-        #region Methods
-
-        #region Protected Methods
-
-        protected override void StartCore(MiyagiSystem system)
-        {
-            base.StartCore(system);
-
-            var layer = new Layer();
-
-            var textOverlay = new TextOverlay("FPS")
-                              {
-                                  ColourDefinition = Colours.Blue,
-                                  Location = new Point(1, 1)
-                              };
-
-            layer.Elements.Add(textOverlay);
-
-            var textOverlay2 = new TextOverlay
-                               {
-                                   Text = "Hello World",
-                                   ColourDefinition = new ColourDefinition(Colours.Red, Colours.Green),
-                                   Bounds = new Rectangle(120, 20, 50, 50)
-                               };
-
-            layer.Elements.Add(textOverlay2);
-
-            var textOverlay3 = new TextOverlay
-                               {
-                                   Text = "Hello World",
-                                   ColourDefinition = new ColourDefinition(Colours.Yellow, Colours.WhiteSmoke),
-                                   Bounds = new Rectangle(320, 50, 50, 50),
-                                   Rotation = 45
-                               };
-
-            layer.Elements.Add(textOverlay3);
-
-            system.TwoDManager.Layers.Add(layer);
-        }
-
-        #endregion Protected Methods
-
-        #endregion Methods
-    }
-}

File Projects/Examples/Common/Examples/TwoDTileMap.cs

-namespace Examples
-{
-    using System;
-
-    using Examples.Helper;
-
-    using Miyagi.Common;
-    using Miyagi.Common.Data;
-    using Miyagi.Common.Resources;
-    using Miyagi.TwoD.Layers;
-
-    [Example(Description = "TwoDTileMap", NodePath = "TwoD/TileMap")]
-    public class TwoDTileMap : Example
-    {
-        #region Fields
-
-        private static readonly Random Rand = new Random();
-
-        #endregion Fields
-
-        #region Methods
-
-        #region Protected Methods
-
-        protected override void StartCore(MiyagiSystem system)
-        {
-            base.StartCore(system);
-
-            var layer = new Layer();
-
-            var textOverlay = new TextOverlay
-                              {
-                                  ColourDefinition = Colours.Blue,
-                                  Location = new Point(0, 0),
-                                  Text = "Press 'r' to create a new map."
-                              };
-
-            layer.Elements.Add(textOverlay);
-
-            var textures = new TextureCollection();
-            textures["0"] = new Texture("rough_red.png");
-            textures["1"] = new Texture("tomb.png");
-            textures["2"] = new Texture("snake.png");
-            textures["3"] = new Texture("sandstone_floor.png");
-            textures["4"] = new Texture("pebble_brown.png");
-
-            var map = new string[5][];
-            map[0] = new[] { "1", "2", "3", "0", "4" };
-            map[1] = new[] { "0", "4", "3", "0", "4" };
-            map[2] = new[] { "0", "1", "3", "2", "2" };
-            map[3] = new[] { "0", "4", "3", "2", "4" };
-            map[4] = new[] { "4", "2", "3", "0", "4" };
-
-            var tileMap = new TileMap("TileMap")
-                          {
-                              Location = new Point(120, 120),
-                              TileSize = new Size(100, 100),
-                              Textures = textures,
-                              Map = map
-                          };
-
-            layer.Elements.Add(tileMap);
-            system.TwoDManager.Layers.Add(layer);
-            system.InputManager.KeyDown += this.InputManagerKeyDown;
-        }
-
-        #endregion Protected Methods
-
-        #region Private Static Methods
-
-        private static string Next()
-        {
-            return Rand.Next(0, 5).ToString();
-        }
-
-        #endregion Private Static Methods
-
-        #region Private Methods
-
-        private void InputManagerKeyDown(object sender, Miyagi.Common.Events.KeyboardEventArgs e)
-        {
-            if (e.KeyCode == Keys.R)
-            {
-                var tilemap = this.MiyagiSystem.TwoDManager.GetElement<TileMap>("TileMap");
-                var map = new string[5][];
-                map[0] = new[] { Next(), Next(), Next(), Next(), Next() };
-                map[1] = new[] { Next(), Next(), Next(), Next(), Next() };
-                map[2] = new[] { Next(), Next(), Next(), Next(), Next() };
-                map[3] = new[] { Next(), Next(), Next(), Next(), Next() };
-                map[4] = new[] { Next(), Next(), Next(), Next(), Next() };
-                tilemap.Map = map;
-            }
-        }
-
-        #endregion Private Methods
-
-        #endregion Methods
-    }
-}

File Projects/Examples/Common/Helper/Utilities.cs

-namespace Examples.Helper
+using Miyagi.UI.Controls;
+namespace Examples.Helper
 {
     using Miyagi.Common.Data;
-    using Miyagi.TwoD;
-    using Miyagi.TwoD.Layers;
     using Miyagi.UI;
 
     public static class Utilities
             guiMgr.Cursor.SetHotspot(CursorMode.BlockDrop, new Point(8, 8));
         }
 
-        public static void CreateDebugOverlay(TwoDManager twoDMgr)
+        public static void CreateDebugOverlay(GUIManager mgr)
         {
-            var layer = new Layer();
-            layer.Elements.Add(new TextOverlay("FPS")
-                               {
-                                   Location = new Point(0, 0)
-                               });
-            layer.Elements.Add(new TextOverlay("Batch")
-                               {
-                                   Location = new Point(0, 20)
-                               });
-            layer.Elements.Add(new TextOverlay("Vertex")
-                               {
-                                   Location = new Point(0, 40)
-                               });
-            twoDMgr.Layers.Add(layer);
+            var gui = new GUI();
+            gui.Controls.Add(new Label("FPS")
+                             {
+                                 Location = new Point(0, 0),
+                                 AutoSize = true
+                             });
+            gui.Controls.Add(new Label("Batch")
+                             {
+                                 Location = new Point(0, 20),
+                                 AutoSize = true
+                             });
+            gui.Controls.Add(new Label("Vertex")
+                             {
+                                 Location = new Point(0, 40),
+                                 AutoSize = true
+                             });
+            mgr.GUIs.Add(gui);
         }
 
         #endregion Public Static Methods

File Projects/Examples/Mogre/MogreDemo.cs

-namespace MogreLauncher
+using Miyagi.UI.Controls;
+namespace MogreLauncher
 {
     using System;
     using System.IO;
 
     using Miyagi.Common;
     using Miyagi.Common.Data;
-    using Miyagi.TwoD.Layers;
 
     using Mogre;
 
 
             if (this.miyagiSystem != null)
             {
-                var mgr = this.miyagiSystem.TwoDManager;
-                if (mgr.GetElement("FPS") != null)
+                var mgr = this.miyagiSystem.GUIManager;
+                if (mgr.GetControl("FPS") != null)
                 {
-                    mgr.GetElement<TextOverlay>("FPS").Text = "FPS: " + this.window.LastFPS;
+                    ((Label)mgr.GetControl("FPS")).Text = "FPS: " + this.window.LastFPS;
                 }
-                if (mgr.GetElement("Batch") != null)
+                if (mgr.GetControl("Batch") != null)
                 {
-                    mgr.GetElement<TextOverlay>("Batch").Text = "Batch: " + this.window.BatchCount;
+                    ((Label)mgr.GetControl("Batch")).Text = "Batch: " + this.window.BatchCount;
                 }
-                if (mgr.GetElement("Vertex") != null)
+                if (mgr.GetControl("Vertex") != null)
                 {
-                    mgr.GetElement<TextOverlay>("Vertex").Text = "Vertex: " + this.window.TriangleCount * 3;
+                    ((Label)mgr.GetControl("Vertex")).Text = "Vertex: " + this.window.TriangleCount * 3;
                 }
 
                 this.miyagiSystem.Update();

File Projects/Miyagi/Common/MiyagiSystem.cs

     using Miyagi.Common.Rendering;
     using Miyagi.Common.Serialization;
     using Miyagi.Internals;
-    using Miyagi.TwoD;
     using Miyagi.UI;
 
     /// <summary>
             }
         }
 
-        /// <summary>
-        /// Gets the TwoDManager.
-        /// </summary>
-        public TwoDManager TwoDManager
-        {
-            get
-            {
-                this.ThrowIfDisposed();
-
-                if (!this.managers.Contains("TwoD") && !this.IsDisposed)
-                {
-                    this.RegisterManager(new TwoDManager(this));
-                }
-
-                return (TwoDManager)this.managers["TwoD"];
-            }
-        }
-
         #endregion Public Properties
 
         #region Internal Properties
                     return this.RenderManager;
                 case "Serialization":
                     return this.SerializationManager;
-                case "TwoD":
-                    return this.TwoDManager;
             }
 
             return this.HasManager(type) ? this.managers[type] : null;

File Projects/Miyagi/Miyagi.csproj

     <Compile Include="Common\Animation\LinearFunctionValueController.cs" />
     <Compile Include="Common\Animation\SineWaveValueController.cs" />
     <Compile Include="Common\Animation\ValueController.cs" />
-    <Compile Include="TwoD\Layers\Layer.cs">
-      <SubType>Code</SubType>
-    </Compile>
-    <Compile Include="TwoD\Layers\LayerElement.cs">
-      <SubType>Code</SubType>
-    </Compile>
-    <Compile Include="TwoD\Layers\Overlay.cs">
-      <SubType>Code</SubType>
-    </Compile>
-    <Compile Include="TwoD\Layers\TextOverlay.cs">
-      <SubType>Code</SubType>
-    </Compile>
-    <Compile Include="TwoD\Layers\TextureOverlay.cs">
-      <SubType>Code</SubType>
-    </Compile>
-    <Compile Include="TwoD\Layers\TileMap.cs">
-      <SubType>Code</SubType>
-    </Compile>
-    <Compile Include="TwoD\TwoDManager.cs">
-      <SubType>Code</SubType>
-    </Compile>
-    <Compile Include="TwoD\TwoDSprite.cs">
-      <SubType>Code</SubType>
-    </Compile>
     <Compile Include="UI\Clipboard.cs">
       <SubType>Code</SubType>
     </Compile>

File Projects/Miyagi/TwoD/Layers/Layer.cs

-/*
- Miyagi v1.3.0
- Copyright (c) 2008 - 2011 Tobias Bohnen
-
- Permission is hereby granted, free of charge, to any person obtaining a copy of this
- software and associated documentation files (the "Software"), to deal in the Software
- without restriction, including without limitation the rights to use, copy, modify, merge,
- publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
- to whom the Software is furnished to do so, subject to the following conditions:
-
- The above copyright notice and this permission notice shall be included in all copies or
- substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
- INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
- PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
- FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
- */
-namespace Miyagi.TwoD.Layers
-{
-    using System;
-    using System.Linq;
-
-    using Miyagi.Common;
-    using Miyagi.Common.Events;
-    using Miyagi.Common.Rendering;
-    using Miyagi.Internals;
-
-    /// <summary>
-    /// A 2D layer that can display multiple 2D elements.
-    /// </summary>
-    public class Layer : IDisposable, INamable
-    {
-        #region Fields
-
-        private static readonly NameGenerator NameGenerator = new NameGenerator();
-
-        private readonly MiyagiCollection<LayerElement> layerElements;
-
-        #endregion Fields
-
-        #region Constructors
-
-        /// <summary>
-        /// Initializes a new instance of the Layer class.
-        /// </summary>
-        public Layer()
-            : this(string.Empty)
-        {
-        }
-
-        /// <summary>
-        /// Initializes a new instance of the Layer class.
-        /// </summary>
-        /// <param name="name">The name of the element.</param>
-        public Layer(string name)
-        {
-            NameGenerator.NextWhenNullOrEmpty(this, name);
-            this.layerElements = new MiyagiCollection<LayerElement>();
-            this.layerElements.ItemAdded += this.ElementAdded;
-            this.layerElements.ItemInserted += this.ElementAdded;
-            this.layerElements.ItemRemoved += ElementRemoved;
-        }
-
-        /// <summary>
-        /// Finalizes an instance of the Layer class.
-        /// </summary>
-        ~Layer()
-        {
-            this.Dispose(false);
-        }
-
-        #endregion Constructors
-
-        #region Properties
-
-        #region Public Properties
-
-        /// <summary>
-        /// Gets the list of elements.
-        /// </summary>
-        public MiyagiCollection<LayerElement> Elements
-        {
-            get
-            {
-                return this.layerElements;
-            }
-        }
-
-        /// <summary>
-        /// Gets or sets the name.
-        /// </summary>
-        public string Name
-        {
-            get;
-            set;
-        }
-
-        /// <summary>
-        /// Gets the SpriteRenderer.
-        /// </summary>
-        public ISpriteRenderer SpriteRenderer
-        {
-            get;
-            private set;
-        }
-
-        /// <summary>
-        /// Gets the TwoDManager.
-        /// </summary>
-        public TwoDManager TwoDManager
-        {
-            get;
-            internal set;
-        }
-
-        #endregion Public Properties
-
-        #endregion Properties
-
-        #region Methods
-
-        #region Public Methods
-
-        /// <summary>
-        /// Disposes the Layer.
-        /// </summary>
-        public void Dispose()
-        {
-            this.Dispose(true);
-            GC.SuppressFinalize(this);
-        }
-
-        /// <summary>
-        /// Gets an element of the specified type by name.
-        /// </summary>
-        /// <param name="name">The name of the element.</param>
-        /// <returns>The first element of that name and type if it exists, otherwise null.</returns>
-        /// <typeparam name="T">The type of the element.</typeparam>
-        public T GetElement<T>(string name)
-            where T : LayerElement
-        {
-            return this.Elements.Where(element => element.Name == name && element.GetType() == typeof(T)).Cast<T>().FirstOrDefault();
-        }
-
-        /// <summary>
-        /// Gets a element by name.
-        /// </summary>
-        /// <param name="name">The name of the element.</param>
-        /// <returns>If it exists the first element with that name, otherwise null.</returns>
-        public LayerElement GetElement(string name)
-        {
-            return this.Elements.FirstOrDefault(element => element.Name == name);
-        }
-
-        /// <summary>
-        /// Updates the Layer.
-        /// </summary>
-        public void Update()
-        {
-            if (this.layerElements.Count > 0)
-            {
-                foreach (LayerElement element in this.layerElements)
-                {
-                    element.Update();
-                }
-            }
-        }
-
-        #endregion Public Methods
-
-        #region Protected Internal Methods
-
-        protected internal virtual void CreateSpriteRenderer(MiyagiSystem system)
-        {
-            ThrowHelper.CheckArgumentNull(system, "system");
-            if (this.SpriteRenderer != null)
-            {
-                this.DestroySpriteRenderer();
-            }
-
-            this.SpriteRenderer = system.RenderManager.Create2DRenderer();
-        }
-
-        /// <summary>
-        /// Destroys the renderer.
-        /// </summary>
-        protected internal virtual void DestroySpriteRenderer()
-        {
-            if (this.TwoDManager.MiyagiSystem.HasManager("Render") && this.SpriteRenderer != null)
-            {
-                this.TwoDManager.MiyagiSystem.RenderManager.DestroyRenderer(this.SpriteRenderer);
-                this.SpriteRenderer = null;
-            }
-        }
-
-        #endregion Protected Internal Methods
-
-        #region Protected Methods
-
-        /// <summary>
-        /// Disposes the Layer.
-        /// </summary>
-        /// <param name="disposing">Whether Dispose has been called.</param>
-        protected virtual void Dispose(bool disposing)
-        {
-            if (disposing)
-            {
-                foreach (LayerElement element in this.layerElements)
-                {
-                    element.Dispose();
-                }
-
-                this.layerElements.Clear();
-
-                var layers = this.TwoDManager.Layers;
-                if (layers.Contains(this))
-                {
-                    layers.Remove(this);
-                }
-            }
-        }
-
-        #endregion Protected Methods
-
-        #region Private Static Methods
-
-        private static void ElementRemoved(object sender, CollectionEventArgs<LayerElement> e)
-        {
-            e.Item.Layer = null;
-        }
-
-        #endregion Private Static Methods
-
-        #region Private Methods
-
-        private void ElementAdded(object sender, CollectionEventArgs<LayerElement> e)
-        {
-            e.Item.Layer = this;
-        }
-
-        #endregion Private Methods
-
-        #endregion Methods
-    }
-}

File Projects/Miyagi/TwoD/Layers/LayerElement.cs

-/*
- Miyagi v1.3.0
- Copyright (c) 2008 - 2011 Tobias Bohnen
-
- Permission is hereby granted, free of charge, to any person obtaining a copy of this
- software and associated documentation files (the "Software"), to deal in the Software
- without restriction, including without limitation the rights to use, copy, modify, merge,
- publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
- to whom the Software is furnished to do so, subject to the following conditions:
-
- The above copyright notice and this permission notice shall be included in all copies or
- substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
- INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
- PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
- FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
- */
-namespace Miyagi.TwoD.Layers
-{
-    using System;
-
-    using Miyagi.Common;
-    using Miyagi.Common.Data;
-    using Miyagi.Internals;
-
-    /// <summary>
-    /// The abstract base class for layer elements.
-    /// </summary>
-    public abstract class LayerElement : IDisposable, INamable
-    {
-        #region Fields
-
-        private static readonly NameGenerator NameGenerator = new NameGenerator();
-
-        private Layer layer;
-
-        #endregion Fields
-
-        #region Constructors
-
-        /// <summary>
-        /// Initializes a new instance of the Element class.
-        /// </summary>
-        /// <param name="name">The name of the element.</param>
-        protected LayerElement(string name)
-        {
-            NameGenerator.NextWhenNullOrEmpty(this, name);
-        }
-
-        #endregion Constructors
-
-        #region Properties
-
-        #region Public Properties
-
-        /// <summary>
-        /// Gets the Layer.
-        /// </summary>
-        public Layer Layer
-        {
-            get
-            {
-                return this.layer;
-            }
-
-            internal set
-            {
-                if (this.layer != value)
-                {
-                    Layer oldLayer = this.layer;
-                    this.layer = value;
-
-                    if (this.layer != null && !this.layer.Elements.Contains(this))
-                    {
-                        this.layer.Elements.Add(this);
-                    }
-
-                    if (oldLayer != null)
-                    {
-                        this.DestroyElement();
-                        if (oldLayer.Elements.Contains(this))
-                        {
-                            oldLayer.Elements.Remove(this);
-                        }
-                    }
-                }
-            }
-        }
-
-        /// <summary>
-        /// Gets or sets the name.
-        /// </summary>
-        public string Name
-        {
-            get;
-            set;
-        }
-
-        #endregion Public Properties
-
-        #region Protected Properties
-
-        /// <summary>
-        /// Gets the size of the viewport.
-        /// </summary>
-        protected Size ViewportSize
-        {
-            get
-            {
-                return this.layer != null ? this.layer.SpriteRenderer.Viewport.Size : Size.Empty;
-            }
-        }
-
-        #endregion Protected Properties
-
-        #endregion Properties
-
-        #region Methods
-
-        #region Public Methods
-
-        /// <summary>
-        /// Disposes the Element.
-        /// </summary>
-        public void Dispose()
-        {
-            this.Dispose(true);
-            GC.SuppressFinalize(this);
-        }
-
-        /// <summary>
-        /// Updates the Element.
-        /// </summary>
-        public abstract void Update();
-
-        #endregion Public Methods
-
-        #region Protected Methods
-
-        /// <summary>
-        /// Destroys the Element.
-        /// </summary>
-        protected abstract void DestroyElement();
-
-        /// <summary>
-        /// Disposes the Element.
-        /// </summary>
-        /// <param name="disposing">Whether Dispose has been called.</param>
-        protected virtual void Dispose(bool disposing)
-        {
-        }
-
-        #endregion Protected Methods
-
-        #endregion Methods
-    }
-}

File Projects/Miyagi/TwoD/Layers/Overlay.cs

-/*
- Miyagi v1.3.0
- Copyright (c) 2008 - 2011 Tobias Bohnen
-
- Permission is hereby granted, free of charge, to any person obtaining a copy of this
- software and associated documentation files (the "Software"), to deal in the Software
- without restriction, including without limitation the rights to use, copy, modify, merge,
- publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
- to whom the Software is furnished to do so, subject to the following conditions:
-
- The above copyright notice and this permission notice shall be included in all copies or
- substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
- INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
- PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
- FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
- */
-namespace Miyagi.TwoD.Layers
-{
-    using Miyagi.Common.Data;
-
-    /// <summary>
-    /// The abstract base class for 2D overlays.
-    /// </summary>
-    public abstract class Overlay : LayerElement
-    {
-        #region Fields
-
-        private Point location;
-        private float opacity;
-        private int rotation;
-        private PointF scale;
-        private PointF skew;
-        private bool transformationNeedsUpdate;
-        private Point translation;
-        private bool visible;
-        private int zorder;
-
-        #endregion Fields
-
-        #region Constructors
-
-        /// <summary>
-        /// Initializes a new instance of the Overlay class.
-        /// </summary>
-        /// <param name="name">The name of the element.</param>
-        protected Overlay(string name)
-            : base(name)
-        {
-            this.visible = true;
-            this.opacity = 1;
-            this.scale = new PointF(1, 1);
-        }
-
-        #endregion Constructors
-
-        #region Properties
-
-        #region Public Properties
-
-        /// <summary>
-        /// Gets or sets the location.
-        /// </summary>
-        public Point Location
-        {
-            get
-            {
-                return this.location;
-            }
-
-            set
-            {
-                if (this.location != value)
-                {
-                    this.location = value;
-                    this.OnBoundsChanged();
-                }
-            }
-        }
-
-        /// <summary>
-        /// Gets or sets the opacity.
-        /// </summary>
-        public float Opacity
-        {
-            get
-            {
-                return this.opacity;
-            }
-
-            set
-            {
-                if (this.opacity != value)
-                {
-                    this.opacity = value;
-                    this.OnOpacityChanged();
-                }
-            }
-        }
-
-        /// <summary>
-        /// Gets or sets the rotation in degrees.
-        /// </summary>
-        public int Rotation
-        {
-            get
-            {
-                return this.rotation;
-            }
-
-            set
-            {
-                if (this.rotation != value)
-                {
-                    if (value >= 360)
-                    {
-                        value = 0;
-                    }
-
-                    this.rotation = value;
-                    this.transformationNeedsUpdate = true;
-                }
-            }
-        }
-
-        /// <summary>
-        /// Gets or sets the scale.
-        /// </summary>
-        public PointF Scale
-        {
-            get
-            {
-                return this.scale;
-            }
-
-            set
-            {
-                if (this.scale != value)
-                {
-                    if (value.X < 0)
-                    {
-                        value = new PointF(0, value.Y);
-                    }
-
-                    if (value.Y < 0)
-                    {
-                        value = new PointF(value.X, 0);
-                    }
-
-                    this.scale = value;
-                    this.transformationNeedsUpdate = true;
-                }
-            }
-        }
-
-        /// <summary>
-        /// Gets or sets the horizontal scale.
-        /// </summary>
-        public float ScaleX
-        {
-            get
-            {
-                return this.scale.X;
-            }
-
-            set
-            {
-                this.Scale = new PointF(value, this.scale.Y);
-            }
-        }
-
-        /// <summary>
-        /// Gets or sets the vertical scale.
-        /// </summary>
-        public float ScaleY
-        {
-            get
-            {
-                return this.scale.Y;
-            }
-
-            set
-            {
-                this.Scale = new PointF(this.scale.X, value);
-            }
-        }
-
-        /// <summary>
-        /// Gets or sets the skew.
-        /// </summary>
-        public PointF Skew
-        {
-            get
-            {
-                return this.skew;
-            }
-
-            set
-            {
-                if (this.skew != value)
-                {
-                    if (value.X < 0)
-                    {
-                        value = new PointF(0, value.Y);
-                    }
-
-                    if (value.Y < 0)
-                    {
-                        value = new PointF(value.X, 0);
-                    }
-
-                    this.skew = value;
-                    this.transformationNeedsUpdate = true;
-                }
-            }
-        }
-
-        /// <summary>
-        /// Gets or sets the horizontal skew.
-        /// </summary>
-        public float SkewX
-        {
-            get
-            {
-                return this.skew.X;
-            }
-
-            set
-            {
-                this.Skew = new PointF(value, this.skew.Y);
-            }
-        }
-
-        /// <summary>
-        /// Gets or sets the vertical skew.
-        /// </summary>
-        public float SkewY
-        {
-            get
-            {
-                return this.skew.Y;
-            }
-
-            set
-            {
-                this.Skew = new PointF(this.skew.X, value);
-            }
-        }
-
-        /// <summary>
-        /// Gets or sets the translation.
-        /// </summary>
-        public Point Translation
-        {
-            get
-            {
-                return this.translation;
-            }
-
-            set
-            {
-                if (this.translation != value)
-                {
-                    this.translation = value;
-                    this.transformationNeedsUpdate = true;
-                }
-            }
-        }
-
-        /// <summary>
-        /// Gets or sets the horizontal translation.
-        /// </summary>
-        public int TranslationX
-        {
-            get
-            {
-                return this.translation.X;
-            }
-
-            set
-            {
-                this.Translation = new Point(value, this.translation.Y);
-            }
-        }
-
-        /// <summary>
-        /// Gets or sets the vertical translation.
-        /// </summary>
-        public int TranslationY
-        {
-            get
-            {
-                return this.translation.Y;
-            }
-
-            set
-            {
-                this.Translation = new Point(this.translation.X, value);
-            }
-        }
-
-        /// <summary>
-        /// Gets or sets a value indicating whether the Overlay is visible.
-        /// </summary>
-        public bool Visible
-        {
-            get
-            {
-                return this.visible;
-            }
-
-            set
-            {
-                if (this.visible != value)
-                {
-                    this.visible = value;
-                    this.OnVisibleChanged();
-                }
-            }
-        }
-
-        /// <summary>
-        /// Gets or sets the Z-order.
-        /// </summary>
-        public int ZOrder
-        {
-            get
-            {
-                return this.zorder;
-            }
-
-            set
-            {
-                if (this.zorder != value)
-                {
-                    this.zorder = value;
-                    if (this.Sprite != null)
-                    {
-                        this.Sprite.ZOrder = value;
-                    }
-                }
-            }
-        }
-
-        #endregion Public Properties
-
-        #region Protected Properties
-
-        /// <summary>
-        /// Gets the pivot point.
-        /// </summary>
-        protected abstract Point Pivot
-        {
-            get;
-        }
-
-        /// <summary>
-        /// Gets or sets the sprite.
-        /// </summary>
-        protected TwoDSprite Sprite
-        {
-            get;
-            set;
-        }
-
-        #endregion Protected Properties
-
-        #endregion Properties
-
-        #region Methods
-
-        #region Public Methods
-
-        /// <summary>
-        /// Updates the Overlay.
-        /// </summary>
-        public override void Update()
-        {
-            if (this.Sprite != null)
-            {
-                if (this.transformationNeedsUpdate)
-                {
-                    this.Sprite.Rotate(this.rotation, this.Pivot, false);
-                    this.Sprite.Scale(this.scale, this.Pivot, false);
-                    this.Sprite.Translate(this.translation, false);
-                    this.Sprite.Skew(this.skew, false);
-                    this.Sprite.ApplyTransformation();
-                    this.transformationNeedsUpdate = false;
-                }
-            }
-        }
-
-        #endregion Public Methods
-
-        #region Protected Methods
-
-        /// <summary>
-        /// Destroys the Overlay.
-        /// </summary>
-        protected override void DestroyElement()
-        {
-            if (this.Sprite != null)
-            {
-                this.Sprite.RemoveFromRenderer();
-                this.Sprite = null;
-            }
-        }
-
-        /// <summary>
-        /// Handles bounds changes.
-        /// </summary>
-        protected virtual void OnBoundsChanged()
-        {
-        }
-
-        /// <summary>
-        /// Handles opacity changes.
-        /// </summary>
-        protected virtual void OnOpacityChanged()
-        {
-            if (this.Sprite != null)
-            {
-                this.Sprite.Opacity = this.Opacity;
-            }
-        }
-
-        /// <summary>
-        /// Handles visibility changes.
-        /// </summary>
-        protected virtual void OnVisibleChanged()
-        {
-            this.Sprite.Visible = this.Visible;
-        }
-
-        #endregion Protected Methods
-
-        #endregion Methods
-    }
-}

File Projects/Miyagi/TwoD/Layers/TextOverlay.cs

-/*
- Miyagi v1.3.0
- Copyright (c) 2008 - 2011 Tobias Bohnen
-
- Permission is hereby granted, free of charge, to any person obtaining a copy of this
- software and associated documentation files (the "Software"), to deal in the Software
- without restriction, including without limitation the rights to use, copy, modify, merge,
- publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
- to whom the Software is furnished to do so, subject to the following conditions:
-
- The above copyright notice and this permission notice shall be included in all copies or
- substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
- INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
- PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
- FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
- */
-namespace Miyagi.TwoD.Layers
-{
-    using System.ComponentModel;
-
-    using Miyagi.Common;
-    using Miyagi.Common.Data;
-    using Miyagi.Common.Resources;
-    using Miyagi.Internals;
-
-    /// <summary>
-    /// A simple 2D overlay for displaying text.
-    /// </summary>
-    public class TextOverlay : Overlay
-    {
-        #region Fields
-
-        private ColourDefinition colourDefinition;
-        private Font font;
-        private Size size;
-        private string text;
-
-        #endregion Fields
-
-        #region Constructors
-
-        /// <summary>
-        /// Initializes a new instance of the TextOverlay class.
-        /// </summary>
-        public TextOverlay()
-            : this(string.Empty)
-        {
-        }
-
-        /// <summary>
-        /// Initializes a new instance of the TextOverlay class.
-        /// </summary>
-        /// <param name="name">The name of the TextOverlay.</param>
-        public TextOverlay(string name)
-            : base(name)
-        {
-            this.Font = Font.Default;
-            this.colourDefinition = Colours.White;
-        }
-
-        #endregion Constructors
-
-        #region Properties
-
-        #region Public Properties
-
-        /// <summary>
-        /// Gets or sets the size.
-        /// </summary>
-        public Rectangle Bounds
-        {
-            get
-            {
-                return new Rectangle(this.Location, this.size == Size.Empty ? this.ViewportSize : this.size);
-            }
-
-            set
-            {
-                this.Location = value.Location;
-
-                if (this.size != value.Size)
-                {
-                    this.size = value.Size;
-                    this.DestroyElement();
-                }
-            }
-        }
-
-        /// <summary>
-        /// Gets or sets the text colour.
-        /// </summary>
-        public ColourDefinition ColourDefinition
-        {
-            get
-            {
-                return this.colourDefinition;
-            }
-
-            set
-            {
-                if (this.colourDefinition != value)
-                {
-                    this.colourDefinition = value;
-                    this.OnColourChanged();
-                }
-            }
-        }
-
-        /// <summary>
-        /// Gets or sets the font.
-        /// </summary>
-        public Font Font
-        {
-            get
-            {
-                return this.font;
-            }
-
-            set
-            {
-                ThrowHelper.CheckArgumentNull(value, "value");
-                if (this.font != value)
-                {
-                    this.font = value;
-                    this.DestroyElement();
-                }
-            }
-        }
-
-        /// <summary>
-        /// Gets or sets the displayed text.
-        /// </summary>
-        public string Text
-        {
-            get
-            {
-                return this.text;
-            }
-
-            set