Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_tenna_tv_time_Draw_0

(view raw script w/o annotations or w/e)
1
if (!is_active)
2
    exit;
3
if (!intro_mode)
4
    
scr_dbox
scr_dbox

function
scr_dbox()
{ xxx = camerax(); yyy = cameray(); if (global.darkzone == 0) { var off = side * 155; draw_sprite_ext(spr_pxwhite, 0, xxx + 16, yyy + 5 + off, 289, 76, 0, c_white, 1); draw_sprite_ext(spr_pxwhite, 0, xxx + 19, yyy + 8 + off, 283, 70, 0, c_black, 1); } if (global.darkzone == 1) { if (side == 0) { draw_set_color(c_black); draw_rectangle(xxx + 38, yyy + 16, xxx + 602, yyy + 154, false);
scr_darkbox((xxx + 32) - 8, (yyy + 10) - 8, xxx + 608 + 8, yyy + 160 + 8);
} else { draw_set_color(c_black); draw_rectangle(xxx + 38, yyy + 326, xxx + 602, yyy + 464, false);
scr_darkbox((xxx + 32) - 8, (yyy + 320) - 8, xxx + 608 + 8, yyy + 470 + 8);
} } }
();
5
lights_anim += lights_anim_speed;
6
draw_sprite_ext(spr_dw_tv_time_lights, lights_anim, x_pos, y_pos, 1 * room_scale, 1 * room_scale, 0, c_white, 1);
7
draw_set_color(c_black);
8
if (lights_max == 4)
9
    ossafe_fill_rectangle(x_pos, y_pos, x_pos + (165 * room_scale), y_pos + (130 * room_scale));
10
if (lights_max >= 3)
11
    ossafe_fill_rectangle(x_pos + (165 * room_scale), y_pos, x_pos + (210 * room_scale), y_pos + (130 * room_scale));
12
if (lights_max >= 2)
13
    ossafe_fill_rectangle(x_pos + (210 * room_scale), y_pos, x_pos + (310 * room_scale), y_pos + (130 * room_scale));
14
if (lights_max >= 1)
15
    ossafe_fill_rectangle(x_pos + (310 * room_scale), y_pos, x_pos + (500 * room_scale), y_pos + (130 * room_scale));
16
for (var i = 0; i < tv_max; i++)
17
{
18
    tv_text[i][1].x = 
scr_movetowards
scr_movetowards

function
scr_movetowards(arg0, arg1, arg2)
{ if (arg0 == arg1) return arg0; else if (arg0 > arg1) return max(arg0 - arg2, arg1); else return min(arg0 + arg2, arg1); } function scr_obj_movetowards_obj(arg0, arg1, arg2 = 0, arg3 = 0) { scr_obj_movetowards_point(arg0.x + arg2, arg0.y + arg3, arg1); } function scr_obj_movetowards_point(arg0, arg1, arg2) { var _distance = point_distance(x, y, arg0, arg1); if (arg2 >= _distance) { x = arg0; y = arg1; } else { var _direction = point_direction(x, y, arg0, arg1); x += lengthdir_x(arg2, _direction); y += lengthdir_y(arg2, _direction); } }
(tv_text[i][1].x, 1 * room_scale, 0.4 * tv_pitch);
19
    tv_text[i][1].y = 
scr_movetowards
scr_movetowards

function
scr_movetowards(arg0, arg1, arg2)
{ if (arg0 == arg1) return arg0; else if (arg0 > arg1) return max(arg0 - arg2, arg1); else return min(arg0 + arg2, arg1); } function scr_obj_movetowards_obj(arg0, arg1, arg2 = 0, arg3 = 0) { scr_obj_movetowards_point(arg0.x + arg2, arg0.y + arg3, arg1); } function scr_obj_movetowards_point(arg0, arg1, arg2) { var _distance = point_distance(x, y, arg0, arg1); if (arg2 >= _distance) { x = arg0; y = arg1; } else { var _direction = point_direction(x, y, arg0, arg1); x += lengthdir_x(arg2, _direction); y += lengthdir_y(arg2, _direction); } }
(tv_text[i][1].y, 1 * room_scale, 0.4 * tv_pitch);
20
    draw_sprite_ext(tv_text[i][0], 0, tv_text[i][2].x, tv_text[i][2].y, tv_text[i][1].x, tv_text[i][1].y, 0, c_white, 1);
21
}