4#include <Malena/Engine/Events/EventsManager.h>
68 float duration = 0.5f,
70 std::function<
void()> onComplete =
nullptr);
83 std::function<
void()> onComplete =
nullptr);
96 std::function<
void()> onComplete =
nullptr);
113 std::function<
void()> onComplete =
nullptr);
145 float _alpha = 255.f;
146 float _startAlpha = 255.f;
147 float _targetAlpha = 255.f;
148 float _elapsed = 0.f;
149 float _duration = 0.f;
150 bool _active =
false;
151 bool _holding =
false;
154 std::function<void()> _onComplete;
156 static float applyTween(
float t,
Tween tween);
162#include "Fadeable.tpp"
void fadeTo(uint8_t targetAlpha, float duration=0.5f, Tween tween=LINEAR, std::function< void()> onComplete=nullptr)
Animate alpha from its current value to targetAlpha.
void setAlpha(uint8_t alpha)
Set alpha immediately with no animation.
void fadeOut(float duration=0.5f, Tween tween=LINEAR, std::function< void()> onComplete=nullptr)
Animate alpha from its current value to 0 (fully transparent).
bool isFading() const
Return true while a fade or hold animation is running.
uint8_t getAlpha() const
Return the current alpha as a uint8_t (0–255).
void fadeIn(float duration=0.5f, Tween tween=LINEAR, std::function< void()> onComplete=nullptr)
Animate alpha from 0 to 255 (fully opaque).
void holdFor(float duration, std::function< void()> onComplete=nullptr)
Hold at the current alpha for duration seconds, then fire onComplete.
Empty marker base class for all Malena traits.
Tween
Easing curve selection for animated movement.
@ LINEAR
Constant-speed interpolation.