2022-01-13 05:24:03 +01:00
|
|
|
function vectorBox(_size, _type, _onModify) constructor {
|
|
|
|
size = _size;
|
|
|
|
onModify = _onModify;
|
|
|
|
|
|
|
|
hover = false;
|
|
|
|
active = false;
|
|
|
|
|
|
|
|
axis = [ "x", "y", "z", "w" ];
|
|
|
|
onModifySingle[0] = function(val) { onModify(0, toNumber(val)); }
|
|
|
|
onModifySingle[1] = function(val) { onModify(1, toNumber(val)); }
|
|
|
|
onModifySingle[2] = function(val) { onModify(2, toNumber(val)); }
|
|
|
|
onModifySingle[3] = function(val) { onModify(3, toNumber(val)); }
|
|
|
|
|
|
|
|
extras = -1;
|
|
|
|
|
|
|
|
for(var i = 0; i < size; i++) {
|
|
|
|
tb[i] = new textBox(_type, onModifySingle[i]);
|
|
|
|
tb[i].slidable = true;
|
|
|
|
}
|
|
|
|
|
2022-01-24 02:21:25 +01:00
|
|
|
static draw = function(_x, _y, _w, _h, _data, _m) {
|
2022-01-13 05:24:03 +01:00
|
|
|
if(extras && instanceof(extras) == "buttonClass") {
|
|
|
|
extras.hover = hover;
|
|
|
|
extras.active = active;
|
|
|
|
|
2022-11-03 11:44:49 +01:00
|
|
|
extras.draw(_x + _w - ui(32), _y + _h / 2 - ui(32 / 2), ui(32), ui(32), _m, s_button_hide);
|
|
|
|
_w -= ui(40);
|
2022-01-13 05:24:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
var ww = _w / size;
|
|
|
|
for(var i = 0; i < array_length(_data); i++) {
|
|
|
|
tb[i].hover = hover;
|
|
|
|
tb[i].active = active;
|
|
|
|
|
|
|
|
var bx = _x + ww * i;
|
2022-11-03 11:44:49 +01:00
|
|
|
tb[i].draw(bx + ui(24), _y, ww - ui(24), _h, _data[i], _m);
|
2022-01-13 05:24:03 +01:00
|
|
|
|
|
|
|
draw_set_text(f_p0, fa_left, fa_center, c_ui_blue_grey);
|
2022-11-03 11:44:49 +01:00
|
|
|
draw_text(bx + ui(8), _y + _h / 2, axis[i]);
|
2022-01-13 05:24:03 +01:00
|
|
|
}
|
|
|
|
hover = false;
|
|
|
|
active = false;
|
|
|
|
}
|
|
|
|
}
|