mirror of
https://github.com/Ttanasart-pt/Pixel-Composer.git
synced 2025-01-26 12:58:49 +01:00
export template preview
This commit is contained in:
parent
83f2ea53bf
commit
c43e93f092
14 changed files with 778 additions and 671 deletions
|
@ -204,6 +204,7 @@
|
||||||
{"name":"sh_noise_grid_hex","order":2,"path":"shaders/sh_noise_grid_hex/sh_noise_grid_hex.yy",},
|
{"name":"sh_noise_grid_hex","order":2,"path":"shaders/sh_noise_grid_hex/sh_noise_grid_hex.yy",},
|
||||||
{"name":"node_3d_obj","order":8,"path":"scripts/node_3d_obj/node_3d_obj.yy",},
|
{"name":"node_3d_obj","order":8,"path":"scripts/node_3d_obj/node_3d_obj.yy",},
|
||||||
{"name":"__path","order":1,"path":"scripts/__path/__path.yy",},
|
{"name":"__path","order":1,"path":"scripts/__path/__path.yy",},
|
||||||
|
{"name":"draw_text_path","order":25,"path":"scripts/draw_text_path/draw_text_path.yy",},
|
||||||
{"name":"sh_brush_outline","order":7,"path":"shaders/sh_brush_outline/sh_brush_outline.yy",},
|
{"name":"sh_brush_outline","order":7,"path":"shaders/sh_brush_outline/sh_brush_outline.yy",},
|
||||||
{"name":"s_node_grid_tri_noise","order":22,"path":"sprites/s_node_grid_tri_noise/s_node_grid_tri_noise.yy",},
|
{"name":"s_node_grid_tri_noise","order":22,"path":"sprites/s_node_grid_tri_noise/s_node_grid_tri_noise.yy",},
|
||||||
{"name":"o_dialog_menubox","order":1,"path":"objects/o_dialog_menubox/o_dialog_menubox.yy",},
|
{"name":"o_dialog_menubox","order":1,"path":"objects/o_dialog_menubox/o_dialog_menubox.yy",},
|
||||||
|
|
|
@ -718,6 +718,7 @@
|
||||||
{"id":{"name":"sh_noise_grid_hex","path":"shaders/sh_noise_grid_hex/sh_noise_grid_hex.yy",},},
|
{"id":{"name":"sh_noise_grid_hex","path":"shaders/sh_noise_grid_hex/sh_noise_grid_hex.yy",},},
|
||||||
{"id":{"name":"node_3d_obj","path":"scripts/node_3d_obj/node_3d_obj.yy",},},
|
{"id":{"name":"node_3d_obj","path":"scripts/node_3d_obj/node_3d_obj.yy",},},
|
||||||
{"id":{"name":"__path","path":"scripts/__path/__path.yy",},},
|
{"id":{"name":"__path","path":"scripts/__path/__path.yy",},},
|
||||||
|
{"id":{"name":"draw_text_path","path":"scripts/draw_text_path/draw_text_path.yy",},},
|
||||||
{"id":{"name":"sh_brush_outline","path":"shaders/sh_brush_outline/sh_brush_outline.yy",},},
|
{"id":{"name":"sh_brush_outline","path":"shaders/sh_brush_outline/sh_brush_outline.yy",},},
|
||||||
{"id":{"name":"s_node_grid_tri_noise","path":"sprites/s_node_grid_tri_noise/s_node_grid_tri_noise.yy",},},
|
{"id":{"name":"s_node_grid_tri_noise","path":"sprites/s_node_grid_tri_noise/s_node_grid_tri_noise.yy",},},
|
||||||
{"id":{"name":"o_dialog_menubox","path":"objects/o_dialog_menubox/o_dialog_menubox.yy",},},
|
{"id":{"name":"o_dialog_menubox","path":"objects/o_dialog_menubox/o_dialog_menubox.yy",},},
|
||||||
|
|
|
@ -12,7 +12,7 @@ function draw_text_delimiter(ch_x, ch_y, _str) {
|
||||||
} else
|
} else
|
||||||
draw_set_color(cc);
|
draw_set_color(cc);
|
||||||
|
|
||||||
draw_text(_x, _y, ch);
|
draw_text_add(_x, _y, ch);
|
||||||
_x += string_width(ch);
|
_x += string_width(ch);
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -120,8 +120,8 @@ function __string_width_ext(text, sep, w) {
|
||||||
#macro _string_height_ext string_height_ext
|
#macro _string_height_ext string_height_ext
|
||||||
#macro string_height_ext __string_height_ext
|
#macro string_height_ext __string_height_ext
|
||||||
|
|
||||||
function __string_height_ext(text, sep, w) {
|
function __string_height_ext(text, sep, w, _break = LOCALE.config.per_character_line_break) {
|
||||||
if(!LOCALE.config.per_character_line_break)
|
if(!_break)
|
||||||
return _string_height_ext(text, sep, w);
|
return _string_height_ext(text, sep, w);
|
||||||
|
|
||||||
var lw = 0;
|
var lw = 0;
|
||||||
|
|
42
scripts/draw_text_path/draw_text_path.gml
Normal file
42
scripts/draw_text_path/draw_text_path.gml
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
function draw_text_path(_x, _y, _text) {
|
||||||
|
draw_set_text(font == noone? f_p0 : font, fa_left, fa_top, color);
|
||||||
|
var _x0 = _x, ch = "", len = string_length(_text), i = 1;
|
||||||
|
var cc = draw_get_color();
|
||||||
|
var str = "", _comm = false;
|
||||||
|
|
||||||
|
while(i <= len) {
|
||||||
|
ch = string_char_at(_text, i);
|
||||||
|
|
||||||
|
if(ch == "%")
|
||||||
|
_comm = true;
|
||||||
|
|
||||||
|
if(!_comm) {
|
||||||
|
draw_text_add(_x0, _y, ch);
|
||||||
|
_x0 += string_width(ch);
|
||||||
|
} else {
|
||||||
|
str += ch;
|
||||||
|
switch(ch) {
|
||||||
|
case "d" : draw_set_color(COLORS.widget_text_dec_d); break;
|
||||||
|
case "n" : draw_set_color(COLORS.widget_text_dec_n); break;
|
||||||
|
case "e" : draw_set_color(COLORS.widget_text_dec_e); break;
|
||||||
|
case "f" : draw_set_color(COLORS.widget_text_dec_f); break;
|
||||||
|
case "i" : draw_set_color(COLORS.widget_text_dec_i); break;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch(ch) {
|
||||||
|
case "d" : case "n" : case "e" : case "f" : case "i" :
|
||||||
|
draw_text_add(_x0, _y, str);
|
||||||
|
_x0 += string_width(str);
|
||||||
|
_comm = false;
|
||||||
|
str = "";
|
||||||
|
|
||||||
|
draw_set_color(cc);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
|
||||||
|
draw_text_add(_x0, _y, str);
|
||||||
|
}
|
11
scripts/draw_text_path/draw_text_path.yy
Normal file
11
scripts/draw_text_path/draw_text_path.yy
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
{
|
||||||
|
"resourceType": "GMScript",
|
||||||
|
"resourceVersion": "1.0",
|
||||||
|
"name": "draw_text_path",
|
||||||
|
"isCompatibility": false,
|
||||||
|
"isDnD": false,
|
||||||
|
"parent": {
|
||||||
|
"name": "draw",
|
||||||
|
"path": "folders/functions/draw.yy",
|
||||||
|
},
|
||||||
|
}
|
|
@ -58,7 +58,7 @@ function draw_code(_x, _y, str) {
|
||||||
if(i < amo - 1) word += "\"";
|
if(i < amo - 1) word += "\"";
|
||||||
|
|
||||||
draw_set_color(COLORS.lua_highlight_string);
|
draw_set_color(COLORS.lua_highlight_string);
|
||||||
draw_text(tx, ty, word);
|
draw_text_add(tx, ty, word);
|
||||||
tx += string_width(word);
|
tx += string_width(word);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -81,7 +81,7 @@ function draw_code(_x, _y, str) {
|
||||||
draw_set_color(COLORS.lua_highlight_function);
|
draw_set_color(COLORS.lua_highlight_function);
|
||||||
}
|
}
|
||||||
|
|
||||||
draw_text(tx, ty, word);
|
draw_text_add(tx, ty, word);
|
||||||
tx += string_width(word);
|
tx += string_width(word);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,6 +59,8 @@ function Node_Export(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
|
||||||
|
|
||||||
inputs[| 2] = nodeValue("Template", self, JUNCTION_CONNECT.input, VALUE_TYPE.text, "%d%n")
|
inputs[| 2] = nodeValue("Template", self, JUNCTION_CONNECT.input, VALUE_TYPE.text, "%d%n")
|
||||||
.rejectArray();
|
.rejectArray();
|
||||||
|
inputs[| 2].editWidget.format = TEXT_AREA_FORMAT.path_template;
|
||||||
|
inputs[| 2].editWidget.auto_update = true;
|
||||||
|
|
||||||
format_single = ["Single image", "Image sequence", "Animation"];
|
format_single = ["Single image", "Image sequence", "Animation"];
|
||||||
format_array = ["Multiple images", "Image sequences", "Animation"];
|
format_array = ["Multiple images", "Image sequences", "Animation"];
|
||||||
|
@ -112,8 +114,86 @@ function Node_Export(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
|
||||||
outputs[| 1] = nodeValue("Preview", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone)
|
outputs[| 1] = nodeValue("Preview", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone)
|
||||||
.setVisible(false);
|
.setVisible(false);
|
||||||
|
|
||||||
|
template_guide = [
|
||||||
|
["%d", "Directory"],
|
||||||
|
["%1d", "Goes up 1 level"],
|
||||||
|
["%n", "File name"],
|
||||||
|
["%f", "Frame"],
|
||||||
|
["%i", "Array index"],
|
||||||
|
];
|
||||||
|
export_template = new Inspector_Custom_Renderer(function(_x, _y, _w, _m, _hover, _focus) {
|
||||||
|
var _tx = _x + ui(10);
|
||||||
|
var _ty = _y;
|
||||||
|
var _tw = _w - ui(8);
|
||||||
|
|
||||||
|
var rawpath = inputs[| 1].getValue(,,, true);
|
||||||
|
if(is_array(rawpath)) rawpath = array_safe_get(rawpath, 0, "");
|
||||||
|
|
||||||
|
var _ext = inputs[| 9].getValue(,,, true);
|
||||||
|
var path = pathString(rawpath);
|
||||||
|
var pathA = pathString(rawpath,, true);
|
||||||
|
path = string_replace(path, ".png", array_safe_get(inputs[| 9].display_data, _ext, ""));
|
||||||
|
|
||||||
|
draw_set_text(f_p1, fa_left, fa_top, COLORS._main_text);
|
||||||
|
var _th = ui(12) + string_height_ext(path, -1, _tw - ui(16), true);
|
||||||
|
draw_sprite_stretched_ext(THEME.ui_panel_bg, 1, _tx, _ty, _tw, _th, COLORS.node_composite_bg_blend, 1);
|
||||||
|
|
||||||
|
var lw = 0;
|
||||||
|
var lx = _tx + ui(8);
|
||||||
|
var ly = _ty + ui(6);
|
||||||
|
|
||||||
|
draw_set_alpha(0.9);
|
||||||
|
for( var i = 0, n = array_length(pathA); i < n; i++ ) {
|
||||||
|
var _txt = pathA[i];
|
||||||
|
|
||||||
|
if(is_array(_txt)) {
|
||||||
|
switch(_txt[0]) {
|
||||||
|
case "d" : draw_set_color(COLORS.widget_text_dec_d); break;
|
||||||
|
case "n" : draw_set_color(COLORS.widget_text_dec_n); break;
|
||||||
|
case "f" : draw_set_color(COLORS.widget_text_dec_f); break;
|
||||||
|
case "i" : draw_set_color(COLORS.widget_text_dec_i); break;
|
||||||
|
case "ext" : draw_set_color(COLORS._main_text_sub); break;
|
||||||
|
}
|
||||||
|
|
||||||
|
_txt = _txt[1];
|
||||||
|
} else
|
||||||
|
draw_set_color(COLORS._main_text);
|
||||||
|
|
||||||
|
for( var j = 1; j <= string_length(_txt); j++ ) {
|
||||||
|
var ch = string_char_at(_txt, j);
|
||||||
|
var ww = string_width(ch);
|
||||||
|
|
||||||
|
if(lw + ww > _tw - ui(16)) {
|
||||||
|
lw = 0;
|
||||||
|
lx = _tx + ui(8);
|
||||||
|
ly += string_height("M");
|
||||||
|
}
|
||||||
|
|
||||||
|
draw_text(lx, ly, ch);
|
||||||
|
|
||||||
|
lw += ww;
|
||||||
|
lx += ww;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
draw_set_alpha(1);
|
||||||
|
|
||||||
|
var hh = _th + ui(116);
|
||||||
|
var _cy = _y + _th + ui(8);
|
||||||
|
for( var i = 0, n = array_length(template_guide); i < n; i++ ) {
|
||||||
|
var _yy = _cy + ui(20) * i;
|
||||||
|
|
||||||
|
draw_set_text(f_p1, fa_left, fa_top, COLORS._main_text_sub);
|
||||||
|
draw_text_add(_x + ui(16 + 16), _yy, template_guide[i][0]);
|
||||||
|
|
||||||
|
draw_set_text(f_p1, fa_right, fa_top, COLORS._main_text_sub);
|
||||||
|
draw_text_add(_x + _w - ui(4 + 16), _yy, template_guide[i][1]);
|
||||||
|
}
|
||||||
|
|
||||||
|
return hh;
|
||||||
|
});
|
||||||
|
|
||||||
input_display_list = [
|
input_display_list = [
|
||||||
["Export", false], 0, 1, 2, 4,
|
["Export", false], 0, 1, 2, export_template,
|
||||||
["Format ", false], 3, 9,
|
["Format ", false], 3, 9,
|
||||||
["Settings", false], 12, 8, 5, 6, 7, 10, 11,
|
["Settings", false], 12, 8, 5, 6, 7, 10, 11,
|
||||||
];
|
];
|
||||||
|
@ -256,12 +336,18 @@ function Node_Export(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
|
||||||
PANEL_MENU.setNotiIcon(THEME.noti_icon_tick);
|
PANEL_MENU.setNotiIcon(THEME.noti_icon_tick);
|
||||||
}
|
}
|
||||||
|
|
||||||
static pathString = function(path, suff, index = 0) {
|
static pathString = function(path, index = 0, _array = false) {
|
||||||
|
var suff = inputs[| 2].getValue();
|
||||||
var form = inputs[| 3].getValue();
|
var form = inputs[| 3].getValue();
|
||||||
var strt = inputs[| 11].getValue();
|
var strt = inputs[| 11].getValue();
|
||||||
|
|
||||||
var s = "", i = 1, ch, ch_s;
|
path = string_replace_all(path, "\\", "/");
|
||||||
|
|
||||||
|
var s = _array? [] : "";
|
||||||
|
var i = 1;
|
||||||
|
var ch, ch_s;
|
||||||
var len = string_length(suff);
|
var len = string_length(suff);
|
||||||
|
|
||||||
while(i <= len) {
|
while(i <= len) {
|
||||||
ch = string_char_at(suff, i);
|
ch = string_char_at(suff, i);
|
||||||
|
|
||||||
|
@ -273,40 +359,51 @@ function Node_Export(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
|
||||||
ch_s = string_char_at(suff, i);
|
ch_s = string_char_at(suff, i);
|
||||||
switch(ch_s) {
|
switch(ch_s) {
|
||||||
case "f" :
|
case "f" :
|
||||||
|
var _txt = "";
|
||||||
var float_str = string_digits(str);
|
var float_str = string_digits(str);
|
||||||
if(float_str != "") {
|
if(float_str != "") {
|
||||||
var float_val = string_digits(float_str);
|
var float_val = string_digits(float_str);
|
||||||
var str_val = max(float_val - string_length(string(PROJECT.animator.current_frame + strt)), 0);
|
var str_val = max(float_val - string_length(string(PROJECT.animator.current_frame + strt)), 0);
|
||||||
repeat(str_val)
|
repeat(str_val)
|
||||||
s += "0";
|
_txt += "0";
|
||||||
}
|
}
|
||||||
|
|
||||||
s += string(PROJECT.animator.current_frame + strt);
|
_txt += string(PROJECT.animator.current_frame + strt);
|
||||||
|
if(_array) array_push(s, [ "f", _txt ]);
|
||||||
|
else s += _txt;
|
||||||
res = true;
|
res = true;
|
||||||
break;
|
break;
|
||||||
case "i" :
|
case "i" :
|
||||||
s += string(index);
|
if(_array) array_push(s, [ "i", string(index) ]);
|
||||||
|
else s += string(index);
|
||||||
res = true;
|
res = true;
|
||||||
break;
|
break;
|
||||||
case "d" :
|
case "d" :
|
||||||
var dir = filename_dir(path) + "/";
|
var dir = filename_dir(path) + "/";
|
||||||
|
var _txt = "";
|
||||||
|
|
||||||
var float_str = string_digits(str);
|
var float_str = string_digits(str);
|
||||||
if(float_str != "") {
|
if(float_str != "") {
|
||||||
var float_val = string_digits(float_str);
|
var float_val = toNumber(string_digits(float_str)) + 1;
|
||||||
var dir_s = "";
|
var dir_s = "";
|
||||||
var sep = string_splice(dir, "/");
|
var sep = string_splice(dir, "/");
|
||||||
for(var j = 0; j < array_length(sep) - float_val; j++) {
|
|
||||||
|
for(var j = 0; j < array_length(sep) - float_val; j++)
|
||||||
dir_s += sep[j] + "/";
|
dir_s += sep[j] + "/";
|
||||||
}
|
_txt += dir_s;
|
||||||
s += dir_s;
|
|
||||||
} else
|
} else
|
||||||
s += dir;
|
_txt += dir;
|
||||||
|
|
||||||
|
if(_array) array_push(s, [ "d", _txt ]);
|
||||||
|
else s += _txt;
|
||||||
res = true;
|
res = true;
|
||||||
break;
|
break;
|
||||||
case "n" :
|
case "n" :
|
||||||
var ext = filename_ext(path);
|
var ext = filename_ext(path);
|
||||||
s += string_replace(filename_name(path), ext, "");
|
var _txt = string_replace(filename_name(path), ext, "");
|
||||||
|
|
||||||
|
if(_array) array_push(s, [ "n", _txt ]);
|
||||||
|
else s += _txt;
|
||||||
res = true;
|
res = true;
|
||||||
break;
|
break;
|
||||||
default :
|
default :
|
||||||
|
@ -316,12 +413,14 @@ function Node_Export(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
|
||||||
i++;
|
i++;
|
||||||
} until(i > string_length(suff) || res);
|
} until(i > string_length(suff) || res);
|
||||||
} else {
|
} else {
|
||||||
s += ch;
|
if(_array) array_push(s, ch);
|
||||||
|
else s += ch;
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
s += ".png";
|
if(_array) array_push(s, ["ext", ".png"]);
|
||||||
|
else s += ".png";
|
||||||
|
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
@ -397,9 +496,9 @@ function Node_Export(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
|
||||||
p = directory + "/" + string(i) + "/" + string_lead_zero(PROJECT.animator.current_frame, 5) + ".png";
|
p = directory + "/" + string(i) + "/" + string_lead_zero(PROJECT.animator.current_frame, 5) + ".png";
|
||||||
} else {
|
} else {
|
||||||
if(is_array(path) && array_length(path) == array_length(surf))
|
if(is_array(path) && array_length(path) == array_length(surf))
|
||||||
p = pathString(path[ safe_mod(i, array_length(path)) ], suff, i);
|
p = pathString(path[ safe_mod(i, array_length(path)) ], i);
|
||||||
else
|
else
|
||||||
p = pathString(path, suff, i);
|
p = pathString(path, i);
|
||||||
}
|
}
|
||||||
|
|
||||||
p = save_surface(_surf, p);
|
p = save_surface(_surf, p);
|
||||||
|
@ -419,7 +518,7 @@ function Node_Export(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
|
||||||
if(form == NODE_EXPORT_FORMAT.gif)
|
if(form == NODE_EXPORT_FORMAT.gif)
|
||||||
p = directory + "/" + string_lead_zero(PROJECT.animator.current_frame, 5) + ".png";
|
p = directory + "/" + string_lead_zero(PROJECT.animator.current_frame, 5) + ".png";
|
||||||
else
|
else
|
||||||
p = pathString(p, suff);
|
p = pathString(p);
|
||||||
|
|
||||||
//print("Exporting " + p);
|
//print("Exporting " + p);
|
||||||
p = save_surface(surf, p);
|
p = save_surface(surf, p);
|
||||||
|
@ -545,9 +644,9 @@ function Node_Export(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
|
||||||
for(var i = 0; i < array_length(surf); i++) {
|
for(var i = 0; i < array_length(surf); i++) {
|
||||||
temp_path = directory + "/" + string(i) + "/" + "*.png";
|
temp_path = directory + "/" + string(i) + "/" + "*.png";
|
||||||
if(is_array(path))
|
if(is_array(path))
|
||||||
target_path = pathString(path[ safe_mod(i, array_length(path)) ], suff, i);
|
target_path = pathString(path[ safe_mod(i, array_length(path)) ], i);
|
||||||
else
|
else
|
||||||
target_path = pathString(path, suff, i);
|
target_path = pathString(path, i);
|
||||||
|
|
||||||
if(extd == 0) {
|
if(extd == 0) {
|
||||||
target_path = string_replace(target_path, ".png", ".gif");
|
target_path = string_replace(target_path, ".png", ".gif");
|
||||||
|
@ -558,7 +657,7 @@ function Node_Export(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
target_path = pathString(path, suff);
|
target_path = pathString(path);
|
||||||
|
|
||||||
if(extd == 0) {
|
if(extd == 0) {
|
||||||
target_path = string_replace(target_path, ".png", ".gif");
|
target_path = string_replace(target_path, ".png", ".gif");
|
||||||
|
|
|
@ -76,9 +76,7 @@ enum VALUE_DISPLAY {
|
||||||
path_array,
|
path_array,
|
||||||
|
|
||||||
//Text
|
//Text
|
||||||
export_format,
|
|
||||||
code,
|
code,
|
||||||
node_title,
|
|
||||||
text_array,
|
text_array,
|
||||||
|
|
||||||
//path
|
//path
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -643,8 +643,9 @@ function Panel_Inspector() : PanelContent() constructor {
|
||||||
tb_node_name.hide = true;
|
tb_node_name.hide = true;
|
||||||
tb_node_name.setFocusHover(pFOCUS, pHOVER);
|
tb_node_name.setFocusHover(pFOCUS, pHOVER);
|
||||||
tb_node_name.align = fa_center;
|
tb_node_name.align = fa_center;
|
||||||
|
tb_node_name.format = TEXT_AREA_FORMAT.node_title;
|
||||||
var txt = inspecting.display_name == ""? inspecting.name : inspecting.display_name;
|
var txt = inspecting.display_name == ""? inspecting.name : inspecting.display_name;
|
||||||
tb_node_name.draw(ui(64), ui(14), w - ui(128), ui(32), txt, [mx, my], VALUE_DISPLAY.node_title);
|
tb_node_name.draw(ui(64), ui(14), w - ui(128), ui(32), txt, [mx, my]);
|
||||||
|
|
||||||
draw_set_text(f_p1, fa_center, fa_center, COLORS._main_text_sub);
|
draw_set_text(f_p1, fa_center, fa_center, COLORS._main_text_sub);
|
||||||
draw_text_add(w / 2 + ui(8), ui(56), inspecting.name);
|
draw_text_add(w / 2 + ui(8), ui(56), inspecting.name);
|
||||||
|
|
|
@ -5,7 +5,7 @@ function Panel_Preview() : PanelContent() constructor {
|
||||||
|
|
||||||
last_focus = noone;
|
last_focus = noone;
|
||||||
|
|
||||||
static initSize = function() {
|
function initSize() {
|
||||||
canvas_x = w / 2;
|
canvas_x = w / 2;
|
||||||
canvas_y = h / 2;
|
canvas_y = h / 2;
|
||||||
}
|
}
|
||||||
|
@ -73,6 +73,9 @@ function Panel_Preview() : PanelContent() constructor {
|
||||||
|
|
||||||
tileMode = 0;
|
tileMode = 0;
|
||||||
|
|
||||||
|
tb_framerate = new textBox(TEXTBOX_INPUT.number, function(val) { preview_rate = real(val); });
|
||||||
|
|
||||||
|
#region ++++ toolbars & actions ++++
|
||||||
toolbar_height = ui(40);
|
toolbar_height = ui(40);
|
||||||
toolbars = [
|
toolbars = [
|
||||||
[
|
[
|
||||||
|
@ -149,9 +152,9 @@ function Panel_Preview() : PanelContent() constructor {
|
||||||
],
|
],
|
||||||
|
|
||||||
]
|
]
|
||||||
|
#endregion
|
||||||
|
|
||||||
tb_framerate = new textBox(TEXTBOX_INPUT.number, function(val) { preview_rate = real(val); });
|
#region ++++ hotkey ++++
|
||||||
|
|
||||||
addHotkey("Preview", "Focus content", "F", MOD_KEY.none, function() { PANEL_PREVIEW.fullView(); });
|
addHotkey("Preview", "Focus content", "F", MOD_KEY.none, function() { PANEL_PREVIEW.fullView(); });
|
||||||
addHotkey("Preview", "Save current frame", "S", MOD_KEY.shift, function() { PANEL_PREVIEW.saveCurrentFrame(); });
|
addHotkey("Preview", "Save current frame", "S", MOD_KEY.shift, function() { PANEL_PREVIEW.saveCurrentFrame(); });
|
||||||
addHotkey("Preview", "Save all current frame", -1, MOD_KEY.none, function() { PANEL_PREVIEW.saveAllCurrentFrames(); });
|
addHotkey("Preview", "Save all current frame", -1, MOD_KEY.none, function() { PANEL_PREVIEW.saveAllCurrentFrames(); });
|
||||||
|
@ -166,28 +169,29 @@ function Panel_Preview() : PanelContent() constructor {
|
||||||
if(PREF_MAP[? "alt_picker"]) return;
|
if(PREF_MAP[? "alt_picker"]) return;
|
||||||
PANEL_PREVIEW.canvas_zooming_key = true;
|
PANEL_PREVIEW.canvas_zooming_key = true;
|
||||||
});
|
});
|
||||||
|
#endregion
|
||||||
|
|
||||||
function setNodePreview(node) {
|
function setNodePreview(node) { #region
|
||||||
if(resetViewOnDoubleClick)
|
if(resetViewOnDoubleClick)
|
||||||
do_fullView = true;
|
do_fullView = true;
|
||||||
|
|
||||||
preview_node[splitView? splitSelection : 0] = node;
|
preview_node[splitView? splitSelection : 0] = node;
|
||||||
}
|
} #endregion
|
||||||
|
|
||||||
function removeNodePreview(node) {
|
function removeNodePreview(node) { #region
|
||||||
if(preview_node[0] == node) preview_node[0] = noone;
|
if(preview_node[0] == node) preview_node[0] = noone;
|
||||||
if(preview_node[1] == node) preview_node[1] = noone;
|
if(preview_node[1] == node) preview_node[1] = noone;
|
||||||
}
|
} #endregion
|
||||||
|
|
||||||
function resetNodePreview() {
|
function resetNodePreview() { #region
|
||||||
preview_node = [ noone, noone ];
|
preview_node = [ noone, noone ];
|
||||||
}
|
} #endregion
|
||||||
|
|
||||||
function getNodePreview() { return preview_node[splitView? splitSelection : 0]; }
|
function getNodePreview() { return preview_node[splitView? splitSelection : 0]; }
|
||||||
function getNodePreviewSurface() { return preview_surface[splitView? splitSelection : 0]; }
|
function getNodePreviewSurface() { return preview_surface[splitView? splitSelection : 0]; }
|
||||||
function getNodePreviewSequence() { return preview_sequence[splitView? splitSelection : 0]; }
|
function getNodePreviewSequence() { return preview_sequence[splitView? splitSelection : 0]; }
|
||||||
|
|
||||||
function getPreviewData() {
|
function getPreviewData() { #region
|
||||||
preview_surface = [ 0, 0 ];
|
preview_surface = [ 0, 0 ];
|
||||||
preview_sequence = [ 0, 0 ];
|
preview_sequence = [ 0, 0 ];
|
||||||
|
|
||||||
|
@ -227,11 +231,11 @@ function Panel_Preview() : PanelContent() constructor {
|
||||||
canvas_w = surface_get_width(prevS);
|
canvas_w = surface_get_width(prevS);
|
||||||
canvas_h = surface_get_height(prevS);
|
canvas_h = surface_get_height(prevS);
|
||||||
}
|
}
|
||||||
}
|
} #endregion
|
||||||
|
|
||||||
function onFocusBegin() { PANEL_PREVIEW = self; }
|
function onFocusBegin() { PANEL_PREVIEW = self; }
|
||||||
|
|
||||||
function dragCanvas() {
|
function dragCanvas() { #region
|
||||||
if(canvas_dragging) {
|
if(canvas_dragging) {
|
||||||
if(!MOUSE_WRAPPING) {
|
if(!MOUSE_WRAPPING) {
|
||||||
var dx = mx - canvas_drag_mx;
|
var dx = mx - canvas_drag_mx;
|
||||||
|
@ -322,9 +326,9 @@ function Panel_Preview() : PanelContent() constructor {
|
||||||
canvas_dragging_key = false;
|
canvas_dragging_key = false;
|
||||||
canvas_zooming_key = false;
|
canvas_zooming_key = false;
|
||||||
canvas_hover = point_in_rectangle(mx, my, 0, toolbar_height, w, h - toolbar_height);
|
canvas_hover = point_in_rectangle(mx, my, 0, toolbar_height, w, h - toolbar_height);
|
||||||
}
|
} #endregion
|
||||||
|
|
||||||
function fullView() {
|
function fullView() { #region
|
||||||
var node = getNodePreview();
|
var node = getNodePreview();
|
||||||
if(node == noone) {
|
if(node == noone) {
|
||||||
canvas_s = 1;
|
canvas_s = 1;
|
||||||
|
@ -345,18 +349,18 @@ function Panel_Preview() : PanelContent() constructor {
|
||||||
canvas_s = ss;
|
canvas_s = ss;
|
||||||
canvas_x = w / 2 - bbox.w * canvas_s / 2 - bbox.x0 * canvas_s + (tool_side_drawing * 40 / 2);
|
canvas_x = w / 2 - bbox.w * canvas_s / 2 - bbox.x0 * canvas_s + (tool_side_drawing * 40 / 2);
|
||||||
canvas_y = h / 2 - bbox.h * canvas_s / 2 - bbox.y0 * canvas_s;
|
canvas_y = h / 2 - bbox.h * canvas_s / 2 - bbox.y0 * canvas_s;
|
||||||
}
|
} #endregion
|
||||||
|
|
||||||
sbChannel = new scrollBox([], function(index) {
|
sbChannel = new scrollBox([], function(index) { #region
|
||||||
var node = getNodePreview();
|
var node = getNodePreview();
|
||||||
if(node == noone) return;
|
if(node == noone) return;
|
||||||
|
|
||||||
node.preview_channel = array_safe_get(sbChannelIndex, index);
|
node.preview_channel = array_safe_get(sbChannelIndex, index);
|
||||||
});
|
}); #endregion
|
||||||
|
|
||||||
sbChannelIndex = [];
|
sbChannelIndex = [];
|
||||||
sbChannel.align = fa_left;
|
sbChannel.align = fa_left;
|
||||||
function drawNodeChannel(_x, _y) {
|
function drawNodeChannel(_x, _y) { #region
|
||||||
var _node = getNodePreview();
|
var _node = getNodePreview();
|
||||||
if(_node == noone) return;
|
if(_node == noone) return;
|
||||||
if(ds_list_size(_node.outputs) < 2) return;
|
if(ds_list_size(_node.outputs) < 2) return;
|
||||||
|
@ -381,16 +385,9 @@ function Panel_Preview() : PanelContent() constructor {
|
||||||
|
|
||||||
sbChannel.draw(_x - ww, _y - hh / 2, ww, hh, currName, [mx, my], x, y);
|
sbChannel.draw(_x - ww, _y - hh / 2, ww, hh, currName, [mx, my], x, y);
|
||||||
right_menu_y += ui(40);
|
right_menu_y += ui(40);
|
||||||
}
|
} #endregion
|
||||||
|
|
||||||
/**
|
function drawOnionSkin(node, psx, psy, ss) { #region
|
||||||
* Function Description
|
|
||||||
* @param {Struct.Node} node Description
|
|
||||||
* @param {any*} psx Description
|
|
||||||
* @param {any*} psy Description
|
|
||||||
* @param {any*} ss Description
|
|
||||||
*/
|
|
||||||
function drawOnionSkin(node, psx, psy, ss) {
|
|
||||||
var _surf = preview_surface[0];
|
var _surf = preview_surface[0];
|
||||||
var _rang = PROJECT.onion_skin.range;
|
var _rang = PROJECT.onion_skin.range;
|
||||||
|
|
||||||
|
@ -423,9 +420,9 @@ function Panel_Preview() : PanelContent() constructor {
|
||||||
}
|
}
|
||||||
|
|
||||||
if(_top) draw_surface_ext_safe(_surf, psx, psy, ss, ss);
|
if(_top) draw_surface_ext_safe(_surf, psx, psy, ss, ss);
|
||||||
}
|
} #endregion
|
||||||
|
|
||||||
function drawNodePreview() {
|
function drawNodePreview() { #region
|
||||||
var ss = canvas_s;
|
var ss = canvas_s;
|
||||||
var psx = 0, psy = 0;
|
var psx = 0, psy = 0;
|
||||||
var psw = 0, psh = 0;
|
var psw = 0, psh = 0;
|
||||||
|
@ -590,9 +587,9 @@ function Panel_Preview() : PanelContent() constructor {
|
||||||
draw_set_color(COLORS.panel_preview_surface_outline);
|
draw_set_color(COLORS.panel_preview_surface_outline);
|
||||||
draw_rectangle(psx, psy, psx + pswd - 1, psy + pshd - 1, true);
|
draw_rectangle(psx, psy, psx + pswd - 1, psy + pshd - 1, true);
|
||||||
}
|
}
|
||||||
}
|
} #endregion
|
||||||
|
|
||||||
function drawPreviewOverlay() {
|
function drawPreviewOverlay() { #region
|
||||||
right_menu_y = toolbar_height - ui(4);
|
right_menu_y = toolbar_height - ui(4);
|
||||||
toolbar_draw = false;
|
toolbar_draw = false;
|
||||||
|
|
||||||
|
@ -705,12 +702,12 @@ function Panel_Preview() : PanelContent() constructor {
|
||||||
}
|
}
|
||||||
draw_sprite_ui_uniform(THEME.sequence_control, 0, bx + ui(20), by + ui(20), 1, COLORS._main_accent, .75);
|
draw_sprite_ui_uniform(THEME.sequence_control, 0, bx + ui(20), by + ui(20), 1, COLORS._main_accent, .75);
|
||||||
}
|
}
|
||||||
}
|
} #endregion
|
||||||
|
|
||||||
tool_hovering = false;
|
tool_hovering = false;
|
||||||
tool_side_drawing = false;
|
tool_side_drawing = false;
|
||||||
|
|
||||||
function drawNodeTools(active, _node) {
|
function drawNodeTools(active, _node) { #region
|
||||||
var _mx = mx;
|
var _mx = mx;
|
||||||
var _my = my;
|
var _my = my;
|
||||||
var isHover = pHOVER && mouse_on_preview;
|
var isHover = pHOVER && mouse_on_preview;
|
||||||
|
@ -823,9 +820,9 @@ function Panel_Preview() : PanelContent() constructor {
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
tool_current = noone;
|
tool_current = noone;
|
||||||
}
|
} #endregion
|
||||||
|
|
||||||
function drawToolBar(_node) {
|
function drawToolBar(_node) { #region
|
||||||
toolbar_height = ui(40);
|
toolbar_height = ui(40);
|
||||||
var ty = h - toolbar_height;
|
var ty = h - toolbar_height;
|
||||||
//draw_sprite_stretched_ext(THEME.toolbar_shadow, 0, 0, ty - 12 + 4, w, 12, c_white, 0.5);
|
//draw_sprite_stretched_ext(THEME.toolbar_shadow, 0, 0, ty - 12 + 4, w, 12, c_white, 0.5);
|
||||||
|
@ -942,9 +939,9 @@ function Panel_Preview() : PanelContent() constructor {
|
||||||
draw_set_color(COLORS.panel_toolbar_separator);
|
draw_set_color(COLORS.panel_toolbar_separator);
|
||||||
draw_line_width(tbx + ui(12), tby - toolbar_height / 2 + ui(8), tbx + ui(12), tby + toolbar_height / 2 - ui(8), 2);
|
draw_line_width(tbx + ui(12), tby - toolbar_height / 2 + ui(8), tbx + ui(12), tby + toolbar_height / 2 - ui(8), 2);
|
||||||
drawNodeChannel(tbx, tby);
|
drawNodeChannel(tbx, tby);
|
||||||
}
|
} #endregion
|
||||||
|
|
||||||
function drawSplitView() {
|
function drawSplitView() { #region
|
||||||
if(splitView == 0) return;
|
if(splitView == 0) return;
|
||||||
|
|
||||||
draw_set_color(COLORS.panel_preview_split_line);
|
draw_set_color(COLORS.panel_preview_split_line);
|
||||||
|
@ -1004,9 +1001,9 @@ function Panel_Preview() : PanelContent() constructor {
|
||||||
splitSelection = 1;
|
splitSelection = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} #endregion
|
||||||
|
|
||||||
function drawContent(panel) {
|
function drawContent(panel) { #region >>>>>>>>>>>>>>>>>>>> MAIN DRAW <<<<<<<<<<<<<<<<<<<<
|
||||||
mouse_on_preview = pHOVER && point_in_rectangle(mx, my, 0, toolbar_height, w, h - toolbar_height);
|
mouse_on_preview = pHOVER && point_in_rectangle(mx, my, 0, toolbar_height, w, h - toolbar_height);
|
||||||
|
|
||||||
draw_clear(COLORS.panel_bg_clear);
|
draw_clear(COLORS.panel_bg_clear);
|
||||||
|
@ -1056,9 +1053,9 @@ function Panel_Preview() : PanelContent() constructor {
|
||||||
|
|
||||||
drawSplitView();
|
drawSplitView();
|
||||||
drawToolBar(tool);
|
drawToolBar(tool);
|
||||||
}
|
} #endregion
|
||||||
|
|
||||||
function copyCurrentFrame() {
|
function copyCurrentFrame() { #region
|
||||||
var prevS = getNodePreviewSurface();
|
var prevS = getNodePreviewSurface();
|
||||||
if(!is_surface(prevS)) return;
|
if(!is_surface(prevS)) return;
|
||||||
|
|
||||||
|
@ -1075,9 +1072,9 @@ function Panel_Preview() : PanelContent() constructor {
|
||||||
surface_free(s);
|
surface_free(s);
|
||||||
|
|
||||||
clipboard_set_bitmap(buffer_get_address(buff), surface_get_width(prevS), surface_get_height(prevS));
|
clipboard_set_bitmap(buffer_get_address(buff), surface_get_width(prevS), surface_get_height(prevS));
|
||||||
}
|
} #endregion
|
||||||
|
|
||||||
function saveCurrentFrame() {
|
function saveCurrentFrame() { #region
|
||||||
var prevS = getNodePreviewSurface();
|
var prevS = getNodePreviewSurface();
|
||||||
if(!is_surface(prevS)) return;
|
if(!is_surface(prevS)) return;
|
||||||
|
|
||||||
|
@ -1087,9 +1084,9 @@ function Panel_Preview() : PanelContent() constructor {
|
||||||
if(filename_ext(path) != ".png") path += ".png";
|
if(filename_ext(path) != ".png") path += ".png";
|
||||||
|
|
||||||
surface_save_safe(prevS, path);
|
surface_save_safe(prevS, path);
|
||||||
}
|
} #endregion
|
||||||
|
|
||||||
function saveAllCurrentFrames() {
|
function saveAllCurrentFrames() { #region
|
||||||
var path = get_save_filename(".png", "export");
|
var path = get_save_filename(".png", "export");
|
||||||
key_release();
|
key_release();
|
||||||
if(path == "") return;
|
if(path == "") return;
|
||||||
|
@ -1106,5 +1103,5 @@ function Panel_Preview() : PanelContent() constructor {
|
||||||
surface_save_safe(prev, _name);
|
surface_save_safe(prev, _name);
|
||||||
ind++;
|
ind++;
|
||||||
}
|
}
|
||||||
}
|
} #endregion
|
||||||
}
|
}
|
|
@ -1,7 +1,9 @@
|
||||||
enum TEXT_AREA_FORMAT {
|
enum TEXT_AREA_FORMAT {
|
||||||
_default,
|
_default,
|
||||||
code,
|
code,
|
||||||
delimiter
|
delimiter,
|
||||||
|
path_template,
|
||||||
|
node_title,
|
||||||
}
|
}
|
||||||
|
|
||||||
function textArea(_input, _onModify, _extras = noone) : textInput(_input, _onModify, _extras) constructor {
|
function textArea(_input, _onModify, _extras = noone) : textInput(_input, _onModify, _extras) constructor {
|
||||||
|
@ -514,11 +516,13 @@ function textArea(_input, _onModify, _extras = noone) : textInput(_input, _onMod
|
||||||
_str = _input_text_line[i];
|
_str = _input_text_line[i];
|
||||||
|
|
||||||
if(format == TEXT_AREA_FORMAT._default)
|
if(format == TEXT_AREA_FORMAT._default)
|
||||||
draw_text(ch_x, ch_y, _str);
|
draw_text_add(ch_x, ch_y, _str);
|
||||||
else if(format == TEXT_AREA_FORMAT.code)
|
else if(format == TEXT_AREA_FORMAT.code)
|
||||||
draw_code(ch_x, ch_y, _str);
|
draw_code(ch_x, ch_y, _str);
|
||||||
else if(format == TEXT_AREA_FORMAT.delimiter)
|
else if(format == TEXT_AREA_FORMAT.delimiter)
|
||||||
draw_text_delimiter(ch_x, ch_y, _str);
|
draw_text_delimiter(ch_x, ch_y, _str);
|
||||||
|
else if(format == TEXT_AREA_FORMAT.path_template)
|
||||||
|
draw_text_path(ch_x, ch_y, _str);
|
||||||
|
|
||||||
ch_y += line_get_height();
|
ch_y += line_get_height();
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,6 +9,7 @@ function textBox(_input, _onModify, _extras = noone) : textInput(_input, _onModi
|
||||||
font = noone;
|
font = noone;
|
||||||
color = COLORS._main_text;
|
color = COLORS._main_text;
|
||||||
boxColor = c_white;
|
boxColor = c_white;
|
||||||
|
format = TEXT_AREA_FORMAT._default;
|
||||||
|
|
||||||
no_empty = true;
|
no_empty = true;
|
||||||
auto_update = false;
|
auto_update = false;
|
||||||
|
@ -226,61 +227,19 @@ function textBox(_input, _onModify, _extras = noone) : textInput(_input, _onModi
|
||||||
apply();
|
apply();
|
||||||
}
|
}
|
||||||
|
|
||||||
static display_text = function(_x, _y, _text, _w, _format, _m = -1) {
|
static display_text = function(_x, _y, _text, _w, _m = -1) {
|
||||||
_text = string_real(_text);
|
_text = string_real(_text);
|
||||||
BLEND_OVERRIDE;
|
BLEND_OVERRIDE;
|
||||||
if(!interactable) draw_set_alpha(0.5);
|
if(!interactable) draw_set_alpha(0.5);
|
||||||
|
|
||||||
switch(_format) {
|
switch(format) {
|
||||||
case VALUE_DISPLAY._default :
|
case TEXT_AREA_FORMAT._default :
|
||||||
draw_set_text(font == noone? f_p0 : font, fa_left, fa_top, color);
|
draw_set_text(font == noone? f_p0 : font, fa_left, fa_top, color);
|
||||||
draw_text(_x + disp_x, _y, _text);
|
draw_text_add(_x + disp_x, _y, _text);
|
||||||
break;
|
break;
|
||||||
case VALUE_DISPLAY.export_format :
|
case TEXT_AREA_FORMAT.node_title :
|
||||||
draw_set_text(font == noone? f_p0 : font, fa_left, fa_top, color);
|
draw_set_text(font == noone? f_p0 : font, fa_left, fa_top, color);
|
||||||
var _x0 = _x + disp_x, ch = "", len = string_length(_text), i = 1;
|
draw_text_add(_x + disp_x, _y, _text);
|
||||||
var cc = draw_get_color();
|
|
||||||
var str = "", _comm = false;
|
|
||||||
|
|
||||||
while(i <= len) {
|
|
||||||
ch = string_char_at(_text, i);
|
|
||||||
|
|
||||||
if(ch == "%")
|
|
||||||
_comm = true;
|
|
||||||
|
|
||||||
if(!_comm) {
|
|
||||||
draw_text(_x0, 0, ch);
|
|
||||||
_x0 += string_width(ch);
|
|
||||||
} else {
|
|
||||||
str += ch;
|
|
||||||
switch(ch) {
|
|
||||||
case "d" : draw_set_color(COLORS.widget_text_dec_d); break;
|
|
||||||
case "n" : draw_set_color(COLORS.widget_text_dec_n); break;
|
|
||||||
case "e" : draw_set_color(COLORS.widget_text_dec_e); break;
|
|
||||||
case "f" : draw_set_color(COLORS.widget_text_dec_f); break;
|
|
||||||
case "i" : draw_set_color(COLORS.widget_text_dec_i); break;
|
|
||||||
}
|
|
||||||
|
|
||||||
switch(ch) {
|
|
||||||
case "d" : case "n" : case "e" : case "f" : case "i" :
|
|
||||||
draw_text(_x0, 0, str);
|
|
||||||
_x0 += string_width(str);
|
|
||||||
_comm = false;
|
|
||||||
str = "";
|
|
||||||
|
|
||||||
draw_set_color(cc);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
i++;
|
|
||||||
}
|
|
||||||
|
|
||||||
draw_text(_x0, _y, str);
|
|
||||||
break;
|
|
||||||
case VALUE_DISPLAY.node_title :
|
|
||||||
draw_set_text(font == noone? f_p0 : font, fa_left, fa_top, color);
|
|
||||||
draw_text(_x + disp_x, _y, _text);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -318,10 +277,10 @@ function textBox(_input, _onModify, _extras = noone) : textInput(_input, _onModi
|
||||||
}
|
}
|
||||||
|
|
||||||
static drawParam = function(params) {
|
static drawParam = function(params) {
|
||||||
return draw(params.x, params.y, params.w, params.h, params.data, params.m,, params.halign, params.valign);
|
return draw(params.x, params.y, params.w, params.h, params.data, params.m, params.halign, params.valign);
|
||||||
}
|
}
|
||||||
|
|
||||||
static draw = function(_x, _y, _w, _h, _text = "", _m = mouse_ui, _format = VALUE_DISPLAY._default, halign = fa_left, valign = fa_top) {
|
static draw = function(_x, _y, _w, _h, _text = "", _m = mouse_ui, halign = fa_left, valign = fa_top) {
|
||||||
x = _x;
|
x = _x;
|
||||||
y = _y;
|
y = _y;
|
||||||
w = _w;
|
w = _w;
|
||||||
|
@ -496,7 +455,7 @@ function textBox(_input, _onModify, _extras = noone) : textInput(_input, _onModi
|
||||||
|
|
||||||
surface_set_target(text_surface);
|
surface_set_target(text_surface);
|
||||||
DRAW_CLEAR
|
DRAW_CLEAR
|
||||||
display_text(tx - tb_surf_x, _h / 2 - th / 2, txt, _w - ui(4), _format, _mx);
|
display_text(tx - tb_surf_x, _h / 2 - th / 2, txt, _w - ui(4), _mx);
|
||||||
surface_reset_target();
|
surface_reset_target();
|
||||||
draw_surface(text_surface, tb_surf_x, tb_surf_y);
|
draw_surface(text_surface, tb_surf_x, tb_surf_y);
|
||||||
|
|
||||||
|
@ -560,7 +519,7 @@ function textBox(_input, _onModify, _extras = noone) : textInput(_input, _onModi
|
||||||
//draw_set_color(c_black);
|
//draw_set_color(c_black);
|
||||||
//draw_line(0, _h / 2 - th / 2, 9999, _h / 2 - th / 2);
|
//draw_line(0, _h / 2 - th / 2, 9999, _h / 2 - th / 2);
|
||||||
|
|
||||||
display_text(tx - tb_surf_x, _h / 2 - th / 2, _display_text, _w - ui(4), _format);
|
display_text(tx - tb_surf_x, _h / 2 - th / 2, _display_text, _w - ui(4));
|
||||||
surface_reset_target();
|
surface_reset_target();
|
||||||
draw_surface(text_surface, tb_surf_x, tb_surf_y);
|
draw_surface(text_surface, tb_surf_x, tb_surf_y);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue