New dynamic drawer system.

This commit is contained in:
Tanasart 2025-02-13 16:54:56 +07:00
parent 6a54af2403
commit f996707b95
27 changed files with 372 additions and 260 deletions

View file

@ -33,7 +33,7 @@
{"name":"debug","order":10,"path":"folders/functions/debug.yy",},
{"name":"delaunay","order":11,"path":"folders/functions/delaunay.yy",},
{"name":"draw","order":12,"path":"folders/functions/draw.yy",},
{"name":"dynaSurf","order":20,"path":"folders/functions/draw/dynaSurf.yy",},
{"name":"dynaDraw","order":2,"path":"folders/functions/surface/dynaDraw.yy",},
{"name":"ds","order":13,"path":"folders/functions/ds.yy",},
{"name":"files","order":14,"path":"folders/functions/files.yy",},
{"name":"geometry","order":15,"path":"folders/functions/geometry.yy",},
@ -53,7 +53,7 @@
{"name":"sprite","order":29,"path":"folders/functions/sprite.yy",},
{"name":"string","order":30,"path":"folders/functions/string.yy",},
{"name":"surface","order":31,"path":"folders/functions/surface.yy",},
{"name":"dynamic_surface","order":1,"path":"folders/functions/surface/dynamic_surface.yy",},
{"name":"dynaSurf","order":1,"path":"folders/functions/surface/dynaSurf.yy",},
{"name":"svg","order":39,"path":"folders/functions/svg.yy",},
{"name":"test","order":32,"path":"folders/functions/test.yy",},
{"name":"tooltip","order":33,"path":"folders/functions/tooltip.yy",},
@ -218,7 +218,6 @@
{"name":"bool","order":2,"path":"folders/nodes/icons/value/bool.yy",},
{"name":"color","order":10,"path":"folders/nodes/icons/value/color.yy",},
{"name":"gradient","order":12,"path":"folders/nodes/icons/value/gradient.yy",},
{"name":null,"order":9,"path":"folders/panels/runner.yy",},
{"name":"matrix","order":4,"path":"folders/nodes/icons/value/matrix.yy",},
{"name":"mesh","order":9,"path":"folders/nodes/icons/value/mesh.yy",},
{"name":"number","order":1,"path":"folders/nodes/icons/value/number.yy",},
@ -271,7 +270,6 @@
{"name":"rotator","order":2,"path":"folders/widgets/rotator.yy",},
{"name":"sliders","order":3,"path":"folders/widgets/sliders.yy",},
{"name":"text","order":4,"path":"folders/widgets/text.yy",},
{"name":"runner","order":12,"path":"folders/panels/_others/runner.yy",},
],
"ResourceOrderSettings":[
{"name":"ac_disappear","order":2,"path":"animcurves/ac_disappear/ac_disappear.yy",},
@ -489,7 +487,7 @@
{"name":"binder_gamemaker_tile","order":7,"path":"scripts/binder_gamemaker_tile/binder_gamemaker_tile.yy",},
{"name":"binder_gamemaker","order":6,"path":"scripts/binder_gamemaker/binder_gamemaker.yy",},
{"name":"biterator","order":1,"path":"scripts/biterator/biterator.yy",},
{"name":"blurSurface","order":2,"path":"scripts/blurSurface/blurSurface.yy",},
{"name":"blurSurface","order":3,"path":"scripts/blurSurface/blurSurface.yy",},
{"name":"buffer_object","order":1,"path":"scripts/buffer_object/buffer_object.yy",},
{"name":"buttonAnchor","order":5,"path":"scripts/buttonAnchor/buttonAnchor.yy",},
{"name":"buttonColor","order":1,"path":"scripts/buttonColor/buttonColor.yy",},
@ -590,8 +588,8 @@
{"name":"draw_setter","order":1,"path":"scripts/draw_setter/draw_setter.yy",},
{"name":"draw_shapes","order":9,"path":"scripts/draw_shapes/draw_shapes.yy",},
{"name":"draw_sprite_ext_override","order":8,"path":"scripts/draw_sprite_ext_override/draw_sprite_ext_override.yy",},
{"name":"draw_surface_blend","order":3,"path":"scripts/draw_surface_blend/draw_surface_blend.yy",},
{"name":"draw_surface_functions","order":5,"path":"scripts/draw_surface_functions/draw_surface_functions.yy",},
{"name":"draw_surface_blend","order":4,"path":"scripts/draw_surface_blend/draw_surface_blend.yy",},
{"name":"draw_surface_functions","order":6,"path":"scripts/draw_surface_functions/draw_surface_functions.yy",},
{"name":"draw_text_delimiter","order":12,"path":"scripts/draw_text_delimiter/draw_text_delimiter.yy",},
{"name":"draw_text_function","order":10,"path":"scripts/draw_text_function/draw_text_function.yy",},
{"name":"draw_text_path","order":19,"path":"scripts/draw_text_path/draw_text_path.yy",},
@ -600,10 +598,10 @@
{"name":"ds_list","order":1,"path":"scripts/ds_list/ds_list.yy",},
{"name":"ds_priority","order":3,"path":"scripts/ds_priority/ds_priority.yy",},
{"name":"dynaSurf_3d","order":2,"path":"scripts/dynaSurf_3d/dynaSurf_3d.yy",},
{"name":"dynaSurf_circle_outline","order":1,"path":"scripts/dynaSurf_circle_outline/dynaSurf_circle_outline.yy",},
{"name":"dynaSurf_circle_outline","order":2,"path":"scripts/dynaSurf_circle_outline/dynaSurf_circle_outline.yy",},
{"name":"dynaSurf_iso","order":1,"path":"scripts/dynaSurf_iso/dynaSurf_iso.yy",},
{"name":"dynaSurf_square_fill","order":2,"path":"scripts/dynaSurf_square_fill/dynaSurf_square_fill.yy",},
{"name":"dynaSurf_square_outline","order":3,"path":"scripts/dynaSurf_square_outline/dynaSurf_square_outline.yy",},
{"name":"dynaSurf_square_fill","order":3,"path":"scripts/dynaSurf_square_fill/dynaSurf_square_fill.yy",},
{"name":"dynaSurf_square_outline","order":4,"path":"scripts/dynaSurf_square_outline/dynaSurf_square_outline.yy",},
{"name":"event_recorder","order":4,"path":"scripts/event_recorder/event_recorder.yy",},
{"name":"export_portable","order":3,"path":"scripts/export_portable/export_portable.yy",},
{"name":"fft_functions","order":1,"path":"scripts/fft_functions/fft_functions.yy",},
@ -1186,6 +1184,7 @@
{"name":"node_string_split","order":3,"path":"scripts/node_string_split/node_string_split.yy",},
{"name":"node_string_trim","order":4,"path":"scripts/node_string_trim/node_string_trim.yy",},
{"name":"node_string","order":2,"path":"scripts/node_string/node_string.yy",},
{"name":"dynaSurf_circle_fill","order":1,"path":"scripts/dynaSurf_circle_fill/dynaSurf_circle_fill.yy",},
{"name":"node_stripe","order":8,"path":"scripts/node_stripe/node_stripe.yy",},
{"name":"node_struct_get","order":1,"path":"scripts/node_struct_get/node_struct_get.yy",},
{"name":"node_struct_json_parse","order":2,"path":"scripts/node_struct_json_parse/node_struct_json_parse.yy",},
@ -1432,10 +1431,10 @@
{"name":"string_scale","order":4,"path":"scripts/string_scale/string_scale.yy",},
{"name":"string_splice","order":3,"path":"scripts/string_splice/string_splice.yy",},
{"name":"struct_functions","order":4,"path":"scripts/struct_functions/struct_functions.yy",},
{"name":"surface_draw_functions","order":8,"path":"scripts/surface_draw_functions/surface_draw_functions.yy",},
{"name":"surface_draw_functions","order":9,"path":"scripts/surface_draw_functions/surface_draw_functions.yy",},
{"name":"surface_exr_encode","order":8,"path":"scripts/surface_exr_encode/surface_exr_encode.yy",},
{"name":"surface_functions","order":6,"path":"scripts/surface_functions/surface_functions.yy",},
{"name":"surface_get_palette","order":4,"path":"scripts/surface_get_palette/surface_get_palette.yy",},
{"name":"surface_functions","order":7,"path":"scripts/surface_functions/surface_functions.yy",},
{"name":"surface_get_palette","order":5,"path":"scripts/surface_get_palette/surface_get_palette.yy",},
{"name":"surfaceBox","order":9,"path":"scripts/surfaceBox/surfaceBox.yy",},
{"name":"surfaceDynaBox","order":17,"path":"scripts/surfaceDynaBox/surfaceDynaBox.yy",},
{"name":"svg_objects","order":1,"path":"scripts/svg_objects/svg_objects.yy",},
@ -1629,6 +1628,7 @@
{"name":"sh_draw_tile_apply","order":2,"path":"shaders/sh_draw_tile_apply/sh_draw_tile_apply.yy",},
{"name":"sh_draw_tile_brush","order":3,"path":"shaders/sh_draw_tile_brush/sh_draw_tile_brush.yy",},
{"name":"sh_draw_tile_clear","order":4,"path":"shaders/sh_draw_tile_clear/sh_draw_tile_clear.yy",},
{"name":"__init_dynaDraw","order":0,"path":"scripts/__init_dynaDraw/__init_dynaDraw.yy",},
{"name":"sh_draw_tile_map","order":5,"path":"shaders/sh_draw_tile_map/sh_draw_tile_map.yy",},
{"name":"sh_draw_tile","order":1,"path":"shaders/sh_draw_tile/sh_draw_tile.yy",},
{"name":"sh_edge_detect","order":18,"path":"shaders/sh_edge_detect/sh_edge_detect.yy",},

View file

@ -71,7 +71,7 @@
{"$GMFolder":"","%Name":"debug","folderPath":"folders/functions/debug.yy","name":"debug","resourceType":"GMFolder","resourceVersion":"2.0",},
{"$GMFolder":"","%Name":"delaunay","folderPath":"folders/functions/delaunay.yy","name":"delaunay","resourceType":"GMFolder","resourceVersion":"2.0",},
{"$GMFolder":"","%Name":"draw","folderPath":"folders/functions/draw.yy","name":"draw","resourceType":"GMFolder","resourceVersion":"2.0",},
{"$GMFolder":"","%Name":"dynaSurf","folderPath":"folders/functions/draw/dynaSurf.yy","name":"dynaSurf","resourceType":"GMFolder","resourceVersion":"2.0",},
{"$GMFolder":"","%Name":"dynaDraw","folderPath":"folders/functions/surface/dynaDraw.yy","name":"dynaDraw","resourceType":"GMFolder","resourceVersion":"2.0",},
{"$GMFolder":"","%Name":"ds","folderPath":"folders/functions/ds.yy","name":"ds","resourceType":"GMFolder","resourceVersion":"2.0",},
{"$GMFolder":"","%Name":"files","folderPath":"folders/functions/files.yy","name":"files","resourceType":"GMFolder","resourceVersion":"2.0",},
{"$GMFolder":"","%Name":"geometry","folderPath":"folders/functions/geometry.yy","name":"geometry","resourceType":"GMFolder","resourceVersion":"2.0",},
@ -91,7 +91,7 @@
{"$GMFolder":"","%Name":"sprite","folderPath":"folders/functions/sprite.yy","name":"sprite","resourceType":"GMFolder","resourceVersion":"2.0",},
{"$GMFolder":"","%Name":"string","folderPath":"folders/functions/string.yy","name":"string","resourceType":"GMFolder","resourceVersion":"2.0",},
{"$GMFolder":"","%Name":"surface","folderPath":"folders/functions/surface.yy","name":"surface","resourceType":"GMFolder","resourceVersion":"2.0",},
{"$GMFolder":"","%Name":"dynamic_surface","folderPath":"folders/functions/surface/dynamic_surface.yy","name":"dynamic_surface","resourceType":"GMFolder","resourceVersion":"2.0",},
{"$GMFolder":"","%Name":"dynaSurf","folderPath":"folders/functions/surface/dynaSurf.yy","name":"dynaSurf","resourceType":"GMFolder","resourceVersion":"2.0",},
{"$GMFolder":"","%Name":"svg","folderPath":"folders/functions/svg.yy","name":"svg","resourceType":"GMFolder","resourceVersion":"2.0",},
{"$GMFolder":"","%Name":"test","folderPath":"folders/functions/test.yy","name":"test","resourceType":"GMFolder","resourceVersion":"2.0",},
{"$GMFolder":"","%Name":"tooltip","folderPath":"folders/functions/tooltip.yy","name":"tooltip","resourceType":"GMFolder","resourceVersion":"2.0",},
@ -319,6 +319,7 @@
{"$GMFolder":"","%Name":"preview","folderPath":"folders/panels/preview.yy","name":"preview","resourceType":"GMFolder","resourceVersion":"2.0",},
{"$GMFolder":"","%Name":"overlay","folderPath":"folders/panels/preview/overlay.yy","name":"overlay","resourceType":"GMFolder","resourceVersion":"2.0",},
{"$GMFolder":"","%Name":"sprites","folderPath":"folders/panels/preview/sprites.yy","name":"sprites","resourceType":"GMFolder","resourceVersion":"2.0",},
{"$GMFolder":"","%Name":"runner","folderPath":"folders/panels/runner.yy","name":"runner","resourceType":"GMFolder","resourceVersion":"2.0",},
{"$GMFolder":"","%Name":"shader","folderPath":"folders/shader.yy","name":"shader","resourceType":"GMFolder","resourceVersion":"2.0",},
{"$GMFolder":"","%Name":"_helper","folderPath":"folders/shader/_helper.yy","name":"_helper","resourceType":"GMFolder","resourceVersion":"2.0",},
{"$GMFolder":"","%Name":"draw","folderPath":"folders/shader/draw.yy","name":"draw","resourceType":"GMFolder","resourceVersion":"2.0",},
@ -347,7 +348,6 @@
{"$GMFolder":"","%Name":"rotator","folderPath":"folders/widgets/rotator.yy","name":"rotator","resourceType":"GMFolder","resourceVersion":"2.0",},
{"$GMFolder":"","%Name":"sliders","folderPath":"folders/widgets/sliders.yy","name":"sliders","resourceType":"GMFolder","resourceVersion":"2.0",},
{"$GMFolder":"","%Name":"text","folderPath":"folders/widgets/text.yy","name":"text","resourceType":"GMFolder","resourceVersion":"2.0",},
{"$GMFolder":"","%Name":"runner","folderPath":"folders/panels/runner.yy","name":"runner","resourceType":"GMFolder","resourceVersion":"2.0",},
],
"IncludedFiles":[
{"$GMIncludedFile":"","%Name":"Addons.zip","CopyToMask":-1,"filePath":"datafiles/data","name":"Addons.zip","resourceType":"GMIncludedFile","resourceVersion":"2.0",},
@ -1115,6 +1115,7 @@
{"$GMIncludedFile":"","%Name":"info.json","CopyToMask":-1,"filePath":"datafiles/data/Nodes/Internal/Values/Array/Node_Array_Copy","name":"info.json","resourceType":"GMIncludedFile","resourceVersion":"2.0",},
{"$GMIncludedFile":"","%Name":"info.json","CopyToMask":-1,"filePath":"datafiles/data/Nodes/Internal/Values/Array/Node_Array_CSV_Parse","name":"info.json","resourceType":"GMIncludedFile","resourceVersion":"2.0",},
{"$GMIncludedFile":"","%Name":"info.json","CopyToMask":-1,"filePath":"datafiles/data/Nodes/Internal/Values/Array/Node_Array_Find","name":"info.json","resourceType":"GMIncludedFile","resourceVersion":"2.0",},
{"$GMIncludedFile":"","%Name":"info.json","CopyToMask":-1,"filePath":"datafiles/data/Nodes/Internal/Values/Array/Node_Array_Flattern","name":"info.json","resourceType":"GMIncludedFile","resourceVersion":"2.0",},
{"$GMIncludedFile":"","%Name":"info.json","CopyToMask":-1,"filePath":"datafiles/data/Nodes/Internal/Values/Array/Node_Array_Get","name":"info.json","resourceType":"GMIncludedFile","resourceVersion":"2.0",},
{"$GMIncludedFile":"","%Name":"info.json","CopyToMask":-1,"filePath":"datafiles/data/Nodes/Internal/Values/Array/Node_Array_Insert","name":"info.json","resourceType":"GMIncludedFile","resourceVersion":"2.0",},
{"$GMIncludedFile":"","%Name":"info.json","CopyToMask":-1,"filePath":"datafiles/data/Nodes/Internal/Values/Array/Node_Array_Length","name":"info.json","resourceType":"GMIncludedFile","resourceVersion":"2.0",},
@ -2559,6 +2560,7 @@
{"id":{"name":"panel_animation","path":"scripts/panel_animation/panel_animation.yy",},},
{"id":{"name":"panel_array_sequence","path":"scripts/panel_array_sequence/panel_array_sequence.yy",},},
{"id":{"name":"panel_collection_manager","path":"scripts/panel_collection_manager/panel_collection_manager.yy",},},
{"id":{"name":"panel_collection_runner","path":"scripts/panel_collection_runner/panel_collection_runner.yy",},},
{"id":{"name":"panel_collection","path":"scripts/panel_collection/panel_collection.yy",},},
{"id":{"name":"panel_collections_settings","path":"scripts/panel_collections_settings/panel_collections_settings.yy",},},
{"id":{"name":"panel_color","path":"scripts/panel_color/panel_color.yy",},},
@ -2836,7 +2838,6 @@
{"id":{"name":"sh_color_picker_hue","path":"shaders/sh_color_picker_hue/sh_color_picker_hue.yy",},},
{"id":{"name":"sh_color_picker_side_hue","path":"shaders/sh_color_picker_side_hue/sh_color_picker_side_hue.yy",},},
{"id":{"name":"sh_color_picker_side_value","path":"shaders/sh_color_picker_side_value/sh_color_picker_side_value.yy",},},
{"id":{"name":"panel_collection_runner","path":"scripts/panel_collection_runner/panel_collection_runner.yy",},},
{"id":{"name":"sh_color_picker_value","path":"shaders/sh_color_picker_value/sh_color_picker_value.yy",},},
{"id":{"name":"sh_color_remove","path":"shaders/sh_color_remove/sh_color_remove.yy",},},
{"id":{"name":"sh_color_replace","path":"shaders/sh_color_replace/sh_color_replace.yy",},},
@ -3047,6 +3048,7 @@
{"id":{"name":"sh_path_sdf","path":"shaders/sh_path_sdf/sh_path_sdf.yy",},},
{"id":{"name":"sh_pb_blob","path":"shaders/sh_pb_blob/sh_pb_blob.yy",},},
{"id":{"name":"sh_pb_brick","path":"shaders/sh_pb_brick/sh_pb_brick.yy",},},
{"id":{"name":"__init_dynaDraw","path":"scripts/__init_dynaDraw/__init_dynaDraw.yy",},},
{"id":{"name":"sh_pb_draw_mask","path":"shaders/sh_pb_draw_mask/sh_pb_draw_mask.yy",},},
{"id":{"name":"sh_pb_hash","path":"shaders/sh_pb_hash/sh_pb_hash.yy",},},
{"id":{"name":"sh_pb_highlight","path":"shaders/sh_pb_highlight/sh_pb_highlight.yy",},},

Binary file not shown.

View file

@ -248,8 +248,7 @@ event_inherited();
if(PANEL_INSPECTOR) PANEL_INSPECTOR.setInspecting(_new_node);
if(PANEL_GRAPH) {
if(PREFERENCES.node_add_select)
PANEL_GRAPH.selectDragNode(_new_node, true);
if(PREFERENCES.node_add_select) PANEL_GRAPH.selectDragNode(_new_node, junction_called == noone);
var _ins = instanceof(_new_node);
if(struct_has(HOTKEYS, _ins)) FOCUS_STR = _ins;
}

View file

@ -14,10 +14,10 @@ event_inherited();
anchor = ANCHOR.top | ANCHOR.left;
dialog_resizable = true;
dialog_w_min = ui(200);
dialog_h_min = ui(120);
dialog_w_max = ui(1080);
dialog_h_max = ui(640);
dialog_w_min = ui(200);
dialog_h_min = ui(120);
dialog_w_max = ui(1080);
dialog_h_max = ui(640);
#endregion
#region context
@ -59,19 +59,21 @@ event_inherited();
folderPane = new scrollPane(folderW - ui(12), content_h - ui(32), function(_y, _m) {
draw_clear_alpha(COLORS.panel_bg_clear, 1);
var hh = 8;
var hh = ui(8);
var ww = folderPane.surface_w - ui(16);
var hg;
hg = DYNADRAW_FOLDER.draw(self, ui(8), _y + ui(8), _m, ww, sHOVER, sFOCUS, global.ASSETS);
hh += hg;
_y += hg;
for(var i = 0; i < ds_list_size(global.ASSETS.subDir); i++) {
var _w = folderPane.surface_w - ui(16);
var _hover = sHOVER;
var hg = global.ASSETS.subDir[| i].draw(self, ui(8), _y + 8, _m, _w, _hover, sFOCUS, global.ASSETS);
hg = global.ASSETS.subDir[| i].draw(self, ui(8), _y + ui(8), _m, ww, sHOVER, sFOCUS, global.ASSETS);
hh += hg;
_y += hg;
}
folderPane.hover_content = true;
return hh + 8;
});
folderPane.scroll_color_bg = CDEF.main_mdblack;
@ -114,40 +116,53 @@ event_inherited();
draw_sprite_stretched(THEME.node_bg, 0, xx, yy, grid_size, grid_size);
BLEND_NORMAL
var spr = content.getSpr();
var spr = -1;
if(sprite_exists(spr)) {
var sw = sprite_get_width(spr);
var sh = sprite_get_height(spr);
var ss = img_size / max(sw, sh);
var sx = xx + (grid_size - sw * ss) / 2;
var sy = yy + (grid_size - sh * ss) / 2;
var sn = sprite_get_number(spr);
if(is(content, dynaSurf)) {
var _sw = grid_size - ui(16);
var _sh = grid_size - ui(16);
draw_sprite_ext(spr, frame, sx, sy, ss, ss, 0, c_white, 1);
var sx = xx + grid_size / 2;
var sy = yy + grid_size / 2;
content.draw(sx, sy, _sw, _sh);
var _txt = $"{sw}x{sh}";
if(sn) _txt = $"[{sn}] " + _txt;
} else {
spr = content.getSpr();
draw_set_text(_f_p4, fa_right, fa_bottom, COLORS._main_text_inner);
var _tw = string_width(_txt) + ui(6);
var _th = 14;
var _nx = xx + grid_size - 1 - _tw;
var _ny = yy + grid_size - _th;
draw_sprite_stretched_ext(THEME.ui_panel, 0, _nx, _ny, _tw, _th - 1, COLORS.panel_bg_clear_inner, 0.85);
draw_text_add(xx + grid_size - ui(3), yy + grid_size - ui(2), _txt);
} else if(spr == -1) {
var _rr = lerp(.075, .2, abs(dsin(current_time / 2)));
draw_circle_ui(xx + grid_size / 2, yy + grid_size / 2, grid_size * .25, _rr, COLORS._main_icon, 1);
if(sprite_exists(spr)) {
var sw = sprite_get_width(spr);
var sh = sprite_get_height(spr);
var ss = img_size / max(sw, sh);
var sx = xx + (grid_size - sw * ss) / 2;
var sy = yy + (grid_size - sh * ss) / 2;
var sn = sprite_get_number(spr);
draw_sprite_ext(spr, frame, sx, sy, ss, ss, 0, c_white, 1);
var _txt = $"{sw}x{sh}";
if(sn) _txt = $"[{sn}] " + _txt;
draw_set_text(_f_p4, fa_right, fa_bottom, COLORS._main_text_inner);
var _tw = string_width(_txt) + ui(6);
var _th = 14;
var _nx = xx + grid_size - 1 - _tw;
var _ny = yy + grid_size - _th;
draw_sprite_stretched_ext(THEME.ui_panel, 0, _nx, _ny, _tw, _th - 1, COLORS.panel_bg_clear_inner, 0.85);
draw_text_add(xx + grid_size - ui(3), yy + grid_size - ui(2), _txt);
} else if(spr == -1) {
var _rr = lerp(.075, .2, abs(dsin(current_time / 2)));
draw_circle_ui(xx + grid_size / 2, yy + grid_size / 2, grid_size * .25, _rr, COLORS._main_icon, 1);
}
}
if(sHOVER && contentPane.hover && point_in_rectangle(_m[0], _m[1], xx, yy, xx + grid_size, yy + grid_size)) {
contentPane.hover_content = true;
TOOLTIP = [ spr, "sprite" ];
draw_sprite_stretched_ext(THEME.node_bg, 1, xx, yy, grid_size, grid_size, COLORS._main_accent, 1);
if(mouse_press(mb_left, sFOCUS)) {
target.onModify(content.path);
instance_destroy();

View file

@ -380,8 +380,8 @@ function __part(_node) : __particleObject() constructor {
ss = array_safe_get_fast(surf, clamp(_sca, 0, array_length(surf) - 1));
}
var surface = node.surface_cache[$ ss];
var _useS = is_surface(surface);
var _surf = node.surface_cache[$ ss];
var _useS = is_surface(_surf);
if(arr_type == 3) {
scx = 1;
@ -401,8 +401,8 @@ function __part(_node) : __particleObject() constructor {
_yy = round(_yy);
}
var s_w = (_useS? surface_get_width_safe(surface) : 1) * scx;
var s_h = (_useS? surface_get_height_safe(surface) : 1) * scy;
var s_w = (_useS? surface_get_width_safe(_surf) : 1) * scx;
var s_h = (_useS? surface_get_height_safe(_surf) : 1) * scy;
var _pp = point_rotate(-s_w / 2, -s_h / 2, 0, 0, rot);
_xx += _pp[0];
_yy += _pp[1];
@ -428,18 +428,25 @@ function __part(_node) : __particleObject() constructor {
switch(render_type) {
case PARTICLE_RENDER_TYPE.surface :
if(_useS) draw_surface_ext_safe(surface, _xx, _yy, scx, scy, drawrot, cc, alp_draw);
if(surface_exists(_surf))
draw_surface_ext_safe(_surf, _xx, _yy, scx, scy, drawrot, cc, alp_draw);
else {
var ss = round(min(scx, scy));
if(round(ss) == 0) return;
_xx = drawx
_yy = drawy;
if(exact) {
_xx = round(_xx);
_yy = round(_yy);
ss = round( ss);
}
var _s = shader_current();
shader_reset();
draw_set_color_alpha(cc, alp_draw);
dynaSurf_circle_fill(round(_xx), round(_yy), exact? round(ss) : ss);
draw_set_alpha(1);
if(is(_surf, dynaSurf)) _surf.draw(_xx, _yy, ss, ss, 0, cc, alp_draw);
else DYNADRAW_SHAPES[0].draw(_xx, _yy, ss, ss, 0, cc, alp_draw);
shader_set(_s);
}
break;

View file

@ -0,0 +1,20 @@
globalvar DYNADRAW_SHAPE_MAP, DYNADRAW_SHAPES, DYNADRAW_FOLDER;
function __init_dynaDraw() {
DYNADRAW_SHAPE_MAP = {};
DYNADRAW_SHAPES = [
new dynaDraw_circle_fill(),
new dynaDraw_circle_outline(),
new dynaDraw_square_fill(),
new dynaDraw_square_outline(),
];
DYNADRAW_FOLDER = new DirectoryObject("DynaDraw");
for( var i = 0, n = array_length(DYNADRAW_SHAPES); i < n; i++ ) {
var _sh = DYNADRAW_SHAPES[i];
ds_list_add(DYNADRAW_FOLDER.content, _sh);
DYNADRAW_SHAPE_MAP[$ _sh.path] = _sh;
}
}

View file

@ -0,0 +1,14 @@
{
"$GMScript":"v1",
"%Name":"__init_dynaDraw",
"isCompatibility":false,
"isDnD":false,
"name":"__init_dynaDraw",
"parent":{
"name":"dynaDraw",
"path":"folders/functions/surface/dynaDraw.yy",
},
"resourceType":"GMScript",
"resourceVersion":"2.0",
"tags":[],
}

View file

@ -329,13 +329,18 @@ function Node_VFX_Spawner_Base(_x, _y, _group = noone) : Node(_x, _y, _group) co
for( var i = 0, n = array_length(surfs); i < n; i++ ) {
var _s = surfs[i];
if(is(_s, dynaSurf)) {
surface_cache[$ surfs[i]] = _s;
continue;
}
if(surface_exists(surface_cache[$ _s]))
continue;
if(is_instanceof(_s, SurfaceAtlas))
if(is(_s, SurfaceAtlas))
_s = _s.surface.get();
if(!is_surface(_s))
if(!is_surface(_s))
continue;
surface_cache[$ surfs[i]] = surface_clone(_s);

View file

@ -22,6 +22,8 @@
for( var i = 0, n = array_length(PREFERENCES.path_assets); i < n; i++ )
ds_list_add(global.ASSETS.subDir, __initAssetsFolder(PREFERENCES.path_assets[i]));
}
__init_dynaDraw();
}
function __initAssetsFolder(_dir) {
@ -52,6 +54,7 @@
}
function get_asset(key) {
if(struct_has(DYNADRAW_SHAPE_MAP, key)) return DYNADRAW_SHAPE_MAP[$ key];
if(!ds_map_exists(global.ASSET_MAP, key)) return noone;
if(ds_map_exists(global.ASSET_CACHE, key)) {

View file

@ -2,16 +2,16 @@ function dynaSurf() constructor {
surfaces = [];
static getAbsolutePos = function(_x, _y, _xs = 1, _ys = 1, _rot = 0) {
var _w = getWidth() * _xs;
var _h = getHeight() * _ys;
var _px = point_rotate(0, 0, _w / 2, _h / 2, _rot);
var _w = getWidth() * _xs;
var _h = getHeight() * _ys;
var _p = point_rotate(0, 0, _w / 2, _h / 2, _rot);
return [ _x - _px[0], _y - _px[1] ];
return [ _x - _p[0], _y - _p[1] ];
}
static getWidth = function() { return is_surface(array_safe_get_fast(surfaces, 0))? surface_get_width(surfaces[0]) : 1; }
static getHeight = function() { return is_surface(array_safe_get_fast(surfaces, 0))? surface_get_height(surfaces[0]) : 1; }
static getFormat = function() { return is_surface(array_safe_get_fast(surfaces, 0))? surface_get_format(surfaces[0]) : surface_rgba8unorm; }
static getWidth = function() /*=>*/ {return is_surface(array_safe_get_fast(surfaces, 0))? surface_get_width(surfaces[0]) : 1};
static getHeight = function() /*=>*/ {return is_surface(array_safe_get_fast(surfaces, 0))? surface_get_height(surfaces[0]) : 1};
static getFormat = function() /*=>*/ {return is_surface(array_safe_get_fast(surfaces, 0))? surface_get_format(surfaces[0]) : surface_rgba8unorm};
static draw = function(_x = 0, _y = 0, _sx = 1, _sy = 1, _ang = 0, _col = c_white, _alp = 1) {}
static drawStretch = function(_x = 0, _y = 0, _w = 1, _h = 1, _ang = 0, _col = c_white, _alp = 1) {
@ -24,17 +24,17 @@ function dynaSurf() constructor {
static drawTile = function(_x = 0, _y = 0, _xs = 1, _ys = 1, _col = c_white, _alp = 1) {}
static drawPart = function(_l, _t, _w, _h, _x, _y, _xs = 1, _ys = 1, _rot = 0, _col = c_white, _alp = 1) {}
static onFree = function() {}
static free = function() {
static onFree = function() /*=>*/ {}
static free = function() /*=>*/ {
for( var i = 0, n = array_length(surfaces); i < n; i++ )
surface_free_safe(surfaces[i]);
onFree();
}
static getSurfacePreview = function() { return array_safe_get_fast(surfaces, 0); }
static getSurfacePreview = function() /*=>*/ {return array_safe_get_fast(surfaces, 0)};
static clone = function() { return noone; }
static destroy = function() {}
static clone = function() /*=>*/ {return noone};
static destroy = function() /*=>*/ {}
}
function compute_dynaSurf() : dynaSurf() constructor {
@ -73,4 +73,8 @@ function compute_dynaSurf() : dynaSurf() constructor {
return _surf;
}
}
function dynaDraw() : dynaSurf() constructor {
path = "";
}

View file

@ -5,8 +5,8 @@
"isDnD":false,
"name":"dynaSurf",
"parent":{
"name":"dynamic_surface",
"path":"folders/functions/surface/dynamic_surface.yy",
"name":"dynaSurf",
"path":"folders/functions/surface/dynaSurf.yy",
},
"resourceType":"GMScript",
"resourceVersion":"2.0",

View file

@ -5,8 +5,8 @@
"isDnD":false,
"name":"dynaSurf_3d",
"parent":{
"name":"dynamic_surface",
"path":"folders/functions/surface/dynamic_surface.yy",
"name":"dynaSurf",
"path":"folders/functions/surface/dynaSurf.yy",
},
"resourceType":"GMScript",
"resourceVersion":"2.0",

View file

@ -1,27 +1,47 @@
function dynaSurf_circle_fill(_x, _y, ss) {
switch(round(ss)) {
case 0 :
case 1 :
draw_point( _x, _y );
break;
case 2 :
draw_point( _x + 0, _y + 0 );
draw_point( _x + 1, _y + 0 );
draw_point( _x + 0, _y + 1 );
draw_point( _x + 1, _y + 1 );
break;
case 3 :
draw_point( _x, _y );
draw_point( _x - 1, _y );
draw_point( _x + 1, _y );
draw_point( _x, _y + 1 );
draw_point( _x, _y - 1 );
break;
default :
draw_circle(_x, _y, ss - 2, false);
break;
function dynaDraw_circle_fill() : dynaDraw() constructor {
path = "dynaDraw_circle_fill";
static getWidth = function() /*=>*/ {return 1};
static getHeight = function() /*=>*/ {return 1};
static getFormat = function() /*=>*/ {return surface_rgba8unorm};
static draw = function(_x = 0, _y = 0, _sx = 1, _sy = 1, _ang = 0, _col = c_white, _alp = 1) {
draw_set_color(_col);
draw_set_alpha(_alp);
draw_set_circle_precision(32);
if(_sx != _sy) {
draw_ellipse(_x - _sx / 2, _y - _sy / 2, _x + _sx / 2, _y + _sy / 2, false);
draw_set_alpha(1);
return;
}
switch(round(_sx)) {
case 0 :
case 1 :
draw_point( _x, _y );
break;
case 2 :
draw_point( _x + 0, _y + 0 );
draw_point( _x + 1, _y + 0 );
draw_point( _x + 0, _y + 1 );
draw_point( _x + 1, _y + 1 );
break;
case 3 :
draw_point( _x, _y );
draw_point( _x - 1, _y );
draw_point( _x + 1, _y );
draw_point( _x, _y + 1 );
draw_point( _x, _y - 1 );
break;
default :
draw_circle(_x, _y, _sx / 2 - 1, false);
break;
}
draw_set_alpha(1);
}
}

View file

@ -5,8 +5,8 @@
"isDnD":false,
"name":"dynaSurf_circle_fill",
"parent":{
"name":"dynaSurf",
"path":"folders/functions/draw/dynaSurf.yy",
"name":"dynaDraw",
"path":"folders/functions/surface/dynaDraw.yy",
},
"resourceType":"GMScript",
"resourceVersion":"2.0",

View file

@ -1,23 +1,46 @@
function dynaSurf_circle_outline(_x, _y, ss) {
switch(round(ss)) {
case 0 :
case 1 :
draw_point(_x, _y);
break;
case 2 :
draw_point(_x + 0, _y + 0);
draw_point(_x + 1, _y + 0);
draw_point(_x + 0, _y + 1);
draw_point(_x + 1, _y + 1);
break;
case 3 :
draw_point(_x - 1, _y);
draw_point(_x + 1, _y);
draw_point(_x, _y + 1);
draw_point(_x, _y - 1);
break;
default :
draw_circle(_x, _y, ss - 2, true);
break;
function dynaDraw_circle_outline() : dynaDraw() constructor {
path = "dynaDraw_circle_outline";
static getWidth = function() /*=>*/ {return 1};
static getHeight = function() /*=>*/ {return 1};
static getFormat = function() /*=>*/ {return surface_rgba8unorm};
static draw = function(_x = 0, _y = 0, _sx = 1, _sy = 1, _ang = 0, _col = c_white, _alp = 1) {
draw_set_color(_col);
draw_set_alpha(_alp);
draw_set_circle_precision(32);
if(_sx != _sy) {
draw_ellipse(_x - _sx / 2, _y - _sy / 2, _x + _sx / 2, _y + _sy / 2, true);
draw_set_alpha(1);
return;
}
switch(round(_sx)) {
case 0 :
case 1 :
draw_point( _x, _y );
break;
case 2 :
draw_point( _x + 0, _y + 0 );
draw_point( _x + 1, _y + 0 );
draw_point( _x + 0, _y + 1 );
draw_point( _x + 1, _y + 1 );
break;
case 3 :
draw_point( _x - 1, _y );
draw_point( _x + 1, _y );
draw_point( _x, _y + 1 );
draw_point( _x, _y - 1 );
break;
default :
draw_circle(_x, _y, _sx / 2 - 1, true);
break;
}
draw_set_alpha(1);
}
}
}

View file

@ -5,8 +5,8 @@
"isDnD":false,
"name":"dynaSurf_circle_outline",
"parent":{
"name":"dynaSurf",
"path":"folders/functions/draw/dynaSurf.yy",
"name":"dynaDraw",
"path":"folders/functions/surface/dynaDraw.yy",
},
"resourceType":"GMScript",
"resourceVersion":"2.0",

View file

@ -5,8 +5,8 @@
"isDnD":false,
"name":"dynaSurf_iso",
"parent":{
"name":"dynamic_surface",
"path":"folders/functions/surface/dynamic_surface.yy",
"name":"dynaSurf",
"path":"folders/functions/surface/dynaSurf.yy",
},
"resourceType":"GMScript",
"resourceVersion":"2.0",

View file

@ -1,17 +1,21 @@
function dynaSurf_square_fill(_x, _y, ss) {
switch(round(ss)) {
case 0 :
case 1 :
function dynaDraw_square_fill() : dynaDraw() constructor {
path = "dynaDraw_square_fill";
static getWidth = function() /*=>*/ {return 1};
static getHeight = function() /*=>*/ {return 1};
static getFormat = function() /*=>*/ {return surface_rgba8unorm};
static draw = function(_x = 0, _y = 0, _sx = 1, _sy = 1, _ang = 0, _col = c_white, _alp = 1) {
draw_set_color(_col);
draw_set_alpha(_alp);
if(round(_sx) <= 1 && round(_sy) <= 0) {
draw_point(_x, _y);
break;
case 2 :
draw_point(_x + 0, _y + 0);
draw_point(_x + 1, _y + 0);
draw_point(_x + 0, _y + 1);
draw_point(_x + 1, _y + 1);
break;
default :
draw_rectangle(_x - ss / 2, _y - ss / 2, _x + ss / 2, _y + ss / 2, false);
break;
draw_set_alpha(1);
return;
}
draw_rectangle(_x - _sx / 2, _y - _sy / 2, _x + _sx / 2, _y + _sy / 2, false);
draw_set_alpha(1);
}
}

View file

@ -5,8 +5,8 @@
"isDnD":false,
"name":"dynaSurf_square_fill",
"parent":{
"name":"dynaSurf",
"path":"folders/functions/draw/dynaSurf.yy",
"name":"dynaDraw",
"path":"folders/functions/surface/dynaDraw.yy",
},
"resourceType":"GMScript",
"resourceVersion":"2.0",

View file

@ -1,17 +1,21 @@
function dynaSurf_square_outline(_x, _y, ss) {
switch(round(ss)) {
case 0 :
case 1 :
function dynaDraw_square_outline() : dynaDraw() constructor {
path = "dynaDraw_square_outline";
static getWidth = function() /*=>*/ {return 1};
static getHeight = function() /*=>*/ {return 1};
static getFormat = function() /*=>*/ {return surface_rgba8unorm};
static draw = function(_x = 0, _y = 0, _sx = 1, _sy = 1, _ang = 0, _col = c_white, _alp = 1) {
draw_set_color(_col);
draw_set_alpha(_alp);
if(round(_sx) <= 1 && round(_sy) <= 0) {
draw_point(_x, _y);
break;
case 2 :
draw_point(_x + 0, _y + 0);
draw_point(_x + 1, _y + 0);
draw_point(_x + 0, _y + 1);
draw_point(_x + 1, _y + 1);
break;
default :
draw_rectangle(_x - ss / 2, _y - ss / 2, _x + ss / 2, _y + ss / 2, true);
break;
draw_set_alpha(1);
return;
}
draw_rectangle(_x - _sx / 2, _y - _sy / 2, _x + _sx / 2, _y + _sy / 2, true);
draw_set_alpha(1);
}
}

View file

@ -5,8 +5,8 @@
"isDnD":false,
"name":"dynaSurf_square_outline",
"parent":{
"name":"dynaSurf",
"path":"folders/functions/draw/dynaSurf.yy",
"name":"dynaDraw",
"path":"folders/functions/surface/dynaDraw.yy",
},
"resourceType":"GMScript",
"resourceVersion":"2.0",

View file

@ -43,8 +43,8 @@
LATEST_VERSION = 1_18_00_0;
VERSION = 1_18_08_0;
SAVE_VERSION = 1_18_09_0;
VERSION_STRING = MAC? "1.18.003m" : "1.18.9.002";
BUILD_NUMBER = 118080.002;
VERSION_STRING = MAC? "1.18.003m" : "1.18.9.003";
BUILD_NUMBER = 118080.003;
PREF_VERSION = 1_17_1;
var _vsp = string_split(VERSION_STRING, ".");

View file

@ -122,12 +122,8 @@ function Node_MK_Brownian(_x, _y, _group = noone) : Node(_x, _y, _group) constru
var _ss = random_range(_size[0], _size[1]);
if(_sprt == noone) {
draw_set_color(_cc);
draw_set_alpha(_aa);
global.DynaDraw_circle_fill.draw(_pos[0], _pos[1], round(_ss), round(_ss), 0, _cc, _aa);
dynaSurf_circle_fill(_pos[0], _pos[1], round(_ss));
draw_set_alpha(1);
} else {
var _p = _sprt;
if(is_array(_p)) _p = array_safe_get_fast(_p, irandom(array_length(_p) - 1));

View file

@ -422,8 +422,9 @@ function Panel_Collection() : PanelContent() constructor {
if(PREFERENCES.collection_label) {
draw_set_text(f_p3, fa_center, fa_top, COLORS._main_text_inner);
var _txtH = draw_text_ext_add(_boxx + grid_size / 2, yy + grid_size + ui(4), _node.name, -1, grid_width, 1, true);
var _txtH = draw_text_ext_add(_boxx + grid_size / 2, yy + grid_size + ui(4), _node.name, -1, grid_width + ui(16), 1, true);
name_height = max(name_height, _txtH + 8);
} else
name_height = 0;
}

View file

@ -1,6 +1,6 @@
function surfaceBox(_onModify, def_path = "") : widget() constructor {
onModify = _onModify;
self.def_path = def_path;
function surfaceBox(_onModify, _def_path = "") : widget() constructor {
onModify = _onModify;
def_path = _def_path;
open = false;
open_rx = 0;
@ -9,20 +9,19 @@ function surfaceBox(_onModify, def_path = "") : widget() constructor {
align = fa_center;
display_data = {};
cb_atlas_crop = new checkBox(function() {
display_data.atlas_crop = !display_data.atlas_crop;
});
cb_atlas_crop = new checkBox(function() /*=>*/ { display_data.atlas_crop = !display_data.atlas_crop; });
static trigger = function() {
open = true;
with(dialogCall(o_dialog_assetbox, x + open_rx, y + open_ry)) {
target = other;
gotoDir(other.def_path);
}
}
static setInteract = function(interactable) {
self.interactable = interactable;
static setInteract = function(_interactable) {
interactable = _interactable;
cb_atlas_crop.interactable = true;
}
@ -50,81 +49,81 @@ function surfaceBox(_onModify, def_path = "") : widget() constructor {
else if(is_instanceof(_surf_single, SurfaceAtlas)) _type = VALUE_TYPE.atlas;
else if(is_instanceof(_surf_single, __d3dMaterial)) _type = VALUE_TYPE.d3Material;
if(!open) {
draw_sprite_stretched(THEME.textbox, 3, _x, _y, _w, _h);
if(_type == VALUE_TYPE.surface && hover && hoverRect) {
draw_sprite_stretched(THEME.textbox, 1, _x, _y, _w, _h);
if(mouse_press(mb_left, active))
trigger();
if(mouse_click(mb_left, active))
draw_sprite_stretched_ext(THEME.textbox, 2, _x, _y, _w, _h, COLORS._main_accent, 1);
} else {
draw_sprite_stretched_ext(THEME.textbox, 0, _x, _y, _w, _h, c_white, 0.5 + 0.5 * interactable);
if(mouse_press(mb_left)) deactivate();
draw_sprite_stretched(THEME.textbox, 3, _x, _y, _w, _h);
if(hover && hoverRect) {
draw_sprite_stretched(THEME.textbox, 1, _x, _y, _w, _h);
if(!open) {
if(mouse_press(mb_left, active)) trigger();
if(mouse_click(mb_left, active)) draw_sprite_stretched_ext(THEME.textbox, 2, _x, _y, _w, _h, COLORS._main_accent, 1);
}
var pad = ui(12);
var sw = min(_w - pad, _h - pad);
var sh = sw;
var sx0 = _x + _w / 2 - sw / 2;
var sx1 = sx0 + sw;
var sy0 = _y + _h / 2 - sh / 2;
var sy1 = sy0 + sh;
var _arrLen = 0;
var _arrInd = 0;
if(is_array(_surface)) {
if(array_length(_surface)) {
_arrLen = array_length(_surface);
_arrInd = safe_mod(round(current_time / 250), _arrLen);
_surface = _surface[_arrInd];
} else
_surface = noone;
}
if(!is_surface(_surface)) _surface = noone;
if(is_instanceof(_surface, __d3dMaterial)) _surface = _surface.surface;
else if(is_instanceof(_surface, dynaSurf)) _surface = array_safe_get_fast(_surface.surfaces, 0, noone);
else if(is_instanceof(_surface, Atlas)) _surface = _surface.getSurface();
ui_rect(sx0, sy0, sx1, sy1, COLORS.widget_surface_frame);
if(surface_exists(_surface)) {
var sfw = surface_get_width(_surface);
var sfh = surface_get_height(_surface);
var ss = min(sw / sfw, sh / sfh);
var _sx = sx0 + sw / 2 - ss * sfw / 2;
var _sy = sy0 + sh / 2 - ss * sfh / 2;
draw_surface_ext_safe(_surface, _sx, _sy, ss, ss, 0, c_white, 1);
if(_arrLen) {
var bxw = sx1 - sx0;
draw_sprite_stretched_ext(THEME.palette_mask, 1, sx0, sy1 - 3, bxw, 4, COLORS.panel_bg_clear_inner, 1);
draw_sprite_stretched_ext(THEME.palette_mask, 1, sx0, sy1 - 3, bxw * (_arrInd + 1) / _arrLen, 4, COLORS._main_accent, 1);
}
var _txt = $"[{max(1, _arrLen)}] {sfw}x{sfh}";
draw_set_text(_f_p4, fa_right, fa_bottom, COLORS._main_text_inner);
var _tw = string_width(_txt) + ui(6);
var _th = 14;
var _nx = sx1 - _tw;
var _ny = sy1 - _th;
draw_sprite_stretched_ext(THEME.ui_panel, 0, _nx, _ny, _tw, _th, COLORS.panel_bg_clear_inner, 0.85);
draw_text_add(sx1 - ui(3), sy1 + ui(1), _txt);
}
if(_type == VALUE_TYPE.surface)
draw_sprite_ui_uniform(THEME.scroll_box_arrow, 0, _x + _w - min(_h / 2, ui(20)), _y + _h / 2, min(1, _h / 64), COLORS._main_icon, 0.5 + 0.5 * interactable);
} else {
draw_sprite_stretched_ext(THEME.textbox, 0, _x, _y, _w, _h, c_white, 0.5 + 0.5 * interactable);
if(!open && mouse_press(mb_left)) deactivate();
}
var pad = ui(12);
var sw = min(_w - pad, _h - pad);
var sh = sw;
var sx0 = _x + _w / 2 - sw / 2;
var sx1 = sx0 + sw;
var sy0 = _y + _h / 2 - sh / 2;
var sy1 = sy0 + sh;
var _arrLen = 0;
var _arrInd = 0;
if(is_array(_surface)) {
if(array_length(_surface)) {
_arrLen = array_length(_surface);
_arrInd = safe_mod(round(current_time / 250), _arrLen);
_surface = _surface[_arrInd];
} else
_surface = noone;
}
if(!is_surface(_surface)) _surface = noone;
if(is(_surface, __d3dMaterial)) _surface = _surface.surface;
else if(is(_surface, dynaDraw)) _surface = _surface;
else if(is(_surface, dynaSurf)) _surface = array_safe_get_fast(_surface.surfaces, 0, noone);
else if(is(_surface, Atlas)) _surface = _surface.getSurface();
ui_rect(sx0, sy0, sx1, sy1, COLORS.widget_surface_frame);
if(is(_surface, dynaDraw)) {
_surface.draw(sx0 + sw / 2, sy0 + sh / 2, sw - 2, sh - 2);
} else if(surface_exists(_surface)) {
var sfw = surface_get_width(_surface);
var sfh = surface_get_height(_surface);
var ss = min(sw / sfw, sh / sfh);
var _sx = sx0 + sw / 2 - ss * sfw / 2;
var _sy = sy0 + sh / 2 - ss * sfh / 2;
draw_surface_ext_safe(_surface, _sx, _sy, ss, ss, 0, c_white, 1);
if(_arrLen) {
var bxw = sx1 - sx0;
draw_sprite_stretched_ext(THEME.palette_mask, 1, sx0, sy1 - 3, bxw, 4, COLORS.panel_bg_clear_inner, 1);
draw_sprite_stretched_ext(THEME.palette_mask, 1, sx0, sy1 - 3, bxw * (_arrInd + 1) / _arrLen, 4, COLORS._main_accent, 1);
}
var _txt = $"[{max(1, _arrLen)}] {sfw}x{sfh}";
draw_set_text(_f_p4, fa_right, fa_bottom, COLORS._main_text_inner);
var _tw = string_width(_txt) + ui(6);
var _th = 14;
var _nx = sx1 - _tw;
var _ny = sy1 - _th;
draw_sprite_stretched_ext(THEME.ui_panel, 0, _nx, _ny, _tw, _th, COLORS.panel_bg_clear_inner, 0.85);
draw_text_add(sx1 - ui(3), sy1 + ui(1), _txt);
}
draw_sprite_ui_uniform(THEME.scroll_box_arrow, 0, _x + _w - min(_h / 2, ui(20)), _y + _h / 2, min(1, _h / 64), COLORS._main_icon, 0.5 + 0.5 * interactable);
if(WIDGET_CURRENT == self)
draw_sprite_stretched_ext(THEME.widget_selecting, 0, _x - ui(3), _y - ui(3), _w + ui(6), _h + ui(6), COLORS._main_accent, 1);
@ -140,9 +139,5 @@ function surfaceBox(_onModify, def_path = "") : widget() constructor {
return h;
}
static clone = function() {
var cln = new surfaceBox(onModify, def_path);
return cln;
}
static clone = function() /*=>*/ {return new surfaceBox(onModify, def_path)};
}

View file

@ -601,7 +601,7 @@ function surface_reset_target_override() { __surface_reset_target(); winwin_draw
function surface_free_safe(surface) {
INLINE
if(!is_surface(surface)) return;
if(!surface_exists(surface)) return;
__surface_free(surface);
}