Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_MapMarkerDynamicWComponent.c
Go to the documentation of this file.
3 {
4  protected int m_iLayerID; // map layer ID
5  protected ImageWidget m_wMarkerIcon;
6  protected TextWidget m_wMarkerText;
7  protected SCR_MapMarkerEntity m_MarkerEnt;
8 
9  //------------------------------------------------------------------------------------------------
11  void SetMarkerEntity(notnull SCR_MapMarkerEntity marker)
12  {
13  m_MarkerEnt = marker;
14  }
15 
16  //------------------------------------------------------------------------------------------------
17  void SetLayerID(int id)
18  {
19  m_iLayerID = id;
20  }
21 
22  //------------------------------------------------------------------------------------------------
27  void SetImage(ResourceName icon, string quad, float aspectRatio = 1, int sizeFlag = 64)
28  {
29  m_wMarkerIcon.LoadImageFromSet(0, icon, quad);
30  if (aspectRatio != 1 && aspectRatio > 0)
31  m_wMarkerIcon.SetSize(sizeFlag * 0.9, (sizeFlag / aspectRatio) * 0.9); // todo, temp size adjust before symbols group side are fixed
32  }
33 
34  //------------------------------------------------------------------------------------------------
36  void SetText(string text)
37  {
38  m_wMarkerText.SetText(text);
39  }
40 
41  //------------------------------------------------------------------------------------------------
43  void SetTextVisible(bool state)
44  {
45  m_wMarkerText.SetVisible(state);
46  }
47 
48  //------------------------------------------------------------------------------------------------
50  void SetColor(Color color)
51  {
52  m_wMarkerIcon.SetColor(color);
53  }
54 
55  //------------------------------------------------------------------------------------------------
56  override void HandlerAttached(Widget w)
57  {
58  super.HandlerAttached(w);
59 
60  m_wMarkerIcon = ImageWidget.Cast(m_wRoot.FindAnyWidget("MarkerIcon"));
61  m_wMarkerText = TextWidget.Cast(m_wRoot.FindAnyWidget("MarkerText"));
62  }
63 }
m_wRoot
protected Widget m_wRoot
Definition: SCR_ScenarioFrameworkLayerTaskDefend.c:59
SCR_MapMarkerDynamicWComponent
Attached to root of marker dynamic base layout.
Definition: SCR_MapMarkerDynamicWComponent.c:2
SCR_MapMarkerEntity
Definition: SCR_MapMarkerEntity.c:10
SCR_ScriptedWidgetComponent
Definition: SCR_ScriptedWidgetComponent.c:7