18 enum class Action : uint8_t {
25 [[nodiscard]]
virtual Action step() = 0;
26 virtual void beginDraw()
const = 0;
27 virtual void endDraw()
const = 0;
47 Action step()
override;
48 void beginDraw()
const override;
49 void endDraw()
const override;
62 Action step()
override;
63 void beginDraw()
const override;
64 void endDraw()
const override;
75 Action step()
override;
79 void endDraw()
const override;
89 Action step()
override;
90 void beginDraw()
const override;
91 void endDraw()
const override;
Contains jngl::Vec2 class.
Base class for effects that can be applied to jngl::Widget.
virtual void updateModelview(Mat3 &modelview) const
Called before drawing the widget.
Executes a specific action, e.g. removes the Widget.
void beginDraw() const override
Does nothing.
UpdateModelview(std::function< void(float t, Mat3 &)>)
Pass a function that gets the time the effect is in use and a reference to the Modelview so that it c...
void updateModelview(Mat3 &modelview) const override
Called before drawing the widget.
Scales the ModelView matrix.
Zoom(std::function< float(float)>)
f(t)
float elastic(float)
Overshoots past 1 and oscillates back, like a spring settling into place.
float linear(float)
Easing functions f(t) mapping t in [0, 1] to a value in [0, 1] (values outside this range are clamped...
float cubic(float)
Ease-out: starts fast, decelerates into the target (1 - (1 - t)^3).
float expo(float)
Ease-out like cubic(), but with a sharper start and flatter tail.
jngl::Mat3 modelview()
Returns a copy of the global ModelView matrix.