Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_texturescroller_library_Draw_0

(view raw script w/o annotations or w/e)
1
var _cx = camerax();
2
var _cy = cameray();
3
if (!surface_exists(surf_textured))
4
    surf_textured = surface_create(640, 480);
5
surface_set_target(surf_textured);
6
draw_clear_alpha(c_black, 0);
7
gpu_set_colorwriteenable(true, true, true, false);
8
draw_sprite_tiled(base_texture, 0, 0, 0);
9
draw_set_alpha(
scr_wave
scr_wave

function
scr_wave(arg0, arg1, arg2, arg3)
{ var a4 = (arg1 - arg0) * 0.5; return arg0 + a4 + (sin((((current_time * 0.001) + (arg2 * arg3)) / arg2) * (2 * pi)) * a4); }
(fade_from, fade_to, fade_time_seconds, 0));
10
var _timeoffset = current_time * 0.05;
11
draw_sprite_tiled(base_texture, 1, 0, 0);
12
draw_sprite_tiled(scroll_texture, 0, -_cx - _timeoffset, -_cy - _timeoffset);
13
draw_set_blend_mode(bm_normal);
14
draw_set_alpha(1);
15
gpu_set_colorwriteenable(true, true, true, true);
16
gpu_set_colorwriteenable(false, false, false, true);
17
with (tile_object)
18
    draw_sprite_ext(sprite_index, image_index, x - _cx, y - _cy, image_xscale, image_yscale, image_angle, image_blend, image_alpha);
19
gpu_set_colorwriteenable(true, true, true, true);
20
surface_reset_target();
21
draw_surface(surf_textured, _cx, _cy);