DayZ 1.24
Loading...
Searching...
No Matches
MainMenuButtonEffect.c
Go to the documentation of this file.
2{
5 protected float m_textProportion;
6 protected float m_textProportion2;
9
10 // -----------------------------------------------------------
12 {
13 if (GetGame())
14 GetGame().GetUpdateQueue(CALL_CATEGORY_GUI).Insert(this.Update);
15 m_anim = new AnimatorTimer();
16 }
17
18 // -----------------------------------------------------------
20 {
21 if (GetGame() && GetGame().GetUpdateQueue(CALL_CATEGORY_GUI))
22 GetGame().GetUpdateQueue(CALL_CATEGORY_GUI).Remove(this.Update);
23 }
24
25 // -----------------------------------------------------------
27 {
28 m_root = w;
29 m_root.SetHandler(this);
30 }
31
32 // -----------------------------------------------------------
33 protected void Update(float tDelta)
34 {
35 m_anim.Tick(tDelta);
36 float p = amount * m_anim.GetValue();
37 //m_root.SetTextProportion( m_textProportion + (p * 0.5) );
38 m_root.SetTextOffset(p * 4, 0);
39
40 float c = 1.0 - m_anim.GetValue();
41 m_root.SetTextColor(ARGBF(1, 1, c, c));
42 }
43
44 // -----------------------------------------------------------
45 override bool OnFocus(Widget w, int x, int y)
46 {
47 //if ( !m_anim.IsRunning() ) m_textProportion = m_root.GetTextProportion();
48 if (!m_anim.IsRunning())
50 m_anim.Animate(1.0, speed);
51
52 return false;
53 }
54
55 // -----------------------------------------------------------
56 override bool OnFocusLost(Widget w, int x, int y)
57 {
58 m_anim.Animate(0.0, speed);
59 return false;
60 }
61};
Icon x
Icon y
void Update(float tDelta)
override bool OnFocusLost(Widget w, int x, int y)
ref AnimatorTimer m_anim
override bool OnFocus(Widget w, int x, int y)
void OnWidgetScriptInit(ButtonWidget w)
map: item x vector(index, width, height)
Definition EnWidgets.c:651
proto native CGame GetGame()
const int CALL_CATEGORY_GUI
Definition tools.c:9
int ARGBF(float fa, float fr, float fg, float fb)
Converts <0.0, 1.0> ARGB into color.
Definition proto.c:332