Skip to content

Commit 7872eaa

Browse files
committed
easings
1 parent 497b60a commit 7872eaa

File tree

23 files changed

+507
-7
lines changed

23 files changed

+507
-7
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
draw_set_font(fnt_title);
2+
draw_text(16, 16, "Easings Demo");

current-scripts/Demos/useful-scripts/objects/obj_easing_demo/obj_easing_demo.yy

Lines changed: 33 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
surface_free(surf);
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
reset_graph = function() {
2+
surface_set_target(surf);
3+
draw_clear_alpha(c_black, 0);
4+
draw_set_colour(c_aqua);
5+
draw_line(0, 0, 0, surf_height-1);
6+
draw_set_colour(c_fuchsia);
7+
draw_line(0, surf_height-1, surf_width, surf_height-1);
8+
surface_reset_target();
9+
}
10+
11+
surf = surface_create(surf_width, surf_height);
12+
reset_graph();
13+
14+
t = new DynamicValue(0, 1, 0, surf_width, DVLimitMode.CEILING);
15+
ev = 0;
16+
easing_func_id = asset_get_index(easing_func);
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
draw_surface(surf, x, y);
2+
draw_set_valign(fa_center);
3+
draw_set_font(fnt_demo);
4+
draw_set_colour(c_white);
5+
draw_text(x + surf_width + 10, y + surf_height/2, label);
6+
7+
draw_circle(x + t.v, y + ev, 4, false);
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
if (!surface_exists(surf)) {
2+
surf = surface_create(surf_width, surf_height);
3+
reset_graph();
4+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
t.update();
2+
ev = surf_height - script_execute(easing_func_id, 0, surf_height, t.v / t.max_v) - 1;
3+
4+
if (t.v < t.max_v) {
5+
surface_set_target(surf);
6+
draw_set_colour(c_white);
7+
draw_point(t.v, ev);
8+
surface_reset_target();
9+
}

current-scripts/Demos/useful-scripts/objects/obj_easing_tester/obj_easing_tester.yy

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

0 commit comments

Comments
 (0)