Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_Position.c
Go to the documentation of this file.
1 [EntityEditorProps(category: "GameScripted/GameMode")]
2 class SCR_PositionClass : GenericEntityClass
3 {
4 }
5 
7 {
8 #ifdef WORKBENCH
9  protected int m_iColor = Color.WHITE;
10  protected string m_sText = string.Empty;
11 
12  //------------------------------------------------------------------------------------------------
14  void SetColorAndText();
15 
16  //------------------------------------------------------------------------------------------------
17  override void _WB_AfterWorldUpdate(float timeSlice)
18  {
19  SetColorAndText();
20 
21  vector mat[4];
22  GetWorldTransform(mat);
23 
24  // Draw point and arrow
25  vector position = mat[3];
26  Shape pointShape = Shape.CreateSphere(m_iColor, ShapeFlags.ONCE | ShapeFlags.NOOUTLINE, position, 0.2);
27  Shape arrowShape = Shape.CreateArrow(position, position + mat[2], 0.2, m_iColor, ShapeFlags.ONCE);
28 
29  WorldEditorAPI api = _WB_GetEditorAPI();
30  if (api)
31  {
32  IEntity selectEntity = api.SourceToEntity(api.GetSelectedEntity());
33  if (!SCR_Position.Cast(selectEntity))
34  return;
35  }
36 
37  if (!m_sText.IsEmpty())
38  {
39  DebugTextWorldSpace textShape = DebugTextWorldSpace.Create(
40  GetWorld(),
41  m_sText,
42  DebugTextFlags.ONCE | DebugTextFlags.CENTER | DebugTextFlags.FACE_CAMERA,
43  position[0],
44  position[1] + 0.4,
45  position[2],
46  20.0,
47  m_iColor);
48  }
49  }
50 #endif
51 
52  //------------------------------------------------------------------------------------------------
53  // constructor
56  void SCR_Position(IEntitySource src, IEntity parent)
57  {
58  SetEventMask(EntityEvent.INIT);
59  SetFlags(EntityFlags.STATIC, true);
60  }
61 }
EntityEditorProps
enum EQueryType EntityEditorProps(category:"GameScripted/Sound", description:"THIS IS THE SCRIPT DESCRIPTION.", color:"0 0 255 255")
Definition: SCR_AmbientSoundsComponent.c:12
SCR_Position
SCR_PositionClass GenericEntityClass SCR_Position(IEntitySource src, IEntity parent)
Definition: SCR_Position.c:56
GenericEntity
SCR_GenericBoxEntityClass GenericEntity
position
vector position
Definition: SCR_DestructibleTreeV2.c:30
SCR_PositionClass
Definition: SCR_Position.c:2
m_sText
class SCR_BaseEditorAttribute m_sText
category
params category
Definition: SCR_VehicleDamageManagerComponent.c:180