draw_set_font(global.font_main); // Dinamiski aprēķināt izvēlnes platumu un augstumu var _new_w = 0; for (var i = 0; i < op_length; i++) { var _op_w = string_width(option[menu_level, i]); _new_w = max(_new_w, _op_w); } width = _new_w + op_border * 2; height = op_border * 2 + string_height(option[0, 0]) + (op_length - 1) * op_space; // Izvēlnes horizontāla centrēšana x = camera_get_view_x(view_camera[0]) + camera_get_view_width(view_camera[0]) / 2 - width / 2; // Y pozīcijas pielāgošana atkarībā no izvēlnes līmeļa switch (menu_level) { case 0: // Galvenā izvēlne case 1: // Iestatījumu izvēlne y = camera_get_view_y(view_camera[0]) + camera_get_view_height(view_camera[0]) / 2 - height / 2; break; case 2: // Loga izmēra apakšizvēlne y = camera_get_view_y(view_camera[0]) + camera_get_view_height(view_camera[0]) / 2 - height / 2; break; } // Izvēlnes fona zīmēšana draw_sprite_ext(sprite_index, image_index, x, y, width / sprite_width, height / sprite_height, 0, c_white, 1); // Opciju zīmēšana draw_set_valign(fa_top); draw_set_halign(fa_left); for (var i = 0; i < op_length; i++) { var _c = c_white; if (pos == i) { _c = c_yellow; } var display_text = option[menu_level, i]; // Modificēt "Fullscreen" opciju loga izmēra apakšizvēlnē (menu_level 2) if (menu_level == 2 && i == 1) { // Fullscreen opcija // Mainīt tekstu starp "Fullscreen" un "Windowed" display_text = "Window mode: " + (global.fullscreen_enabled ? "Fullscreen" : "Windowed"); } draw_text_color(x + op_border, y + op_border + op_space * i, display_text, _c, _c, _c, _c, 1); }