Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_FadeInOutEffect.c
Go to the documentation of this file.
2 {
3  //Widget
4  private ImageWidget m_wFadeInOut;
5 
6  //------------------------------------------------------------------------------------------------
7  override void DisplayStartDraw(IEntity owner)
8  {
9  m_wFadeInOut = ImageWidget.Cast(m_wRoot.FindAnyWidget("FadeOut"));
10  }
11 
12  //------------------------------------------------------------------------------------------------
15  void FadeOutEffect(bool fadeDirection, float seconds = 0.35)
16  {
17  if (seconds <= 0)
18  return;
19 
20  float targetVal;
21  if (fadeDirection)
22  {
23  m_wFadeInOut.SetOpacity(0);
24  targetVal = 1;
25  }
26  else
27  {
28  m_wFadeInOut.SetOpacity(1);
29  }
30 
31  GetGame().GetCallqueue().CallLater(AnimateWidget.Opacity, 0, false, m_wFadeInOut, targetVal, 1/seconds, true); // this is delayed by frame so there is at least one visible frame of opacity = 1
32  }
33 };
m_wRoot
protected Widget m_wRoot
Definition: SCR_ScenarioFrameworkLayerTaskDefend.c:59
SCR_BaseScreenEffect
Definition: SCR_BaseScreenEffect.c:1
SCR_FadeInOutEffect
Definition: SCR_FadeInOutEffect.c:1
GetGame
ArmaReforgerScripted GetGame()
Definition: game.c:1424