Survivalcraft API 1.8.2.3 v1.8.2.3
Survivalcraft 2.4
载入中...
搜索中...
未找到
LinkWidget.cs
浏览该文件的文档.
1using System.Xml.Linq;
2using Engine;
4using Engine.Media;
5
6namespace Game {
9
11
12 public Vector2 Size {
13 get => m_labelWidget.Size;
14 set => m_labelWidget.Size = value;
15 }
16
17 public bool IsClicked => m_clickableWidget.IsClicked;
18
19 public bool IsPressed => m_clickableWidget.IsPressed;
20
21 public string Text {
22 get => m_labelWidget.Text;
23 set => m_labelWidget.Text = value;
24 }
25
26 public float FontScale {
27 get => m_labelWidget.FontScale;
28 set => m_labelWidget.FontScale = value;
29 }
30
32 get => m_labelWidget.TextAnchor;
33 set => m_labelWidget.TextAnchor = value;
34 }
35
37 get => m_labelWidget.Font;
38 set => m_labelWidget.Font = value;
39 }
40
41 public Color Color {
42 get => m_labelWidget.Color;
43 set => m_labelWidget.Color = value;
44 }
45
46 public bool DropShadow {
47 get => m_labelWidget.DropShadow;
48 set => m_labelWidget.DropShadow = value;
49 }
50
51 public string Url { get; set; }
52
53 public LinkWidget() {
54 XElement node = ContentManager.Get<XElement>("Widgets/LinkContents");
55 LoadChildren(this, node);
56 m_labelWidget = Children.Find<LabelWidget>("Label");
57 m_clickableWidget = Children.Find<ClickableWidget>("Clickable");
58 LoadProperties(this, node);
59 }
60
61 public override void Update() {
62 if (!string.IsNullOrEmpty(Url) && IsClicked) {
64 }
65 }
66 }
67}
readonly WidgetsList Children
static object Get(Type type, string name)
static void LaunchBrowser(string url)
virtual void LoadProperties(object eventsTarget, XElement node)
virtual void LoadChildren(object eventsTarget, XElement node)