Skip to content

Commit d0dfcd7

Browse files
committed
add easing functions, fixed draw_outlined_text
1 parent bea9ff1 commit d0dfcd7

File tree

11 files changed

+121
-1
lines changed

11 files changed

+121
-1
lines changed

Drawing/draw_outlined_text.gml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ var _alpha = argument[9];
2424
var _fidelity = argument[10];
2525

2626
draw_set_color(_out_color);
27-
for (var i=0; i<360; i+=360/4)
27+
for (var i=0; i<360; i+=360/_fidelity)
2828
draw_text(_x + lengthdir_x(1, i),
2929
_y + lengthdir_y(1, i),
3030
_str);

Easing/easeInCubic/easeInCubic.gml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/// @arg t
2+
/// @arg start
3+
/// @arg magnitude
4+
/// @arg duration (max_t)
5+
6+
// x = t / d
7+
// y = m * x^3 + s
8+
9+
var _t = argument[0];
10+
var _start = argument[1];
11+
var _magnitude = argument[2];
12+
var _duration = argument[3];
13+
14+
var _norm_t = _t / _duration;
15+
16+
return _magnitude * _norm_t * _norm_t *_norm_t + _start;

Easing/easeInCubic/easeInCubic.yy

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Easing/easeInQuad/easeInQuad.gml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/// @arg t
2+
/// @arg start
3+
/// @arg magnitude
4+
/// @arg duration (max_t)
5+
6+
// x = t / d
7+
// y = m * x^2 + s
8+
9+
var _t = argument[0];
10+
var _start = argument[1];
11+
var _magnitude = argument[2];
12+
var _duration = argument[3];
13+
14+
var _norm_t = _t / _duration;
15+
16+
return _magnitude * _norm_t * _norm_t + _start;

Easing/easeInQuad/easeInQuad.yy

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Easing/easeLinear/easeLinear.gml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/// @arg t
2+
/// @arg start
3+
/// @arg magnitude
4+
/// @arg duration (max_t)
5+
6+
// x = t / d
7+
// y = m * x + s
8+
9+
var _t = argument[0];
10+
var _start = argument[1];
11+
var _magnitude = argument[2];
12+
var _duration = argument[3];
13+
14+
var _norm_t = _t / _duration;
15+
16+
return _magnitude * _norm_t + _start;

Easing/easeLinear/easeLinear.yy

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/// @arg t
2+
/// @arg start
3+
/// @arg magnitude
4+
/// @arg duration (max_t)
5+
6+
// x = t / d
7+
// y = m * ((x-1)^3 + 1) + s
8+
9+
var _t = argument[0];
10+
var _start = argument[1];
11+
var _magnitude = argument[2];
12+
var _duration = argument[3];
13+
14+
var _norm_t = (_t / _duration) - 1;
15+
16+
return _magnitude * (_norm_t * _norm_t * _norm_t + 1) + _start;

Easing/easeOutCubic/easeOutCubic.yy

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Easing/easeOutQuad/easeOutQuad.gml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/// @arg t
2+
/// @arg start
3+
/// @arg magnitude
4+
/// @arg duration (max_t)
5+
6+
// x = t / d
7+
// y = -m * (x^2 - 2x) + s
8+
9+
var _t = argument[0];
10+
var _start = argument[1];
11+
var _magnitude = argument[2];
12+
var _duration = argument[3];
13+
14+
var _norm_t = _t / _duration;
15+
16+
return -_magnitude * _norm_t * (_norm_t-2) + _start;

0 commit comments

Comments
 (0)