JNGL
Easy to use cross-platform 2D game library
Loading...
Searching...
No Matches
effects.hpp File Reference

Effects that can be applied to jngl::Widget. More...

#include "Vec2.hpp"
#include <cstdint>
#include <functional>
Include dependency graph for effects.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  Effect
 Base class for effects that can be applied to jngl::Widget. More...
 
class  UpdateModelview
 
class  Zoom
 Scales the ModelView matrix. More...
 
class  Executor
 Executes a specific action, e.g. removes the Widget. More...
 
class  Move
 

Namespaces

namespace  jngl
 JNGL's main namespace.
 

Functions

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 elastic (float)
 Overshoots past 1 and oscillates back, like a spring settling into place.
 
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.
 

Detailed Description

Effects that can be applied to jngl::Widget.

Definition in file effects.hpp.

Function Documentation

◆ linear()

float linear ( float )

Easing functions f(t) mapping t in [0, 1] to a value in [0, 1] (values outside this range are clamped).

They share the same shape: f(0) == 0 and f(1) == 1, only the path between differs. Constant speed, no easing.

1| / | / | / | / 0|/_________ 0 1

◆ elastic()

float elastic ( float )

Overshoots past 1 and oscillates back, like a spring settling into place.

1| /\ ___ | / \/ | / | / 0|/_________ 0 1

◆ cubic()

float cubic ( float )

Ease-out: starts fast, decelerates into the target (1 - (1 - t)^3).

1| ____-— | / | / | / 0|/_________ 0 1

◆ expo()

float expo ( float )

Ease-out like cubic(), but with a sharper start and flatter tail.

1| _------— |/ | | 0|__________ 0 1