Survivalcraft API 1.8.2.3 v1.8.2.3
Survivalcraft 2.4
载入中...
搜索中...
未找到
LabelWidget.cs
浏览该文件的文档.
1using Engine.Media;
2
3namespace Game {
4 public class LabelWidget : FontTextWidget {
5 public static BitmapFont m_bitmapFont;
6
7 public static BitmapFont BitmapFont {
8 get => m_bitmapFont ??= ContentManager.Get<BitmapFont>("Fonts/Pericles");
9 set => m_bitmapFont = value;
10 }
11
12 public override string Text {
13 get => m_text;
14 set {
15 if (m_text != value
16 && value != null) {
17 if (value.StartsWith('[')
18 && value.EndsWith(']')) {
19 string[] xp = value.Substring(1, value.Length - 2).Split(':');
20 m_text = xp.Length == 2 ? LanguageControl.GetContentWidgets(xp[0], xp[1]) : LanguageControl.Get("Usual", value);
21 }
22 else {
23 m_text = value;
24 }
25 m_linesSize = null;
26 }
27 }
28 }
29
31 }
32}
static object Get(Type type, string name)
static BitmapFont m_bitmapFont
override string Text
static BitmapFont BitmapFont
static string GetContentWidgets(string name, string prop)
static string Get(string className, int key)
获取在当前语言类名键对应的字符串