Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_LabelComponent.c
Go to the documentation of this file.
2 {
3  [Attribute("Label's text")]
4  protected string m_sLabel;
5 
6  [Attribute("30")]
7  protected float m_fPaddingTop;
8 
9  protected TextWidget m_wLabelWidget;
10 
11  //------------------------------------------------------------------------------------------------
12  override void HandlerAttached(Widget w)
13  {
14  super.HandlerAttached(w);
15 
16  if (!w)
17  return;
18 
19  m_wLabelWidget = TextWidget.Cast(w.FindAnyWidget("Label"));
20  ResetTopPadding();
21  SetText(m_sLabel);
22  }
23 
24  //------------------------------------------------------------------------------------------------
25  void SetText(string text)
26  {
27  m_wLabelWidget.SetText(text);
28  }
29 
30  //------------------------------------------------------------------------------------------------
31  void SetTopPadding(float padding)
32  {
33  if (!m_wLabelWidget)
34  return;
35 
36  float left, top, right, bottom;
37  AlignableSlot.GetPadding(m_wLabelWidget, left, top, right, bottom);
38  AlignableSlot.SetPadding(m_wLabelWidget, left, padding, right, bottom);
39  }
40 
41  //------------------------------------------------------------------------------------------------
42  void ResetTopPadding()
43  {
44  SetTopPadding(m_fPaddingTop);
45  }
46 
47  //------------------------------------------------------------------------------------------------
48  void SetVisible(bool visible)
49  {
50  if (!m_wLabelWidget)
51  return;
52 
53  m_wLabelWidget.SetVisible(visible);
54  }
55 
56  //------------------------------------------------------------------------------------------------
57  static SCR_LabelComponent FindLabelComponent(notnull Widget w)
58  {
59  return SCR_LabelComponent.Cast(w.FindHandler(SCR_LabelComponent));
60  }
61 
62  //------------------------------------------------------------------------------------------------
65  static SCR_LabelComponent GetComponent(string name, Widget parent, bool searchAllChildren = true)
66  {
67  return SCR_LabelComponent.Cast(SCR_ScriptedWidgetComponent.GetComponent(SCR_LabelComponent, name, parent, searchAllChildren));
68  }
69 };
SCR_LabelComponent
Definition: SCR_LabelComponent.c:1
Attribute
typedef Attribute
Post-process effect of scripted camera.
SCR_ScriptedWidgetComponent
Definition: SCR_ScriptedWidgetComponent.c:7