From ab1f10d8fe5719ab71a51f4828e738e24cc937dd Mon Sep 17 00:00:00 2001 From: Tanasart Date: Wed, 2 Oct 2024 15:26:08 +0700 Subject: [PATCH] - [2d lights] --- scripts/color_function/color_function.gml | 2 + scripts/draw_line_round/draw_line_round.gml | 15 +- scripts/node_2d_light/node_2d_light.gml | 283 ++++++++++++------ .../node_sequence_anim/node_sequence_anim.gml | 2 +- scripts/node_value/node_value.gml | 8 +- .../node_value_enum_scroll.gml | 31 ++ .../preview_overlay_scalar.gml | 11 +- .../0d97f314-4177-4118-9acc-b414e17b45b8.png | Bin 360 -> 0 bytes .../698950eb-693e-4e11-9c6a-896263281812.png | Bin 0 -> 650 bytes .../70c23952-4e4c-43af-9831-f49fbe156608.png | Bin 0 -> 347 bytes .../37839a6c-b72d-4baf-b5a3-7a46c99d73cc.png | Bin 360 -> 0 bytes .../37839a6c-b72d-4baf-b5a3-7a46c99d73cc.png | Bin 0 -> 650 bytes .../37839a6c-b72d-4baf-b5a3-7a46c99d73cc.png | Bin 0 -> 347 bytes .../s_node_2d_light_shape.yy | 26 +- 14 files changed, 263 insertions(+), 115 deletions(-) delete mode 100644 sprites/s_node_2d_light_shape/0d97f314-4177-4118-9acc-b414e17b45b8.png create mode 100644 sprites/s_node_2d_light_shape/698950eb-693e-4e11-9c6a-896263281812.png create mode 100644 sprites/s_node_2d_light_shape/70c23952-4e4c-43af-9831-f49fbe156608.png delete mode 100644 sprites/s_node_2d_light_shape/layers/0d97f314-4177-4118-9acc-b414e17b45b8/37839a6c-b72d-4baf-b5a3-7a46c99d73cc.png create mode 100644 sprites/s_node_2d_light_shape/layers/698950eb-693e-4e11-9c6a-896263281812/37839a6c-b72d-4baf-b5a3-7a46c99d73cc.png create mode 100644 sprites/s_node_2d_light_shape/layers/70c23952-4e4c-43af-9831-f49fbe156608/37839a6c-b72d-4baf-b5a3-7a46c99d73cc.png diff --git a/scripts/color_function/color_function.gml b/scripts/color_function/color_function.gml index 843bcb10e..1079a0946 100644 --- a/scripts/color_function/color_function.gml +++ b/scripts/color_function/color_function.gml @@ -19,6 +19,8 @@ #endregion #region conversions + function _make_color_rgb(r, g, b) { INLINE return make_color_rgb(r * 255, g * 255, b * 255); } + function make_color_rgba(r, g, b, a) { INLINE return int64(round(r) + (round(g) << 8) + (round(b) << 16) + (round(a) << 24)); } function make_color_hsva(h, s, v, a) { INLINE return _cola(make_color_hsv(h, s, v), a); } diff --git a/scripts/draw_line_round/draw_line_round.gml b/scripts/draw_line_round/draw_line_round.gml index 357996958..931e80853 100644 --- a/scripts/draw_line_round/draw_line_round.gml +++ b/scripts/draw_line_round/draw_line_round.gml @@ -1,20 +1,11 @@ function draw_line_round(x1, y1, x2, y2, w, stCap = true, edCap = true, sample = 8) { draw_line_width(x1, y1, x2, y2, w); - draw_set_circle_precision(8); + draw_set_circle_precision(sample); var dir = point_direction(x1, y1, x2, y2) + 90; - if(stCap) { - draw_circle(x1, y1, w/2, false); - //draw_circle_angle(x1 + 1, y1 + 1, w / 2, dir, dir + 90, sample / 2); - //draw_circle_angle(x1 + 1, y1 + 1, w / 2, dir + 90, dir + 180, sample / 2); - } - - if(edCap) { - draw_circle(x2, y2, w/2, false); - //draw_circle_angle(x2 + 1, y2 + 1, w / 2, dir, dir - 90, sample / 2); - //draw_circle_angle(x2 + 1, y2 + 1, w / 2, dir - 90, dir - 180, 4, sample / 2); - } + if(stCap) draw_circle(x1, y1, w/2, false); + if(edCap) draw_circle(x2, y2, w/2, false); } function draw_line_round_color(x1, y1, x2, y2, w, c1, c2, stCap = true, edCap = true) { diff --git a/scripts/node_2d_light/node_2d_light.gml b/scripts/node_2d_light/node_2d_light.gml index f4dcd2a7f..ab3d198c6 100644 --- a/scripts/node_2d_light/node_2d_light.gml +++ b/scripts/node_2d_light/node_2d_light.gml @@ -1,9 +1,11 @@ enum LIGHT_SHAPE_2D { point, + ellipse, line, line_asym, + saber, spot, - ellipse, + flame, } function Node_2D_light(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { @@ -17,11 +19,25 @@ function Node_2D_light(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) var _index = array_length(inputs); light_inspecting = getInputAmount(); - newInput(_index + 0, nodeValue_Enum_Scroll("Light shape", self, 0, [ new scrollItem("Point", s_node_2d_light_shape, 0), - new scrollItem("Line", s_node_2d_light_shape, 1), - new scrollItem("Line asymmetric", s_node_2d_light_shape, 2), - new scrollItem("Spot", s_node_2d_light_shape, 3), - new scrollItem("Ellipse", s_node_2d_light_shape, 4), ])); + typeList = [ + new scrollItem("Point", s_node_2d_light_shape, 0), + new scrollItem("Ellipse", s_node_2d_light_shape, 1), + new scrollItem("Line", s_node_2d_light_shape, 2), + new scrollItem("Line asymmetric", s_node_2d_light_shape, 3), + new scrollItem("Saber", s_node_2d_light_shape, 4), + new scrollItem("Spot", s_node_2d_light_shape, 5), + new scrollItem("Flame", s_node_2d_light_shape, 6), + ]; + typeListStr = array_create_ext(array_length(typeList), function(i) /*=>*/ {return typeList[i].name}); + + var _val = nodeValue_Enum_Scroll("Light shape", self, 0, typeList); + _val.options_histories = [ typeListStr, + { + cond: function() /*=>*/ {return LOADING_VERSION < 1_18_00_0}, + list: [ "Point", "Line", "Line asymmetric", "Spot" ] + } + ]; + newInput(_index + 0, _val); newInput(_index + 1, nodeValue_Vec2("Center", self, [ 16, 16 ])) .setUnitRef(function(index) { return getDimension(index); }); @@ -73,6 +89,8 @@ function Node_2D_light(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) newInput(_index + 20, nodeValue_Bool("Two sides", self, false)); + newInput(_index + 21, nodeValue_Float("Thickness", self, 2)); + resetDisplay(); return inputs[_index]; } @@ -80,19 +98,11 @@ function Node_2D_light(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) newOutput(0, nodeValue_Output("Surface out", self, VALUE_TYPE.surface, noone)); newOutput(1, nodeValue_Output("Light only", self, VALUE_TYPE.surface, noone)); - light_type_names = [ - "Point light", - "Line light", - "Asymmetric line light", - "Spot light", - "Ellipse light", - ]; - lights_renderer = new Inspector_Custom_Renderer(function(_x, _y, _w, _m, _hover, _focus) { - var bx = _x; - var by = _y; var bs = ui(24); + var bx = _x + ui(20); + var by = _y; if(buttonInstant(THEME.button_hide, bx, by, bs, bs, _m, _focus, _hover, "", THEME.add_16, 0, COLORS._main_value_positive) == 2) { createNewInput(); triggerRender(); @@ -107,7 +117,7 @@ function Node_2D_light(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) draw_sprite_stretched_ext(THEME.ui_panel_bg, 1, _x, yy, _w, _h, COLORS.node_composite_bg_blend, 1); for(var i = 0; i < amo; i++) { - var _x0 = ui(24); + var _x0 = _x + ui(24); var _x1 = _x + _w - ui(16); var _yy = ui(4) + yy + i * lh + lh / 2; @@ -129,14 +139,14 @@ function Node_2D_light(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) draw_sprite_ext(s_node_2d_light_shape, _typ, _x0 + ui(8), _yy, 1, 1, 0, cc); draw_set_text(f_p2, fa_left, fa_center, tc); - draw_text_add(_x0 + ui(28), _yy, light_type_names[_typ]); + draw_text_add(_x0 + ui(28), _yy, typeListStr[_typ]); - if(amo > 1 && hov) { + if(amo > 1) { var bs = ui(24); var bx = _x1 - bs; var by = _yy - bs / 2; - if(buttonInstant(THEME.button_hide, bx, by, bs, bs, _m, _focus, _hover, "", THEME.minus_16, 0, COLORS._main_value_negative) == 2) - del_light = i; + if(buttonInstant(THEME.button_hide, bx, by, bs, bs, _m, _focus, _hover, "", THEME.minus_16, 0, hov? COLORS._main_value_negative : COLORS._main_icon) == 2) + del_light = i; } } @@ -147,7 +157,7 @@ function Node_2D_light(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) }); input_display_light = [ // 14, - ["Shape", false], 0, 1, 5, 6, 7, 8, 15, 16, 17, 20, + ["Shape", false], 0, 1, 5, 6, 7, 8, 15, 16, 17, 20, 21, ["Light", false], 2, 3, 4, 11, 12, 13, ["Render", false], 10, 9, 18, 19, ]; @@ -172,7 +182,7 @@ function Node_2D_light(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) } } - setDynamicInput(21, false); + setDynamicInput(22, false); if(!LOADING && !APPENDING) createNewInput(); static deleteLight = function(index) { @@ -195,6 +205,8 @@ function Node_2D_light(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) var _shape = current_data[_ind + 0]; var _hov = false; + draw_set_circle_precision(64); + switch(_shape) { case LIGHT_SHAPE_2D.point : var pos = current_data[_ind + 1]; @@ -232,12 +244,35 @@ function Node_2D_light(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) var hv = inputs[_ind + 17].drawOverlay(hover, active, px, py, _s, _mx, _my, _snx, _sny); _hov |= bool(hv); hover &= !hv; break; - case LIGHT_SHAPE_2D.line : + case LIGHT_SHAPE_2D.line : case LIGHT_SHAPE_2D.line_asym : - case LIGHT_SHAPE_2D.spot : + case LIGHT_SHAPE_2D.spot : + case LIGHT_SHAPE_2D.flame : var hv = inputs[_ind + 5].drawOverlay(hover, active, _x, _y, _s, _mx, _my, _snx, _sny); _hov |= bool(hv); hover &= !hv; var hv = inputs[_ind + 6].drawOverlay(hover, active, _x, _y, _s, _mx, _my, _snx, _sny); _hov |= bool(hv); hover &= !hv; break; + + case LIGHT_SHAPE_2D.saber : + var hv = inputs[_ind + 5].drawOverlay(hover, active, _x, _y, _s, _mx, _my, _snx, _sny); _hov |= bool(hv); hover &= !hv; + var hv = inputs[_ind + 6].drawOverlay(hover, active, _x, _y, _s, _mx, _my, _snx, _sny); _hov |= bool(hv); hover &= !hv; + + var pos = current_data[_ind + 5]; + var rad = current_data[_ind + 2]; + var thk = current_data[_ind + 21]; + + var px = _x + pos[0] * _s; + var py = _y + pos[1] * _s; + + draw_set_color(COLORS._main_accent); + draw_set_alpha(0.5); + draw_circle(px, py, thk * _s, 1); + draw_circle_dash(px, py, rad * _s, 1, 8); + draw_set_alpha(1); + + inputs[_ind + 21].overlay_text_valign = fa_bottom; + var hv = inputs[_ind + 2].drawOverlay(hover, active, px, py, _s, _mx, _my, _snx, _sny); _hov |= bool(hv); hover &= !hv; + var hv = inputs[_ind + 21].drawOverlay(hover, active, px, py, _s, _mx, _my, _snx, _sny); _hov |= bool(hv); hover &= !hv; + break; } return _hov; @@ -271,6 +306,7 @@ function Node_2D_light(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) var _expo = _data[_ind + 18]; var _aa = _data[_ind + 19]; var _both = _data[_ind + 20]; + var _thick = _data[_ind + 21]; surface_set_shader(temp_surface[0], noone); draw_clear(c_black); @@ -341,23 +377,91 @@ function Node_2D_light(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) draw_primitive_end(); } + break; + + case LIGHT_SHAPE_2D.saber : + draw_set_color(c_white); + draw_line_round(_start[0], _start[1], _finis[0], _finis[1], _thick * 2, true, true, 64); + + var _r = _range + _thick; + var dir = point_direction(_start[0], _start[1], _finis[0], _finis[1]) + 90; + + draw_primitive_begin(pr_trianglestrip); + draw_vertex_color(_start[0], _start[1], c_white, 1); + draw_vertex_color(_finis[0], _finis[1], c_white, 1); + draw_vertex_color(_start[0] + lengthdir_x(_r, dir), _start[1] + lengthdir_y(_r, dir), c_black, 1); + draw_vertex_color(_finis[0] + lengthdir_x(_r, dir), _finis[1] + lengthdir_y(_r, dir), c_black, 1); + draw_primitive_end(); + + draw_primitive_begin(pr_trianglelist); + var ox, oy, nx, ny; + for( var i = 0; i <= 90; i++ ) { + var _d = dir + i * 2; + nx = _start[0] + lengthdir_x(_r, _d); + ny = _start[1] + lengthdir_y(_r, _d); + + if(i) { + draw_vertex_color(_start[0], _start[1], c_white, 1); + draw_vertex_color(ox, oy, c_black, 1); + draw_vertex_color(nx, ny, c_black, 1); + } + + ox = nx; + oy = ny; + } + draw_primitive_end(); + + dir += 180; + draw_primitive_begin(pr_trianglestrip); + draw_vertex_color(_start[0], _start[1], c_white, 1); + draw_vertex_color(_finis[0], _finis[1], c_white, 1); + draw_vertex_color(_start[0] + lengthdir_x(_r, dir), _start[1] + lengthdir_y(_r, dir), c_black, 1); + draw_vertex_color(_finis[0] + lengthdir_x(_r, dir), _finis[1] + lengthdir_y(_r, dir), c_black, 1); + draw_primitive_end(); + + draw_primitive_begin(pr_trianglelist); + var ox, oy, nx, ny; + for( var i = 0; i <= 90; i++ ) { + var _d = dir + i * 2; + nx = _finis[0] + lengthdir_x(_r, _d); + ny = _finis[1] + lengthdir_y(_r, _d); + + if(i) { + draw_vertex_color(_finis[0], _finis[1], c_white, 1); + draw_vertex_color(ox, oy, c_black, 1); + draw_vertex_color(nx, ny, c_black, 1); + } + + ox = nx; + oy = ny; + } + draw_primitive_end(); break; case LIGHT_SHAPE_2D.spot : + case LIGHT_SHAPE_2D.flame : var dir = point_direction(_start[0], _start[1], _finis[0], _finis[1]); var astr = dir - _sweep; var aend = dir + _sweep; - var stp = 3; + var stp = 2; var amo = ceil(_sweep * 2 / stp); var ran = point_distance(_start[0], _start[1], _finis[0], _finis[1]); + var cc; draw_primitive_begin(pr_trianglelist); for( var i = 0; i < amo; i++ ) { - var a0 = clamp(astr + (i) * stp, astr, aend); + var a0 = clamp(astr + (i ) * stp, astr, aend); var a1 = clamp(astr + (i + 1) * stp, astr, aend); - draw_vertex_color(_start[0], _start[1], c_white, 1); + if(_shape == LIGHT_SHAPE_2D.spot) + cc = c_white; + else { + var aa = amo > 2? 1. - abs(i / (amo - 1) - .5) * 2 : 1; + cc = _make_color_rgb(aa, aa, aa); + } + + draw_vertex_color(_start[0], _start[1], cc, 1); draw_vertex_color(_start[0] + lengthdir_x(ran, a0), _start[1] + lengthdir_y(ran, a0), c_black, 1); draw_vertex_color(_start[0] + lengthdir_x(ran, a1), _start[1] + lengthdir_y(ran, a1), c_black, 1); } @@ -409,62 +513,71 @@ function Node_2D_light(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) if(getInputAmount() == 0) return; - light_inspecting = clamp(light_inspecting, 0, getInputAmount() - 1); - var _ind = input_fix_len + light_inspecting * data_length; - - var _shape = _data[_ind + 0]; - var _attn = _data[_ind + 10]; - - inputs[_ind + 1].setVisible(false); - inputs[_ind + 2].setVisible(false); - inputs[_ind + 5].setVisible(false); - inputs[_ind + 6].setVisible(false); - inputs[_ind + 7].setVisible(false); - inputs[_ind + 8].setVisible(false); - inputs[_ind + 11].setVisible(false); - inputs[_ind + 12].setVisible(false); - inputs[_ind + 13].setVisible(false); - inputs[_ind + 15].setVisible(false); - inputs[_ind + 16].setVisible(false); - inputs[_ind + 17].setVisible(false); - inputs[_ind + 20].setVisible(false); - - switch(_shape) { - case LIGHT_SHAPE_2D.point : - inputs[_ind + 1].setVisible(true); - inputs[_ind + 2].setVisible(true); - inputs[_ind + 11].setVisible(true); - inputs[_ind + 12].setVisible(true); - inputs[_ind + 13].setVisible(true); - break; + #region visibility + light_inspecting = clamp(light_inspecting, 0, getInputAmount() - 1); + var _ind = input_fix_len + light_inspecting * data_length; + + var _shape = _data[_ind + 0]; + var _attn = _data[_ind + 10]; + + inputs[_ind + 1].setVisible(false); + inputs[_ind + 2].setVisible(false); + inputs[_ind + 5].setVisible(false); + inputs[_ind + 6].setVisible(false); + inputs[_ind + 7].setVisible(false); + inputs[_ind + 8].setVisible(false); + inputs[_ind + 11].setVisible(false); + inputs[_ind + 12].setVisible(false); + inputs[_ind + 13].setVisible(false); + inputs[_ind + 15].setVisible(false); + inputs[_ind + 16].setVisible(false); + inputs[_ind + 17].setVisible(false); + inputs[_ind + 20].setVisible(false); + inputs[_ind + 21].setVisible(false); + + switch(_shape) { + case LIGHT_SHAPE_2D.point : + inputs[_ind + 1].setVisible(true); + inputs[_ind + 2].setVisible(true); + inputs[_ind + 11].setVisible(true); + inputs[_ind + 12].setVisible(true); + inputs[_ind + 13].setVisible(true); + break; + + case LIGHT_SHAPE_2D.ellipse : + inputs[_ind + 1].setVisible(true); + inputs[_ind + 15].setVisible(true); + inputs[_ind + 16].setVisible(true); + inputs[_ind + 17].setVisible(true); + break; + + case LIGHT_SHAPE_2D.line : + case LIGHT_SHAPE_2D.line_asym : + inputs[_ind + 2].setVisible(true); + inputs[_ind + 5].setVisible(true); + inputs[_ind + 6].setVisible(true); + inputs[_ind + 7].setVisible(true); + inputs[_ind + 8].setVisible(_shape == LIGHT_SHAPE_2D.line_asym); + inputs[_ind + 20].setVisible(true); + break; - case LIGHT_SHAPE_2D.ellipse : - inputs[_ind + 1].setVisible(true); - inputs[_ind + 15].setVisible(true); - inputs[_ind + 16].setVisible(true); - inputs[_ind + 17].setVisible(true); - break; - - case LIGHT_SHAPE_2D.line : - case LIGHT_SHAPE_2D.line_asym : - inputs[_ind + 2].setVisible(true); - inputs[_ind + 5].setVisible(true); - inputs[_ind + 6].setVisible(true); - inputs[_ind + 7].setVisible(true); - inputs[_ind + 8].setVisible(_shape == LIGHT_SHAPE_2D.line_asym); - inputs[_ind + 20].setVisible(true); - break; - - case LIGHT_SHAPE_2D.spot : - inputs[_ind + 5].setVisible(true); - inputs[_ind + 6].setVisible(true); - inputs[_ind + 7].setVisible(true); - break; - } - - inputs[_ind + 18].setVisible(_attn == 0 || _attn == 1); - - ///////////////////////////////////////// + case LIGHT_SHAPE_2D.saber : + inputs[_ind + 2].setVisible(true); + inputs[_ind + 5].setVisible(true); + inputs[_ind + 6].setVisible(true); + inputs[_ind + 21].setVisible(true); + break; + + case LIGHT_SHAPE_2D.spot : + case LIGHT_SHAPE_2D.flame : + inputs[_ind + 5].setVisible(true); + inputs[_ind + 6].setVisible(true); + inputs[_ind + 7].setVisible(true); + break; + } + + inputs[_ind + 18].setVisible(_attn == 0 || _attn == 1); + #endregion if(!is_surface(_surf)) return _outData; @@ -494,8 +607,4 @@ function Node_2D_light(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) return [ _outSurf, _lightSurf ]; } - static preDeserialize = function() { - // if(LOADING_VERSION < 1_18_00_0) - // load_map.data_length = 1; - } } \ No newline at end of file diff --git a/scripts/node_sequence_anim/node_sequence_anim.gml b/scripts/node_sequence_anim/node_sequence_anim.gml index 4185d88d5..d267b00c6 100644 --- a/scripts/node_sequence_anim/node_sequence_anim.gml +++ b/scripts/node_sequence_anim/node_sequence_anim.gml @@ -147,7 +147,7 @@ function timelineItemNode_Sequence_Anim(node) : timelineItemNode(node) construct _surf = _arr[i]; if(_useq) { if(_surf < 0) continue; - _surf = _surfs[_surf]; + _surf = array_safe_get(_surfs, _surf); } if(!surface_exists(_surf)) continue; diff --git a/scripts/node_value/node_value.gml b/scripts/node_value/node_value.gml index b05a64c26..2b99bd085 100644 --- a/scripts/node_value/node_value.gml +++ b/scripts/node_value/node_value.gml @@ -176,8 +176,9 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru draw_blend = 1; draw_blend_color = 1; - __overlay_hover = []; - overlay_draw_text = true; + __overlay_hover = []; + overlay_draw_text = true; + overlay_text_valign = fa_top; graph_selecting = false; #endregion @@ -2187,10 +2188,13 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru node.input_value_map[$ internalName] = _value; } + doApplyDeserialize(); attributeApply(); onValidate(); } + static doApplyDeserialize = function() {} + static attributeApply = function() { if(struct_has(attributes, "mapped") && attributes.mapped) mappableStep(); diff --git a/scripts/node_value_enum_scroll/node_value_enum_scroll.gml b/scripts/node_value_enum_scroll/node_value_enum_scroll.gml index 899a64a0b..14c9d6f07 100644 --- a/scripts/node_value_enum_scroll/node_value_enum_scroll.gml +++ b/scripts/node_value_enum_scroll/node_value_enum_scroll.gml @@ -18,4 +18,35 @@ function NodeValue_Enum_Scroll(_name, _node, _value, _data) : NodeValue(_name, _ } static arrayLength = arrayLengthSimple; + + /////============ Serialize =========== + + options_histories = []; + + static doApplyDeserialize = function() { + if(is_anim) return; + if(array_empty(options_histories)) return; + if(array_empty(animator.values)) return; + + var _load = noone; + + for( var i = 1, n = array_length(options_histories); i < n; i++ ) { + var _oph = options_histories[i]; + if(_oph.cond()) { + _load = _oph; + break; + } + } + + if(_load == noone) return; + + var _v = animator.values[0].value; + var _o = array_safe_get(_load.list, _v, noone); + if(_o != noone) { + var _n = array_find(options_histories[0], _o); + if(_n == -1) _n = 0; + animator.values[0].value = _n; + } + } + } \ No newline at end of file diff --git a/scripts/preview_overlay_scalar/preview_overlay_scalar.gml b/scripts/preview_overlay_scalar/preview_overlay_scalar.gml index 4b572aa76..fc5c0c5dc 100644 --- a/scripts/preview_overlay_scalar/preview_overlay_scalar.gml +++ b/scripts/preview_overlay_scalar/preview_overlay_scalar.gml @@ -47,8 +47,15 @@ function preview_overlay_scalar(interact, active, _x, _y, _s, _mx, _my, _snx, _s draw_anchor(__overlay_hover[0], _ax, _ay, _r, _type); if(overlay_draw_text) { - draw_set_text(_f_p2b, fa_center, fa_bottom, COLORS._main_accent); - draw_text_add(round(_ax), round(_ay - 4), name); + if(overlay_text_valign == fa_top) { + draw_set_text(_f_p2b, fa_center, fa_bottom, COLORS._main_accent); + draw_text_add(round(_ax), round(_ay - 4), name); + + } else if(overlay_text_valign == fa_bottom) { + draw_set_text(_f_p2b, fa_center, fa_top, COLORS._main_accent); + draw_text_add(round(_ax), round(_ay + 4), name); + + } } return hover; diff --git a/sprites/s_node_2d_light_shape/0d97f314-4177-4118-9acc-b414e17b45b8.png b/sprites/s_node_2d_light_shape/0d97f314-4177-4118-9acc-b414e17b45b8.png deleted file mode 100644 index 4a4bd55f041fdf0f135108b0f0d4320b18b54e08..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 360 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`Gj3dtTpz6=aiY77hwEes65fI|H(?C=%`I;uzv_{O#3^f(-^d z%np{f1!ov0A1D*-?K8Qc>B_gd`17Zoh8wC5u};)sSar-;X;-fIq}G(jC+vj3i`G2w zeePxR@rdw$$#qT1QvZSy4$q&iS#Y@`GXCDBos1J_?OYq9i4;B-JXp zC>2OC7#SFu=o%X68W@Hc8dw<`TbY_@8yHv_7);Rq@Ek=$ZhlH;S|x4`56e8Fff_X6 gHk4%MrWThZ<`&@Avn@Fj7*q@lp00i_>zopr06oNU9smFU diff --git a/sprites/s_node_2d_light_shape/698950eb-693e-4e11-9c6a-896263281812.png b/sprites/s_node_2d_light_shape/698950eb-693e-4e11-9c6a-896263281812.png new file mode 100644 index 0000000000000000000000000000000000000000..394aa73342b9761c55a447d7db59325a8d4d048d GIT binary patch literal 650 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`Gj3dtTpz6=aiY77hwEes65fI|H*Yfq}8s)5S5w{zozgmI7f!pTij3;~( zm1oP-`6$%ERO4_k`s`rtjQ;M<=GedCzoW%duPf zxAyE)&$(z>{yzJ`9Bt2Cn{v%oOxhC4zkyxFc2z%vwk~tw&hSHJr*qdbsvpoYNX~C+ zurOeM6S01l#W&l_G6j4lw~je8SG+VblWUAkSn>Erl|--itqEH+GQI9!HdcD+d#QQJ zq$N#DjGy0W&p+S9!``6s;O~`h_WKx29^KNv*&gZ!j2hJv*NBpo#FA92)~QuUk=p6;OXk;vd$@?2>|6F^9ld} literal 0 HcmV?d00001 diff --git a/sprites/s_node_2d_light_shape/70c23952-4e4c-43af-9831-f49fbe156608.png b/sprites/s_node_2d_light_shape/70c23952-4e4c-43af-9831-f49fbe156608.png new file mode 100644 index 0000000000000000000000000000000000000000..6eb7454fb2ffe4622b3f4b9068ed8486fa04d505 GIT binary patch literal 347 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`Gj3dtTpz6=aiY77hwEes65fI|H(?DB|bo;uzv_{O!4oybT6C zE*FiRQ{>yySkjwyCTdC7a7B5!d%UQ7`Dm`{_wEKZm4dg2*!_13%R3n7-P!SRQRA8; z{nKwxx}rK)(9nB-`TP=QhbIi&{ExG9fhMb#xJHzuB$lLFB^RXvDF!10BNJUi16>27 z5Cd~7Qwu9Y18oBXD+7bX#f-~QH00)|WTsW()*$e2r!-K52Hb{{%-q!ClEmBs+|H(?C=%`I;uzv_{O#3^f(-^d z%np{f1!ov0A1D*-?K8Qc>B_gd`17Zoh8wC5u};)sSar-;X;-fIq}G(jC+vj3i`G2w zeePxR@rdw$$#qT1QvZSy4$q&iS#Y@`GXCDBos1J_?OYq9i4;B-JXp zC>2OC7#SFu=o%X68W@Hc8dw<`TbY_@8yHv_7);Rq@Ek=$ZhlH;S|x4`56e8Fff_X6 gHk4%MrWThZ<`&@Avn@Fj7*q@lp00i_>zopr06oNU9smFU diff --git a/sprites/s_node_2d_light_shape/layers/698950eb-693e-4e11-9c6a-896263281812/37839a6c-b72d-4baf-b5a3-7a46c99d73cc.png b/sprites/s_node_2d_light_shape/layers/698950eb-693e-4e11-9c6a-896263281812/37839a6c-b72d-4baf-b5a3-7a46c99d73cc.png new file mode 100644 index 0000000000000000000000000000000000000000..394aa73342b9761c55a447d7db59325a8d4d048d GIT binary patch literal 650 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`Gj3dtTpz6=aiY77hwEes65fI|H*Yfq}8s)5S5w{zozgmI7f!pTij3;~( zm1oP-`6$%ERO4_k`s`rtjQ;M<=GedCzoW%duPf zxAyE)&$(z>{yzJ`9Bt2Cn{v%oOxhC4zkyxFc2z%vwk~tw&hSHJr*qdbsvpoYNX~C+ zurOeM6S01l#W&l_G6j4lw~je8SG+VblWUAkSn>Erl|--itqEH+GQI9!HdcD+d#QQJ zq$N#DjGy0W&p+S9!``6s;O~`h_WKx29^KNv*&gZ!j2hJv*NBpo#FA92)~QuUk=p6;OXk;vd$@?2>|6F^9ld} literal 0 HcmV?d00001 diff --git a/sprites/s_node_2d_light_shape/layers/70c23952-4e4c-43af-9831-f49fbe156608/37839a6c-b72d-4baf-b5a3-7a46c99d73cc.png b/sprites/s_node_2d_light_shape/layers/70c23952-4e4c-43af-9831-f49fbe156608/37839a6c-b72d-4baf-b5a3-7a46c99d73cc.png new file mode 100644 index 0000000000000000000000000000000000000000..6eb7454fb2ffe4622b3f4b9068ed8486fa04d505 GIT binary patch literal 347 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`Gj3dtTpz6=aiY77hwEes65fI|H(?DB|bo;uzv_{O!4oybT6C zE*FiRQ{>yySkjwyCTdC7a7B5!d%UQ7`Dm`{_wEKZm4dg2*!_13%R3n7-P!SRQRA8; z{nKwxx}rK)(9nB-`TP=QhbIi&{ExG9fhMb#xJHzuB$lLFB^RXvDF!10BNJUi16>27 z5Cd~7Qwu9Y18oBXD+7bX#f-~QH00)|WTsW()*$e2r!-K52Hb{{%-q!ClEmBs+":"", @@ -76,21 +77,24 @@ {"$Keyframe":"","Channels":{ "0":{"$SpriteFrameKeyframe":"","Id":{"name":"674e4c6b-fa3c-48fc-b8dd-e98e893f6a37","path":"sprites/s_node_2d_light_shape/s_node_2d_light_shape.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",}, },"Disabled":false,"id":"583b3052-2b0a-4292-a2ad-0c01956f15c9","IsCreationKey":false,"Key":0.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, + {"$Keyframe":"","Channels":{ + "0":{"$SpriteFrameKeyframe":"","Id":{"name":"909e1d1a-83ba-4b6a-abb2-139b2769b8a5","path":"sprites/s_node_2d_light_shape/s_node_2d_light_shape.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",}, + },"Disabled":false,"id":"2eaa440e-b483-4950-925b-c80a1c956a46","IsCreationKey":false,"Key":1.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, {"$Keyframe":"","Channels":{ "0":{"$SpriteFrameKeyframe":"","Id":{"name":"627be0c1-d02f-48eb-bad9-63437bced55a","path":"sprites/s_node_2d_light_shape/s_node_2d_light_shape.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",}, - },"Disabled":false,"id":"6b675d2b-d448-47df-80ce-540bc127a310","IsCreationKey":false,"Key":1.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, + },"Disabled":false,"id":"6b675d2b-d448-47df-80ce-540bc127a310","IsCreationKey":false,"Key":2.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, {"$Keyframe":"","Channels":{ "0":{"$SpriteFrameKeyframe":"","Id":{"name":"fe76a977-1573-4abb-94d3-9571afbd00e9","path":"sprites/s_node_2d_light_shape/s_node_2d_light_shape.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",}, - },"Disabled":false,"id":"da156bd6-9155-48f6-83c4-63ee1300fa0a","IsCreationKey":false,"Key":2.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, + },"Disabled":false,"id":"da156bd6-9155-48f6-83c4-63ee1300fa0a","IsCreationKey":false,"Key":3.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, + {"$Keyframe":"","Channels":{ + "0":{"$SpriteFrameKeyframe":"","Id":{"name":"70c23952-4e4c-43af-9831-f49fbe156608","path":"sprites/s_node_2d_light_shape/s_node_2d_light_shape.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",}, + },"Disabled":false,"id":"a6345870-aa4d-4717-ada5-e2958582745e","IsCreationKey":false,"Key":4.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, {"$Keyframe":"","Channels":{ "0":{"$SpriteFrameKeyframe":"","Id":{"name":"014aa4b1-411b-42cd-bfbf-444fee6c9934","path":"sprites/s_node_2d_light_shape/s_node_2d_light_shape.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",}, - },"Disabled":false,"id":"38fed255-f284-4f73-8e30-9c51e8107eb5","IsCreationKey":false,"Key":3.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, + },"Disabled":false,"id":"38fed255-f284-4f73-8e30-9c51e8107eb5","IsCreationKey":false,"Key":5.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, {"$Keyframe":"","Channels":{ - "0":{"$SpriteFrameKeyframe":"","Id":{"name":"909e1d1a-83ba-4b6a-abb2-139b2769b8a5","path":"sprites/s_node_2d_light_shape/s_node_2d_light_shape.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",}, - },"Disabled":false,"id":"2eaa440e-b483-4950-925b-c80a1c956a46","IsCreationKey":false,"Key":4.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, - {"$Keyframe":"","Channels":{ - "0":{"$SpriteFrameKeyframe":"","Id":{"name":"0d97f314-4177-4118-9acc-b414e17b45b8","path":"sprites/s_node_2d_light_shape/s_node_2d_light_shape.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",}, - },"Disabled":false,"id":"1977edc2-395d-46d2-b1bf-4a9451a8427f","IsCreationKey":false,"Key":5.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, + "0":{"$SpriteFrameKeyframe":"","Id":{"name":"698950eb-693e-4e11-9c6a-896263281812","path":"sprites/s_node_2d_light_shape/s_node_2d_light_shape.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",}, + },"Disabled":false,"id":"8f46f591-fd07-4705-b4ce-3c3f946cbfd1","IsCreationKey":false,"Key":6.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, ],"resourceType":"KeyframeStore","resourceVersion":"2.0",},"modifiers":[],"name":"frames","resourceType":"GMSpriteFramesTrack","resourceVersion":"2.0","spriteId":null,"trackColour":0,"tracks":[],"traits":0,}, ], "visibleRange":null,