-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTextConfig.cs
More file actions
79 lines (60 loc) · 1.38 KB
/
TextConfig.cs
File metadata and controls
79 lines (60 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
using Godot;
using Newtonsoft.Json.Converters;
using System;
using System.Collections.Generic;
using System.Text.Json.Serialization;
namespace TextConfig
{
[JsonConverter(typeof(StringEnumConverter))]
public enum SheetSide
{
Right,
Bottom,
Left,
Top,
Internal,
Span
}
[JsonConverter(typeof(StringEnumConverter))]
public enum TextHalf
{
Left,
Right,
Both
}
public class TextParams
{
public TextParams() {}
public string Name;
public SheetSide Side = SheetSide.Right;
public TextHalf Half = TextHalf.Left;
public string Text = "Lorem ipsum\nto the\nNth1ndegree";
public Vector2 Position = new Vector2(0,0);
public float HalfPosition
{
get {
return Position.X;
}
set {
Position.X = value;
}
}
public float Rotation = 0; ///< only applies when "internal"
public Color? Color;
}
public class TextSet : Dictionary<string, TextParams>
{
}
public class SheetConfig
{
public string Name;
public Vector2 Size;
public TextSet Texts;
public string Texture;
}
public class SheetSet
{
public string Name;
public string[] Sheets;
}
}