MCPcopy Create free account
hub / github.com/MyGUI/mygui / addTime

Method addTime

MyGUIEngine/src/MyGUI_ControllerFadeAlpha.cpp:37–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35 }
36
37 bool ControllerFadeAlpha::addTime(Widget* _widget, float _time)
38 {
39 float alpha = _widget->getAlpha();
40
41 // проверяем нужно ли к чему еще стремиться
42 if (mAlpha > alpha)
43 {
44 alpha += _time * mCoef;
45 if (mAlpha > alpha)
46 {
47 _widget->setAlpha(alpha);
48 eventUpdateAction(_widget, this);
49 return true;
50 }
51
52 _widget->setAlpha(mAlpha);
53 }
54 else if (mAlpha < alpha)
55 {
56 alpha -= _time * mCoef;
57 if (mAlpha < alpha)
58 {
59 _widget->setAlpha(alpha);
60 eventUpdateAction(_widget, this);
61 return true;
62 }
63
64 _widget->setAlpha(mAlpha);
65 }
66
67 // вызываем пользовательский делегат пост обработки
68 eventPostAction(_widget, this);
69
70 return false;
71 }
72
73 void ControllerFadeAlpha::setProperty(std::string_view _key, std::string_view _value)
74 {

Callers

nothing calls this directly

Calls 2

getAlphaMethod · 0.80
setAlphaMethod · 0.45

Tested by

no test coverage detected