DayZ
1.27
DayZ Explorer by KGB
Загрузка...
Поиск...
Не найдено
HoverEffect.c
См. документацию.
1
// -----------------------------------------------------------
2
class
HoverEffect
:
ScriptedWidgetEventHandler
3
{
4
reference
float
speed
;
5
reference
float
amount
;
6
protected
float
m_orginal_width
;
7
protected
float
m_orginal_height
;
8
protected
Widget
m_root
;
9
protected
ref
AnimatorTimer
m_anim
;
10
11
void
HoverEffect
()
12
{
13
m_anim
=
new
AnimatorTimer
();
14
}
15
16
// -----------------------------------------------------------
17
void
OnWidgetScriptInit
(
Widget
w)
18
{
19
m_root
= w;
20
m_root
.SetHandler(
this
);
21
}
22
23
// -----------------------------------------------------------
24
protected
void
Update
()
25
{
26
float
p =
amount
*
m_anim
.GetValue();
27
m_root
.SetSize(
m_orginal_width
+ (
m_orginal_width
* p),
m_orginal_height
+ (
m_orginal_height
* p));
28
29
float
c = 1.0 - (0.5 *
m_anim
.GetValue());
30
m_root
.SetColor(
ARGBF
(1, 1, c, c));
31
}
32
33
// -----------------------------------------------------------
34
override
bool
OnMouseEnter
(
Widget
w,
int
x
,
int
y
)
35
{
36
if
( !
m_anim
.IsRunning() )
m_root
.GetSize(
m_orginal_width
,
m_orginal_height
);
37
m_anim
.Animate(1.0,
speed
);
38
39
return
false
;
40
}
41
42
// -----------------------------------------------------------
43
override
bool
OnMouseLeave
(
Widget
w,
Widget
enterW,
int
x
,
int
y
)
44
{
45
m_anim
.Animate(0.0,
speed
);
46
return
false
;
47
}
48
49
};
x
Icon x
y
Icon y
AnimatorTimer
Определения
tools.c:749
HoverEffect::OnMouseEnter
override bool OnMouseEnter(Widget w, int x, int y)
Определения
HoverEffect.c:34
HoverEffect::speed
reference float speed
Определения
HoverEffect.c:4
HoverEffect::m_anim
ref AnimatorTimer m_anim
Определения
HoverEffect.c:9
HoverEffect::OnMouseLeave
override bool OnMouseLeave(Widget w, Widget enterW, int x, int y)
Определения
HoverEffect.c:43
HoverEffect::OnWidgetScriptInit
void OnWidgetScriptInit(Widget w)
Определения
HoverEffect.c:17
HoverEffect::m_root
Widget m_root
Определения
HoverEffect.c:8
HoverEffect::amount
reference float amount
Определения
HoverEffect.c:5
HoverEffect::m_orginal_width
float m_orginal_width
Определения
HoverEffect.c:6
HoverEffect::m_orginal_height
float m_orginal_height
Определения
HoverEffect.c:7
HoverEffect::Update
void Update()
Определения
HoverEffect.c:24
HoverEffect::HoverEffect
void HoverEffect()
Определения
HoverEffect.c:11
ScriptedWidgetEventHandler
map: item x vector(index, width, height)
Определения
EnWidgets.c:651
Widget
Определения
EnWidgets.c:190
ARGBF
int ARGBF(float fa, float fr, float fg, float fb)
Converts <0.0, 1.0> ARGB into color.
Определения
proto.c:332
Ishodniki
scripts
3_Game
GUI
Effects
HoverEffect.c
Создано системой
1.13.2