Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_smallface_Draw_0

(view raw script w/o annotations or w/e)
1
var drawsurf = 0;
2
if (global.darkzone == 0)
3
    drawsurf = 1;
4
var cxoff = 0;
5
var cyoff = 0;
6
var __cx = camerax();
7
var __cy = cameray();
8
if (drawsurf)
9
{
10
    if (!surface_exists(surf))
11
        surf = surface_create(640, 480);
12
    surface_set_target(surf);
13
    draw_clear_alpha(c_black, 0);
14
    cxoff = -__cx;
15
    cyoff = -__cy;
16
    if (i_ex(writergod) && writergod.y < (__cy + 120))
17
        cyoff -= 153;
18
}
19
var truex = x + cxoff;
20
var truey = y + cyoff;
21
if (facealpha < 1)
22
    facealpha += 0.2;
23
draw_sprite_ext(sprite_index, image_index, truex, truey, image_xscale, image_yscale, image_angle, image_blend, facealpha);
24
draw_set_alpha(facealpha);
25
if (type == 0 || type == 3)
26
{
27
    
scr_84_set_draw_font
scr_84_set_draw_font

function
scr_84_set_draw_font(arg0)
{ global.chemg_font = arg0; draw_set_font(
scr_84_get_font(arg0));
}
("main");
28
    draw_set_color(mycolor);
29
    draw_text(truex + 70, truey + 10, string_hash_to_newline(mystring));
30
}
31
if (type == 1 && active == 1 && getrid == 0)
32
{
33
    
scr_84_set_draw_font
scr_84_set_draw_font

function
scr_84_set_draw_font(arg0)
{ global.chemg_font = arg0; draw_set_font(
scr_84_get_font(arg0));
}
("main");
34
    draw_set_color(mycolor);
35
    draw_text(truex + 70, truey + 15, string_hash_to_newline(mystring));
36
    finished = 1;
37
}
38
if (type == 2 || type == 4)
39
{
40
    if (active == 1)
41
    {
42
        
scr_84_set_draw_font
scr_84_set_draw_font

function
scr_84_set_draw_font(arg0)
{ global.chemg_font = arg0; draw_set_font(
scr_84_get_font(arg0));
}
("main");
43
        draw_set_color(mycolor);
44
        if (finished == 0)
45
        {
46
            partstring += string_char_at(mystring, part);
47
            part += 1;
48
            if (part >= (string_length(mystring) + 1))
49
                finished = 1;
50
        }
51
        draw_text(truex + 70 + random(1), truey + 15 + random(1), string_hash_to_newline(partstring));
52
    }
53
}
54
draw_set_alpha(1);
55
if (drawsurf)
56
{
57
    surface_reset_target();
58
    if (i_ex(writergod))
59
        draw_surface_ext(surf, __cx, __cy, 0.5, 0.5, 0, c_white, 1);
60
    surface_free(surf);
61
}
62
if (i_ex(writergod))
63
{
64
    if (finished == 1 && getrid == 0)
65
        finished = 2;
66
}
67
else
68
{
69
    instance_destroy();
70
}
71
if (getrid == 1)
72
{
73
    direction = -nowdir;
74
    speed += 2;
75
    if (type == 3 || type == 4)
76
        instance_destroy();
77
}