17 void ControllerFadeAlpha::prepareItem(Widget* _widget)
21 _widget->setEnabledSilent(mEnabled);
23 if ((
ALPHA_MIN != mAlpha) && (!_widget->getVisible()))
26 _widget->setVisible(
true);
30 InputManager::getInstance().unlinkWidget(_widget);
32 eventPreAction(_widget,
this);
35 bool ControllerFadeAlpha::addTime(Widget* _widget,
float _time)
37 float alpha = _widget->getAlpha();
42 alpha += _time * mCoef;
45 _widget->setAlpha(alpha);
46 eventUpdateAction(_widget,
this);
50 _widget->setAlpha(mAlpha);
52 else if (mAlpha < alpha)
54 alpha -= _time * mCoef;
57 _widget->setAlpha(alpha);
58 eventUpdateAction(_widget,
this);
62 _widget->setAlpha(mAlpha);
65 eventPostAction(_widget,
this);
70 void ControllerFadeAlpha::setProperty(std::string_view _key, std::string_view _value)
74 else if (_key ==
"Coef")
76 else if (_key ==
"Enabled")
80 void ControllerFadeAlpha::setAlpha(
float _value)
85 void ControllerFadeAlpha::setCoef(
float _value)
90 void ControllerFadeAlpha::setEnabled(
bool _value)
T parseValue(std::string_view value)
constexpr float ALPHA_MIN