diff --git a/RecrownedAthenaeum/UI/Modular/UIModule.cs b/RecrownedAthenaeum/UI/Modular/UIModule.cs index c9f9606..f41445d 100644 --- a/RecrownedAthenaeum/UI/Modular/UIModule.cs +++ b/RecrownedAthenaeum/UI/Modular/UIModule.cs @@ -78,10 +78,7 @@ namespace RecrownedAthenaeum.UI.Modular /// public void RemoveFromParent() { - if (Parent == null) - { - throw new InvalidOperationException("Parent is null."); - } + if (Parent == null) throw new InvalidOperationException("Parent is null."); Parent.RemoveModule(this); } @@ -104,5 +101,14 @@ namespace RecrownedAthenaeum.UI.Modular { return true; } + + /// + /// Sets the origin to be the center of the bounds. + /// + public void CenterOrigin() + { + origin.X = bounds.Width / 2f; + origin.Y = bounds.Height / 2f; + } } }