From 2d73d204e1b549ece7551b865bfd1047adf950d2 Mon Sep 17 00:00:00 2001 From: Recrown Date: Fri, 8 Mar 2019 10:17:37 -0600 Subject: [PATCH] Updated text button to use new centering setup. Also minor refactor. --- .../UI/Modular/Modules/Interactive/TextButton.cs | 3 ++- RecrownedAthenaeum/UI/Modular/Modules/Text.cs | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/RecrownedAthenaeum/UI/Modular/Modules/Interactive/TextButton.cs b/RecrownedAthenaeum/UI/Modular/Modules/Interactive/TextButton.cs index 67b8579..229ac62 100644 --- a/RecrownedAthenaeum/UI/Modular/Modules/Interactive/TextButton.cs +++ b/RecrownedAthenaeum/UI/Modular/Modules/Interactive/TextButton.cs @@ -35,6 +35,7 @@ namespace RecrownedAthenaeum.UI.Modular.Modules.Interactive { this.text = new Text(font, text); this.text.autoScale = true; + this.text.centered = true; } /// @@ -49,6 +50,7 @@ namespace RecrownedAthenaeum.UI.Modular.Modules.Interactive TextButtonSkinDefinition skinDefinition = skin.ObtainDefinition(definitionName); this.text = new Text(font, text); this.text.autoScale = true; + this.text.centered = true; FontColor = skin.GetColor(skinDefinition.fontColor); } @@ -76,7 +78,6 @@ namespace RecrownedAthenaeum.UI.Modular.Modules.Interactive { text.bounds = bounds; text.Update(gameTime); - text.CenterIn(TrueBounds); base.Update(gameTime); } diff --git a/RecrownedAthenaeum/UI/Modular/Modules/Text.cs b/RecrownedAthenaeum/UI/Modular/Modules/Text.cs index edf3cda..78e4360 100644 --- a/RecrownedAthenaeum/UI/Modular/Modules/Text.cs +++ b/RecrownedAthenaeum/UI/Modular/Modules/Text.cs @@ -22,7 +22,7 @@ namespace RecrownedAthenaeum.UI.Modular.Modules /// /// Centers the text int bounds. /// - public bool center; + public bool centered; /// /// Whether or not to try and wrap text automatically. Meaning will check and attempt to wrap every update. @@ -73,7 +73,7 @@ namespace RecrownedAthenaeum.UI.Modular.Modules if (useEllipses) AttemptToApplyEllipsis(); if (autoWrap) AttemptToWrapText(); if (autoScale) AttemptToScaleFont(); - if (center) Center(); + if (centered) Center(); base.Update(gameTime); }