aboutsummaryrefslogtreecommitdiff
path: root/source/ui/properties
diff options
context:
space:
mode:
authorhazel <hazel@hazelthats.me>2026-01-26 22:04:39 +0100
committerhazel <hazel@hazelthats.me>2026-01-26 22:04:39 +0100
commit567c422f8cd42eba2437f9a8c2522716a1649be7 (patch)
tree93c5b296f3b7c14b626d0aadf5cad37764c41c74 /source/ui/properties
downloadcelesteia-567c422f8cd42eba2437f9a8c2522716a1649be7.tar.gz
celesteia-567c422f8cd42eba2437f9a8c2522716a1649be7.tar.bz2
celesteia-567c422f8cd42eba2437f9a8c2522716a1649be7.zip
celesteia archive, last updated april 9th 2024
Signed-off-by: hazel <hazel@hazelthats.me>
Diffstat (limited to 'source/ui/properties')
-rw-r--r--source/ui/properties/TextProperties.cs62
1 files changed, 62 insertions, 0 deletions
diff --git a/source/ui/properties/TextProperties.cs b/source/ui/properties/TextProperties.cs
new file mode 100644
index 0000000..2ee4deb
--- /dev/null
+++ b/source/ui/properties/TextProperties.cs
@@ -0,0 +1,62 @@
+using Celesteia.Resources;
+using Celesteia.Resources.Management;
+using Microsoft.Xna.Framework;
+
+namespace Celesteia.UI.Properties {
+ public struct TextProperties {
+ private string _text;
+ private FontType _font;
+ private Color _textColor;
+ private float _fontSize;
+ private TextAlignment _textAlignment;
+
+ public TextProperties Standard() {
+ _text = "";
+ _font = ResourceManager.Fonts.DEFAULT;
+ _textColor = Color.White;
+ _fontSize = 16f;
+ _textAlignment = TextAlignment.Center;
+
+ return this;
+ }
+
+ public TextProperties SetText(string text) {
+ _text = text;
+ return this;
+ }
+ public string GetText() => _text;
+
+ public TextProperties SetFont(FontType font) {
+ _font = font;
+ return this;
+ }
+ public FontType GetFont() => _font;
+
+ public TextProperties SetColor(Color textColor) {
+ _textColor = textColor;
+ return this;
+ }
+ public Color GetColor() => _textColor;
+
+ public TextProperties SetFontSize(float fontSize) {
+ _fontSize = fontSize;
+ return this;
+ }
+ public float GetFontSize() => _fontSize;
+
+ public TextProperties SetTextAlignment(TextAlignment textAlignment) {
+ _textAlignment = textAlignment;
+ return this;
+ }
+ public TextAlignment GetAlignment() => _textAlignment;
+
+ public TextProperties Clone() {
+ return new TextProperties()
+ .SetColor(_textColor)
+ .SetFont(_font)
+ .SetFontSize(_fontSize)
+ .SetText(_text)
+ .SetTextAlignment(_textAlignment);
+ }
+ }
+} \ No newline at end of file