Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_martlet_final_bg_Draw_0

(view raw script w/o annotations or w/e)
1
if live_call()
2
    return global.live_result;
3
draw_set_alpha(draw_alpha)
4
draw_set_color(make_color_rgb(31, 25, 94))
5
var offset_x = (max_size_x - (grid_size_x - bg_grid_offset)) / 2
6
var offset_y = (max_size_y - (grid_size_y - bg_grid_offset)) / 2
7
var rect_size_x = (grid_size_x - bg_grid_offset) / grid_n_x
8
var rect_size_y = (grid_size_y - bg_grid_offset) / grid_n_y
9
for (var i = 0; i <= grid_n_x; i++)
10
    draw_line_width((offset_x + i * rect_size_x), offset_y, (offset_x + i * rect_size_x), (max_size_y - offset_y), 1)
11
for (i = 0; i <= grid_n_y; i++)
12
    draw_line_width(offset_x, (offset_y + i * rect_size_y), (max_size_x - offset_x), (offset_y + i * rect_size_y), 1)
13
draw_set_color(make_color_rgb(5, 45, 89))
14
offset_x = (max_size_x - grid_size_x) / 2
15
offset_y = (max_size_y - grid_size_y) / 2
16
rect_size_x = grid_size_x / grid_n_x
17
rect_size_y = grid_size_y / grid_n_y
18
for (i = 0; i <= grid_n_x; i++)
19
    draw_line_width((offset_x + i * rect_size_x), offset_y, (offset_x + i * rect_size_x), (max_size_y - offset_y), 1)
20
for (i = 0; i <= grid_n_y; i++)
21
    draw_line_width(offset_x, (offset_y + i * rect_size_y), (max_size_x - offset_x), (offset_y + i * rect_size_y), 1)
22
if draw_shader
23
{
24
    shader_set(shader)
25
    draw_primitive_begin(4)
26
    draw_vertex(offset_x, offset_y)
27
    draw_vertex((max_size_x - offset_x + 1), offset_y)
28
    draw_vertex((max_size_x - offset_x + 1), (max_size_y - offset_y + 1))
29
    draw_vertex((max_size_x - offset_x + 1), (max_size_y - offset_y + 1))
30
    draw_vertex(offset_x, (max_size_y - offset_y + 1))
31
    draw_vertex(offset_x, offset_y)
32
    draw_primitive_end()
33
    shader_set_uniform_f(u_size, power(1.7, ((1 - global.current_hp_enemy / 1000) * 10 - 5)))
34
    shader_reset()
35
}
36
for (i = 0; i < array_length(stars); i++)
37
    draw_sprite(spr_martlet_final_background_stars, stars[i][2], stars[i][0], stars[i][1])
38
draw_set_alpha(1)