Pixel-Composer/scripts/rotatorRandom/rotatorRandom.gml

474 lines
15 KiB
Text
Raw Normal View History

2023-09-11 16:08:58 +02:00
function rotatorRandom(_onModify) : widget() constructor {
onModify = _onModify;
2023-12-05 09:51:24 +01:00
dragging_index = -1;
2024-02-10 07:03:50 +01:00
dragging = false;
2023-09-11 16:08:58 +02:00
drag_sv = 0;
drag_dat = [ 0, 0, 0, 0, 0 ];
2023-09-11 16:08:58 +02:00
2024-02-10 07:03:50 +01:00
knob_hovering = noone;
2023-09-11 16:08:58 +02:00
mode = 0;
2024-07-26 09:38:39 +02:00
tb_min_0 = new textBox(TEXTBOX_INPUT.number, function(val) { return onModify(val, 1); } ).setSlideStep(15); tb_min_0.hide = true;
tb_max_0 = new textBox(TEXTBOX_INPUT.number, function(val) { return onModify(val, 2); } ).setSlideStep(15); tb_max_0.hide = true;
tb_min_1 = new textBox(TEXTBOX_INPUT.number, function(val) { return onModify(val, 3); } ).setSlideStep(15); tb_min_1.hide = true;
tb_max_1 = new textBox(TEXTBOX_INPUT.number, function(val) { return onModify(val, 4); } ).setSlideStep(15); tb_max_1.hide = true;
2023-09-11 16:08:58 +02:00
tooltip = new tooltipSelector("Mode", [
__txtx("widget_rotator_random_range", "Range"),
__txtx("widget_rotator_random_span", "Span"),
__txtx("widget_rotator_random_double_range", "Double Range"),
__txtx("widget_rotator_random_double_span", "Double Span")
]);
2023-09-11 16:08:58 +02:00
static setInteract = function(interactable = noone) {
2023-09-11 16:08:58 +02:00
self.interactable = interactable;
tb_min_0.interactable = interactable;
tb_max_0.interactable = interactable;
if(mode == 2 || mode == 3) tb_min_1.interactable = interactable;
if(mode == 2) tb_max_1.interactable = interactable;
}
2023-09-11 16:08:58 +02:00
static register = function(parent = noone) {
2023-09-11 16:08:58 +02:00
tb_min_0.register(parent);
tb_max_0.register(parent);
if(mode == 2 || mode == 3) tb_min_1.register(parent);
if(mode == 2) tb_max_1.register(parent);
}
2023-09-11 16:08:58 +02:00
2024-03-28 14:18:02 +01:00
static isHovering = function() { return dragging || tb_min_0.hovering || tb_max_0.hovering || tb_min_1.hovering || tb_max_1.hovering; }
static drawParam = function(params) {
2024-03-27 11:51:14 +01:00
setParam(params);
tb_min_0.setParam(params);
tb_max_0.setParam(params);
tb_min_1.setParam(params);
tb_max_1.setParam(params);
2024-03-26 04:03:45 +01:00
return draw(params.x, params.y, params.w, params.h, params.data, params.m);
}
2023-09-11 16:08:58 +02:00
static draw = function(_x, _y, _w, _h, _data, _m) {
2023-09-11 16:08:58 +02:00
x = _x;
y = _y;
w = _w;
mode = _data[0];
2024-03-26 04:03:45 +01:00
var _hh = mode > 1? _h * 2 + ui(4) : _h;
h = h == 0? _hh : lerp_float(h, _hh, 5);
2023-09-11 16:08:58 +02:00
2024-03-26 04:03:45 +01:00
var _kHover = dragging_index;
var _r = _h;
2024-03-29 05:20:49 +01:00
var _drawRot = _w - _r > ui(64);
2024-03-26 04:03:45 +01:00
var _bs = min(_h, ui(32));
2024-03-29 05:20:49 +01:00
var _tx = _drawRot? _x + _r + ui(4) : _x;
var _tw = _drawRot? _w - _r - ui(4) : _w;
var _ty = _y;
2023-09-11 16:08:58 +02:00
2024-03-26 04:03:45 +01:00
switch(mode) {
case 2 :
draw_sprite_stretched_ext(THEME.textbox, 3, _tx, _y + _h + ui(4), _tw, _h, boxColor, 1);
draw_sprite_stretched_ext(THEME.textbox, 0, _tx, _y + _h + ui(4), _tw, _h, boxColor, 0.5 + 0.5 * interactable);
2024-03-26 04:03:45 +01:00
case 0 :
case 1 :
draw_sprite_stretched_ext(THEME.textbox, 3, _tx, _y, _tw, _h, boxColor, 1);
draw_sprite_stretched_ext(THEME.textbox, 0, _tx, _y, _tw, _h, boxColor, 0.5 + 0.5 * interactable);
2024-03-26 04:03:45 +01:00
break;
case 3 :
draw_sprite_stretched_ext(THEME.textbox, 3, _tx, _y, _tw, h, boxColor, 1);
draw_sprite_stretched_ext(THEME.textbox, 0, _tx, _y, _tw, h, boxColor, 0.5 + 0.5 * interactable);
2024-03-26 04:03:45 +01:00
}
2023-09-11 16:08:58 +02:00
2024-03-29 05:20:49 +01:00
if(_drawRot) {
if((_w - _r) / 2 > ui(48)) {
tooltip.index = mode;
if(buttonInstant(noone, _x + _w - _bs, _y + _h / 2 - _bs / 2, _bs, _bs, _m, active, hover, tooltip, THEME.rotator_random_mode, mode, [ COLORS._main_icon, c_white ]) == 2) { #region
mode = (mode + 1) % 4;
onModify(mode, 0);
2023-09-11 16:08:58 +02:00
2024-03-29 05:20:49 +01:00
if(mode == 0) {
onModify( 0, 1);
onModify(180, 2);
2024-03-29 05:20:49 +01:00
} else if(mode == 1) {
onModify((_data[1] + _data[2]) / 2, 1);
onModify(abs(_data[1] - _data[2]) / 2, 2);
2024-03-29 05:20:49 +01:00
} else if(mode == 2) {
onModify(0, 1);
onModify(90, 2);
onModify(180, 3);
onModify(270, 4);
2024-03-29 05:20:49 +01:00
} else if(mode == 3) {
onModify(45, 1);
onModify(225, 2);
onModify(45, 3);
2024-03-29 05:20:49 +01:00
}
2024-03-26 04:03:45 +01:00
2024-03-29 05:20:49 +01:00
} #endregion
2023-09-11 16:08:58 +02:00
2024-03-29 05:20:49 +01:00
_tw -= _bs + ui(4);
}
var _kx = _x + _r / 2;
var _ky = _y + _r / 2;
var _kr = (_r - ui(12)) / 2;
var _kc = COLORS._main_icon;
}
2024-03-26 04:03:45 +01:00
2024-03-29 05:20:49 +01:00
_tw /= 2;
2024-03-26 04:03:45 +01:00
2023-09-11 16:08:58 +02:00
switch(mode) {
2024-03-26 04:03:45 +01:00
case 0 : #region
2023-09-11 16:08:58 +02:00
tb_min_0.setFocusHover(active, hover);
tb_max_0.setFocusHover(active, hover);
2024-03-31 05:36:11 +02:00
tb_min_0.draw(_tx, _ty, _tw, _h, array_safe_get_fast(_data, 1), _m);
tb_max_0.draw(_tx + _tw, _ty, _tw, _h, array_safe_get_fast(_data, 2), _m);
2023-09-11 16:08:58 +02:00
2024-03-29 05:20:49 +01:00
if(_drawRot) {
if(dragging_index > -1) {
_kc = COLORS._main_icon_light;
2024-03-26 04:03:45 +01:00
2024-03-29 05:20:49 +01:00
var val;
var curr_val = [ drag_sv[0], drag_sv[1], drag_sv[2], drag_sv[3], drag_sv[4] ];
var modi = false;
2023-12-05 09:51:24 +01:00
2024-03-29 05:20:49 +01:00
curr_val[1] = round(dragging.delta_acc + drag_sv[1]);
curr_val[2] = round(dragging.delta_acc + drag_sv[2]);
2023-12-05 09:51:24 +01:00
2024-03-29 05:20:49 +01:00
val = key_mod_press(CTRL)? round(curr_val[1] / 15) * 15 : curr_val[1];
modi |= onModify(val, 1);
2023-12-05 09:51:24 +01:00
2024-03-29 05:20:49 +01:00
val = key_mod_press(CTRL)? round(curr_val[2] / 15) * 15 : curr_val[2];
modi |= onModify(val, 2);
2023-09-11 16:08:58 +02:00
2024-03-29 05:20:49 +01:00
if(modi) UNDO_HOLDING = true;
2023-12-05 09:51:24 +01:00
2024-03-29 05:20:49 +01:00
MOUSE_BLOCK = true;
2024-01-16 11:00:39 +01:00
2024-03-29 05:20:49 +01:00
if(mouse_check_button_pressed(mb_right)) {
for( var i = 0; i < 5; i++ ) onModify(drag_dat[i], i);
2024-03-29 05:20:49 +01:00
instance_destroy(rotator_Rotator);
dragging = noone;
dragging_index = -1;
UNDO_HOLDING = false;
2024-03-29 05:20:49 +01:00
} else if(mouse_release(mb_left)) {
instance_destroy(rotator_Rotator);
dragging = noone;
dragging_index = -1;
UNDO_HOLDING = false;
}
2023-12-05 09:51:24 +01:00
2024-03-29 05:20:49 +01:00
} else if(hover && point_in_rectangle(_m[0], _m[1], _x, _y, _x + _r, _y + _r)) {
_kc = COLORS._main_icon_light;
2024-03-26 04:03:45 +01:00
2024-03-29 05:20:49 +01:00
if(mouse_press(mb_left, active)) {
dragging_index = 2;
2023-12-05 09:51:24 +01:00
2024-03-29 05:20:49 +01:00
drag_sv = [ _data[0], _data[1], _data[2], _data[3], _data[4] ];
drag_dat = [ _data[0], _data[1], _data[2], _data[3], _data[4] ];
dragging = instance_create(0, 0, rotator_Rotator).init(_m, _kx, _ky);
}
2024-03-26 04:03:45 +01:00
2024-03-29 05:20:49 +01:00
}
2024-03-26 04:03:45 +01:00
2024-03-29 05:20:49 +01:00
draw_set_color(CDEF.main_dkgrey);
draw_circle_angle(_kx, _ky, _kr, _data[1], _data[2], 32);
2024-03-26 04:03:45 +01:00
2024-03-29 05:20:49 +01:00
shader_set(sh_widget_rotator_range);
shader_set_f("side", _r);
shader_set_color("color", _kc);
shader_set_f("angle", degtorad(_data[1]), degtorad(_data[2]));
2024-03-26 04:03:45 +01:00
2024-03-29 05:20:49 +01:00
draw_sprite_stretched(s_fx_pixel, 0, _x, _y, _r, _r);
shader_reset();
}
2023-09-11 16:08:58 +02:00
break;
2024-03-26 04:03:45 +01:00
#endregion
case 1 : #region
2023-09-11 16:08:58 +02:00
tb_min_0.setFocusHover(active, hover);
tb_max_0.setFocusHover(active, hover);
2024-03-26 04:03:45 +01:00
2024-03-31 05:36:11 +02:00
tb_min_0.draw(_tx, _ty, _tw, _h, array_safe_get_fast(_data, 1), _m);
tb_max_0.draw(_tx + _tw, _ty, _tw, _h, array_safe_get_fast(_data, 2), _m);
2023-09-11 16:08:58 +02:00
2024-03-29 05:20:49 +01:00
if(_drawRot) {
var _a0 = _data[1] - _data[2];
var _a1 = _data[1] + _data[2];
2023-09-11 16:08:58 +02:00
2024-03-29 05:20:49 +01:00
if(dragging_index > -1) {
_kc = COLORS._main_icon_light;
2024-03-26 04:03:45 +01:00
2024-03-29 05:20:49 +01:00
var val = point_direction(_kx, _ky, _m[0], _m[1]);
if(key_mod_press(CTRL)) val = round(val / 15) * 15;
2023-09-11 16:08:58 +02:00
2024-03-29 05:20:49 +01:00
var val;
var real_val = [ drag_sv[0], drag_sv[1], drag_sv[2], drag_sv[3], drag_sv[4] ];
2023-09-11 16:08:58 +02:00
2024-03-29 05:20:49 +01:00
real_val[1] = round(dragging.delta_acc + drag_sv[1]);
val = key_mod_press(CTRL)? round(real_val[1] / 15) * 15 : real_val[1];
2023-09-11 16:08:58 +02:00
if(onModify(val, 1)) UNDO_HOLDING = true;
2023-09-11 16:08:58 +02:00
2024-03-29 05:20:49 +01:00
MOUSE_BLOCK = true;
2024-01-16 11:00:39 +01:00
2024-03-29 05:20:49 +01:00
if(mouse_check_button_pressed(mb_right)) {
for( var i = 0; i < 5; i++ ) onModify(drag_dat[i], i);
2024-03-29 05:20:49 +01:00
instance_destroy(rotator_Rotator);
dragging = noone;
dragging_index = -1;
UNDO_HOLDING = false;
2024-03-29 05:20:49 +01:00
} else if(mouse_release(mb_left)) {
instance_destroy(rotator_Rotator);
dragging = noone;
dragging_index = -1;
UNDO_HOLDING = false;
}
2024-03-26 04:03:45 +01:00
2024-03-29 05:20:49 +01:00
} else if(hover && point_in_rectangle(_m[0], _m[1], _x, _y, _x + _r, _y + _r)) {
_kc = COLORS._main_icon_light;
2024-03-26 04:03:45 +01:00
2024-03-29 05:20:49 +01:00
if(mouse_press(mb_left, active)) {
dragging_index = 2;
drag_sv = [ _data[0], _data[1], _data[2], _data[3], _data[4] ];
drag_dat = [ _data[0], _data[1], _data[2], _data[3], _data[4] ];
dragging = instance_create(0, 0, rotator_Rotator).init(_m, _kx, _ky);
}
2023-09-11 16:08:58 +02:00
}
2024-03-26 04:03:45 +01:00
2024-03-29 05:20:49 +01:00
draw_set_color(CDEF.main_dkgrey);
draw_circle_angle(_kx, _ky, _kr, _a0, _a1, 32);
2024-03-26 04:03:45 +01:00
2024-03-29 05:20:49 +01:00
shader_set(sh_widget_rotator);
shader_set_f("side", _r);
shader_set_color("color", _kc);
shader_set_f("angle", degtorad(_data[1]));
2024-03-26 04:03:45 +01:00
2024-03-29 05:20:49 +01:00
draw_sprite_stretched(s_fx_pixel, 0, _x, _y, _r, _r);
shader_reset();
}
2023-09-11 16:08:58 +02:00
break;
2024-03-26 04:03:45 +01:00
#endregion
case 2 : #region
var _ky0 = _y + _r / 2;
var _ky1 = _y + _h + ui(4) + _r / 2;
var _kc0 = _kc;
var _kc1 = _kc;
2023-09-11 16:08:58 +02:00
tb_min_0.setFocusHover(active, hover);
tb_max_0.setFocusHover(active, hover);
tb_min_1.setFocusHover(active, hover);
tb_max_1.setFocusHover(active, hover);
2024-03-31 05:36:11 +02:00
tb_min_0.draw(_tx, _ty, _tw, _h, array_safe_get_fast(_data, 1), _m);
tb_max_0.draw(_tx + _tw, _ty, _tw, _h, array_safe_get_fast(_data, 2), _m);
tb_min_1.draw(_tx, _ty + _h + ui(4), _tw, _h, array_safe_get_fast(_data, 3), _m);
tb_max_1.draw(_tx + _tw, _ty + _h + ui(4), _tw, _h, array_safe_get_fast(_data, 4), _m);
2023-09-11 16:08:58 +02:00
2024-03-29 05:20:49 +01:00
if(_drawRot) {
if(dragging_index > -1) {
if(dragging_index == 1) _kc0 = COLORS._main_icon_light;
else _kc1 = COLORS._main_icon_light;
2023-09-11 16:08:58 +02:00
2024-03-29 05:20:49 +01:00
var val = point_direction(_kx, dragging_index == 1? _ky0 : _ky1, _m[0], _m[1]);
if(key_mod_press(CTRL)) val = round(val / 15) * 15;
2023-09-11 16:08:58 +02:00
2024-03-29 05:20:49 +01:00
var val;
var real_val = [ drag_sv[0], drag_sv[1], drag_sv[2], drag_sv[3], drag_sv[4] ];
var modi = false;
2023-09-11 16:08:58 +02:00
2024-03-29 05:20:49 +01:00
for( var i = 1; i <= 2; i++ ) {
var ind = (dragging_index - 1) * 2 + i;
2023-09-11 16:08:58 +02:00
2024-03-29 05:20:49 +01:00
real_val[ind] = round(drag_sv[ind] + dragging.delta_acc);
val = key_mod_press(CTRL)? round(real_val[ind] / 15) * 15 : real_val[ind];
2024-03-26 04:03:45 +01:00
if(onModify(val, ind)) modi = true;
2024-03-29 05:20:49 +01:00
}
2023-09-11 16:08:58 +02:00
2024-03-29 05:20:49 +01:00
if(modi) {
UNDO_HOLDING = true;
MOUSE_BLOCK = true;
}
2024-01-16 11:00:39 +01:00
2024-03-29 05:20:49 +01:00
if(mouse_check_button_pressed(mb_right)) {
for( var i = 0; i < 5; i++ ) onModify(drag_dat[i], i);
2024-03-29 05:20:49 +01:00
instance_destroy(rotator_Rotator);
dragging = noone;
dragging_index = -1;
UNDO_HOLDING = false;
2024-03-29 05:20:49 +01:00
} else if(mouse_release(mb_left)) {
instance_destroy(rotator_Rotator);
dragging = noone;
dragging_index = -1;
UNDO_HOLDING = false;
}
2024-03-26 04:03:45 +01:00
2024-03-29 05:20:49 +01:00
} else if(hover && point_in_rectangle(_m[0], _m[1], _x, _y, _x + _r, _y + _r)) {
_kc0 = COLORS._main_icon_light;
2024-03-26 04:03:45 +01:00
2024-03-29 05:20:49 +01:00
if(mouse_press(mb_left, active)) {
dragging_index = 1;
drag_sv = [ _data[0], _data[1], _data[2], _data[3], _data[4] ];
drag_dat = [ _data[0], _data[1], _data[2], _data[3], _data[4] ];
dragging = instance_create(0, 0, rotator_Rotator).init(_m, _kx, _ky0);
}
} else if(hover && point_in_rectangle(_m[0], _m[1], _x, _y + _h + ui(4), _x + _r, _y + _h + ui(4) + _r)) {
_kc1 = COLORS._main_icon_light;
2024-03-26 04:03:45 +01:00
2024-03-29 05:20:49 +01:00
if(mouse_press(mb_left, active)) {
dragging_index = 2;
drag_sv = [ _data[0], _data[1], _data[2], _data[3], _data[4] ];
drag_dat = [ _data[0], _data[1], _data[2], _data[3], _data[4] ];
dragging = instance_create(0, 0, rotator_Rotator).init(_m, _kx, _ky1);
}
2023-09-11 16:08:58 +02:00
}
2024-03-29 05:20:49 +01:00
draw_set_color(CDEF.main_dkgrey);
draw_circle_angle(_kx, _ky0, _kr, _data[1], _data[2], 32);
draw_circle_angle(_kx, _ky1, _kr, _data[3], _data[4], 32);
2023-09-11 16:08:58 +02:00
2024-03-29 05:20:49 +01:00
shader_set(sh_widget_rotator_range);
shader_set_f("side", _r);
shader_set_color("color", _kc0);
shader_set_f("angle", degtorad(_data[1]), degtorad(_data[2]));
2024-03-26 04:03:45 +01:00
2024-03-29 05:20:49 +01:00
draw_sprite_stretched(s_fx_pixel, 0, _x, _y, _r, _r);
2024-03-26 04:03:45 +01:00
2024-03-29 05:20:49 +01:00
shader_set_color("color", _kc1);
shader_set_f("angle", degtorad(_data[3]), degtorad(_data[4]));
2024-03-26 04:03:45 +01:00
2024-03-29 05:20:49 +01:00
draw_sprite_stretched(s_fx_pixel, 0, _x, _y + _h + ui(4), _r, _r);
shader_reset();
}
2023-09-11 16:08:58 +02:00
2024-03-26 04:03:45 +01:00
break;
#endregion
2023-09-11 16:08:58 +02:00
2024-03-26 04:03:45 +01:00
case 3 : #region
var _ky0 = _y + _r / 2;
var _ky1 = _y + _h + ui(4) + _r / 2;
2023-09-11 16:08:58 +02:00
2024-03-26 04:03:45 +01:00
var _kc0 = _kc;
var _kc1 = _kc;
2023-09-11 16:08:58 +02:00
2024-03-26 04:03:45 +01:00
tb_min_0.setFocusHover(active, hover);
tb_max_0.setFocusHover(active, hover);
tb_min_1.setFocusHover(active, hover);
2023-09-11 16:08:58 +02:00
2024-03-31 05:36:11 +02:00
tb_min_0.draw(_tx, _ty, _tw, _h, array_safe_get_fast(_data, 1), _m);
tb_max_0.draw(_tx, _ty + _h + ui(4), _tw, _h, array_safe_get_fast(_data, 2), _m);
tb_min_1.draw(_tx + _tw, _ty, _tw, h, array_safe_get_fast(_data, 3), _m);
2023-09-11 16:08:58 +02:00
2024-03-29 05:20:49 +01:00
if(_drawRot) {
var _a0 = _data[1] - _data[3];
var _a1 = _data[1] + _data[3];
var _a2 = _data[2] - _data[3];
var _a3 = _data[2] + _data[3];
2023-09-11 16:08:58 +02:00
2024-03-29 05:20:49 +01:00
if(dragging_index > -1) {
var val = point_direction(_kx, _ky, _m[0], _m[1]);
if(key_mod_press(CTRL)) val = round(val / 15) * 15;
2023-09-11 16:08:58 +02:00
2024-03-29 05:20:49 +01:00
var real_val = [ drag_sv[0], drag_sv[1], drag_sv[2], drag_sv[3], drag_sv[4] ];
var val;
var ind = dragging_index;
2023-09-11 16:08:58 +02:00
2024-03-29 05:20:49 +01:00
real_val[ind] = round(drag_sv[ind] + dragging.delta_acc);
val = key_mod_press(CTRL)? round(real_val[ind] / 15) * 15 : real_val[ind];
2023-09-11 16:08:58 +02:00
if(onModify(val, ind)) UNDO_HOLDING = true;
2023-09-11 16:08:58 +02:00
2024-03-29 05:20:49 +01:00
MOUSE_BLOCK = true;
2024-01-16 11:00:39 +01:00
2024-03-29 05:20:49 +01:00
if(mouse_check_button_pressed(mb_right)) {
for( var i = 0; i < 5; i++ ) onModify(drag_dat[i], i);
2024-03-29 05:20:49 +01:00
instance_destroy(rotator_Rotator);
dragging = noone;
dragging_index = -1;
UNDO_HOLDING = false;
2024-03-29 05:20:49 +01:00
} else if(mouse_release(mb_left)) {
instance_destroy(rotator_Rotator);
dragging = noone;
dragging_index = -1;
UNDO_HOLDING = false;
}
2024-03-26 04:03:45 +01:00
2024-03-29 05:20:49 +01:00
} else if(hover && point_in_rectangle(_m[0], _m[1], _x, _y, _x + _r, _y + _r)) {
_kc0 = COLORS._main_icon_light;
2023-09-11 16:08:58 +02:00
2024-03-29 05:20:49 +01:00
if(mouse_press(mb_left, active)) {
dragging_index = 1;
drag_sv = [ _data[0], _data[1], _data[2], _data[3], _data[4] ];
drag_dat = [ _data[0], _data[1], _data[2], _data[3], _data[4] ];
dragging = instance_create(0, 0, rotator_Rotator).init(_m, _kx, _ky0);
}
} else if(hover && point_in_rectangle(_m[0], _m[1], _x, _y + _h + ui(4), _x + _r, _y + _h + ui(4) + _r)) {
_kc1 = COLORS._main_icon_light;
2024-03-26 04:03:45 +01:00
2024-03-29 05:20:49 +01:00
if(mouse_press(mb_left, active)) {
dragging_index = 2;
drag_sv = [ _data[0], _data[1], _data[2], _data[3], _data[4] ];
drag_dat = [ _data[0], _data[1], _data[2], _data[3], _data[4] ];
dragging = instance_create(0, 0, rotator_Rotator).init(_m, _kx, _ky1);
}
2023-09-11 16:08:58 +02:00
}
2024-03-26 04:03:45 +01:00
2024-03-29 05:20:49 +01:00
draw_set_color(CDEF.main_dkgrey);
draw_circle_angle(_kx, _ky0, _kr, _a0, _a1, 32);
draw_circle_angle(_kx, _ky1, _kr, _a2, _a3, 32);
2024-03-26 04:03:45 +01:00
2024-03-29 05:20:49 +01:00
shader_set(sh_widget_rotator);
shader_set_f("side", _r);
shader_set_color("color", _kc0);
shader_set_f("angle", degtorad(_data[1]));
2024-03-26 04:03:45 +01:00
2024-03-29 05:20:49 +01:00
draw_sprite_stretched(s_fx_pixel, 0, _x, _y, _r, _r);
2024-03-26 04:03:45 +01:00
2024-03-29 05:20:49 +01:00
shader_set_color("color", _kc1);
shader_set_f("angle", degtorad(_data[2]));
2024-03-26 04:03:45 +01:00
2024-03-29 05:20:49 +01:00
draw_sprite_stretched(s_fx_pixel, 0, _x, _y + _h + ui(4), _r, _r);
shader_reset();
}
2023-09-11 16:08:58 +02:00
break;
2024-03-26 04:03:45 +01:00
#endregion
2023-09-11 16:08:58 +02:00
}
2024-02-10 07:03:50 +01:00
knob_hovering = _kHover;
2023-09-11 16:08:58 +02:00
resetFocus();
return h;
}
2024-03-31 11:10:14 +02:00
static clone = function() {
2024-03-31 11:10:14 +02:00
var cln = new rotatorRandom(onModify);
return cln;
}
2024-11-24 11:39:17 +01:00
static free = function() {
tb_min_0.free();
tb_max_0.free();
tb_min_1.free();
tb_max_1.free();
}
2023-09-11 16:08:58 +02:00
}