DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
MainMenuButtonEffect.c
См. документацию.
2{
3 reference float speed;
4 reference float amount;
5 protected float m_textProportion;
6 protected float m_textProportion2;
7 protected ButtonWidget m_root;
8 protected ref AnimatorTimer m_anim;
9
10 // -----------------------------------------------------------
12 {
13 if ( GetGame() )
14 {
16 }
17 m_anim = new AnimatorTimer();
18 }
19
20 // -----------------------------------------------------------
22 {
23 if ( GetGame() && GetGame().GetUpdateQueue(CALL_CATEGORY_GUI) )
24 {
26 }
27 }
28
29 // -----------------------------------------------------------
30 void OnWidgetScriptInit(ButtonWidget w)
31 {
32 m_root = w;
33 m_root.SetHandler(this);
34 }
35
36 // -----------------------------------------------------------
37 protected void Update(float tDelta)
38 {
39 m_anim.Tick(tDelta);
40 float p = amount * m_anim.GetValue();
41 //m_root.SetTextProportion( m_textProportion + (p * 0.5) );
42 m_root.SetTextOffset( p * 4, 0 );
43
44 float c = 1.0 - m_anim.GetValue();
45 m_root.SetTextColor(ARGBF(1, 1, c, c));
46 }
47
48 // -----------------------------------------------------------
49 override bool OnFocus(Widget w, int x, int y)
50 {
51 //if ( !m_anim.IsRunning() ) m_textProportion = m_root.GetTextProportion();
52 if ( !m_anim.IsRunning() )
53 {
55 }
56 m_anim.Animate(1.0, speed);
57
58 return false;
59 }
60
61 // -----------------------------------------------------------
62 override bool OnFocusLost(Widget w, int x, int y)
63 {
64 m_anim.Animate(0.0, speed);
65 return false;
66 }
67};
Icon x
Icon y
Определения tools.c:749
override ScriptInvoker GetUpdateQueue(int call_category)
Определения DayZGame.c:1192
reference float speed
Определения MainMenuButtonEffect.c:3
float m_textProportion
Определения MainMenuButtonEffect.c:5
void Update(float tDelta)
Определения MainMenuButtonEffect.c:37
void MainMenuButtonEffect()
Определения MainMenuButtonEffect.c:11
override bool OnFocusLost(Widget w, int x, int y)
Определения MainMenuButtonEffect.c:62
ButtonWidget m_root
Определения MainMenuButtonEffect.c:7
reference float amount
Определения MainMenuButtonEffect.c:4
void ~MainMenuButtonEffect()
Определения MainMenuButtonEffect.c:21
ref AnimatorTimer m_anim
Определения MainMenuButtonEffect.c:8
override bool OnFocus(Widget w, int x, int y)
Определения MainMenuButtonEffect.c:49
void OnWidgetScriptInit(ButtonWidget w)
Определения MainMenuButtonEffect.c:30
float m_textProportion2
Определения MainMenuButtonEffect.c:6
proto bool Remove(func fn, int flags=EScriptInvokerRemoveFlags.ALL)
remove specific call from list
proto bool Insert(func fn, int flags=EScriptInvokerInsertFlags.IMMEDIATE)
insert method to list
map: item x vector(index, width, height)
Определения EnWidgets.c:651
Определения EnWidgets.c:190
proto native CGame GetGame()
const int CALL_CATEGORY_GUI
Определения tools.c:9
int ARGBF(float fa, float fr, float fg, float fb)
Converts <0.0, 1.0> ARGB into color.
Определения proto.c:332