mirror of
https://github.com/Ttanasart-pt/Pixel-Composer.git
synced 2024-12-24 14:06:23 +01:00
- Shorten tag name in "graphic.json" theme file.
This commit is contained in:
parent
f821f552f2
commit
89cbd946a7
37 changed files with 89 additions and 34 deletions
Binary file not shown.
|
@ -1,5 +1,6 @@
|
|||
function __Node_3D_Displace(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "3D Displace";
|
||||
batch_output = false;
|
||||
|
||||
inputs[| 0] = nodeValue("Dimension", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, DEF_SURF)
|
||||
.setDisplay(VALUE_DISPLAY.vector);
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
function __Node_3D_Extrude(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "3D Extrude";
|
||||
batch_output = false;
|
||||
|
||||
inputs[| 0] = nodeValue("Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, noone);
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
function __Node_3D_Plane(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "3D Plane";
|
||||
batch_output = false;
|
||||
|
||||
inputs[| 0] = nodeValue("Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, noone);
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
function __Node_3D_Cone(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "3D Cone";
|
||||
batch_output = false;
|
||||
|
||||
inputs[| 0] = nodeValue("Dimension", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, DEF_SURF)
|
||||
.setDisplay(VALUE_DISPLAY.vector);
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
function __Node_3D_Cube(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "3D Cube";
|
||||
batch_output = false;
|
||||
dimension_index = 1;
|
||||
|
||||
inputs[| 0] = nodeValue("Main texture", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, USE_DEF);
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
function __Node_3D_Cylinder(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "3D Cylinder";
|
||||
batch_output = false;
|
||||
dimension_index = 2;
|
||||
|
||||
inputs[| 0] = nodeValue("Sides", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 16);
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
function __Node_3D_Sphere(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "3D Sphere";
|
||||
batch_output = false;
|
||||
dimension_index = 1;
|
||||
|
||||
inputs[| 0] = nodeValue("Subdivisions", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, [8, 4], "Amount of polygon in X and Y axis.")
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
function __Node_3D_Transform(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "3D Transform";
|
||||
batch_output = false;
|
||||
|
||||
inputs[| 0] = nodeValue("Dimension", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, DEF_SURF)
|
||||
.setDisplay(VALUE_DISPLAY.vector);
|
||||
|
|
|
@ -7,6 +7,7 @@ enum LIGHT_SHAPE_2D {
|
|||
|
||||
function Node_2D_light(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "2D Light";
|
||||
batch_output = false;
|
||||
|
||||
shader = sh_2d_light;
|
||||
uniform_colr = shader_get_uniform(shader, "color");
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
function Node_3D_Transform_Image(_x, _y, _group = noone) : Node_3D_Mesh(_x, _y, _group) constructor {
|
||||
name = "Transform 3D";
|
||||
batch_output = false;
|
||||
|
||||
preview_channel = 1;
|
||||
object = new __3dPlane();
|
||||
|
|
|
@ -10,6 +10,7 @@ function __armature_bind_data(_surface, _bone, _tran, _aang, _pang, _asca, _psca
|
|||
|
||||
function Node_Armature_Bind(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Armature Bind";
|
||||
batch_output = false;
|
||||
|
||||
inputs[| 0] = nodeValue("Dimension", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, DEF_SURF)
|
||||
.setDisplay(VALUE_DISPLAY.vector);
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
function Node_Average(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Average";
|
||||
batch_output = false;
|
||||
|
||||
shader = sh_average;
|
||||
uniform_dim = shader_get_uniform(shader, "dimension");
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
function Node_Color_adjust(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Color Adjust";
|
||||
batch_output = false;
|
||||
|
||||
inputs[| 0] = nodeValue("Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, noone);
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
function Node_Color_Data(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Color Data";
|
||||
batch_output = false;
|
||||
setDimension(96, 48);
|
||||
|
||||
inputs[| 0] = nodeValue("Color", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, c_white)
|
||||
|
|
|
@ -11,7 +11,7 @@ enum COMPOSE_OUTPUT_SCALING {
|
|||
}
|
||||
|
||||
function Node_Composite(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Composite";
|
||||
name = "Composite";
|
||||
|
||||
inputs[| 0] = nodeValue("Padding", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, [ 0, 0, 0, 0 ])
|
||||
.setDisplay(VALUE_DISPLAY.padding);
|
||||
|
@ -408,8 +408,11 @@ function Node_Composite(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
|||
|
||||
outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
|
||||
|
||||
outputs[| 1] = nodeValue("Atlas data", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, [])
|
||||
.rejectArrayProcess();
|
||||
outputs[| 1] = nodeValue("Atlas data", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, []);
|
||||
|
||||
outputs[| 2] = nodeValue("Dimension", self, JUNCTION_CONNECT.output, VALUE_TYPE.integer, [1, 1])
|
||||
.setVisible(false)
|
||||
.setDisplay(VALUE_DISPLAY.vector);
|
||||
|
||||
temp_surface = [ surface_create(1, 1), surface_create(1, 1), surface_create(1, 1) ];
|
||||
blend_temp_surface = temp_surface[2];
|
||||
|
@ -429,8 +432,6 @@ function Node_Composite(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
|||
overlay_w = 0;
|
||||
overlay_h = 0;
|
||||
|
||||
atlas_data = [];
|
||||
|
||||
static drawOverlay = function(hover, active, _x, _y, _s, _mx, _my, _snx, _sny) { #region
|
||||
PROCESSOR_OVERLAY_CHECK
|
||||
|
||||
|
@ -716,18 +717,18 @@ function Node_Composite(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
|||
surface_selecting = input_fix_len;
|
||||
} #endregion
|
||||
|
||||
static processData = function(_outSurf, _data, _output_index, _array_index) { #region
|
||||
if(_output_index == 1) return atlas_data;
|
||||
if(_output_index == 0 && _array_index == 0) atlas_data = [];
|
||||
static processData = function(_outData, _data, _output_index, _array_index) { #region
|
||||
var _outSurf = _outData[0];
|
||||
|
||||
if(array_length(_data) <= input_fix_len) return [ _outSurf, noone, [1, 1] ];
|
||||
|
||||
if(array_length(_data) <= input_fix_len) return _outSurf;
|
||||
var _pad = _data[0];
|
||||
var _dim_type = _data[1];
|
||||
var _dim = _data[2];
|
||||
var base = _data[3];
|
||||
var cDep = attrDepth();
|
||||
|
||||
if(!is_surface(base)) return _outSurf;
|
||||
if(!is_surface(base)) return [ _outSurf, noone, [1, 1] ];
|
||||
|
||||
#region dimension
|
||||
var ww = 0, hh = 0;
|
||||
|
@ -766,6 +767,7 @@ function Node_Composite(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
|||
var _vis = attributes.layer_visible;
|
||||
var bg = 0;
|
||||
var _bg = 0;
|
||||
var _atlas = [];
|
||||
|
||||
blend_temp_surface = temp_surface[2];
|
||||
|
||||
|
@ -793,7 +795,7 @@ function Node_Composite(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
|||
|
||||
var _d0 = point_rotate(cx - _sw / 2, cy - _sh / 2, cx, cy, _rot);
|
||||
|
||||
array_push(atlas_data, new SurfaceAtlas(_s, _d0[0], _d0[1], _rot, _sca[0], _sca[1]));
|
||||
array_push(_atlas, new SurfaceAtlas(_s, _d0[0], _d0[1], _rot, _sca[0], _sca[1]));
|
||||
|
||||
surface_set_shader(temp_surface[_bg], sh_sample, true, BLEND.over);
|
||||
draw_surface_blend_ext(temp_surface[!_bg], _s, _d0[0], _d0[1], _sca[0], _sca[1], _rot, c_white, _alp, _bld, true);
|
||||
|
@ -808,7 +810,7 @@ function Node_Composite(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
|||
draw_surface_safe(temp_surface[!_bg]);
|
||||
surface_reset_shader();
|
||||
|
||||
return _outSurf;
|
||||
return [ _outSurf, _atlas, [ww, hh] ];
|
||||
} #endregion
|
||||
|
||||
static attributeSerialize = function() { #region
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
function Node_Gradient_Extract(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Gradient Data";
|
||||
batch_output = false;
|
||||
setDimension(96);
|
||||
|
||||
inputs[| 0] = nodeValue("Gradient", self, JUNCTION_CONNECT.input, VALUE_TYPE.gradient, new gradientObject(c_white) )
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
function Node_Gradient_Out(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Gradient";
|
||||
batch_output = false;
|
||||
setDimension(96);
|
||||
|
||||
inputs[| 0] = nodeValue("Gradient", self, JUNCTION_CONNECT.input, VALUE_TYPE.gradient, new gradientObject([ cola(c_black), cola(c_white) ]) );
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
function Node_HSV_Channel(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "HSV Extract";
|
||||
batch_output = false;
|
||||
|
||||
inputs[| 0] = nodeValue("Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, noone);
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
function Node_Mirror(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Mirror";
|
||||
batch_output = false;
|
||||
|
||||
inputs[| 0] = nodeValue("Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, noone);
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
function Node_MK_Blinker(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "MK Blinker";
|
||||
batch_output = false;
|
||||
|
||||
inputs[| 0] = nodeValue("Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, noone);
|
||||
|
||||
|
|
|
@ -23,6 +23,7 @@ function __FlarePart(_type = FLARE_TYPE.circle, _t = 0, _r = 4, _a = 0.5, _seg =
|
|||
|
||||
function Node_MK_Flare(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "MK Lens Flare";
|
||||
batch_output = false;
|
||||
|
||||
inputs[| 0] = nodeValue("Background", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, noone);
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
function Node_Outline(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Outline";
|
||||
batch_output = false;
|
||||
|
||||
attributes.filter = array_create(9, 1);
|
||||
filtering_vl = false;
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
function Node_Path_Sample(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Sample Path";
|
||||
setDimension(96, 48);;
|
||||
batch_output = false;
|
||||
setDimension(96, 48);
|
||||
|
||||
inputs[| 0] = nodeValue("Path", self, JUNCTION_CONNECT.input, VALUE_TYPE.pathnode, noone)
|
||||
.setVisible(true, true);
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
function Node_PB_Box_Contract(_x, _y, _group = noone) : Node_PB_Box(_x, _y, _group) constructor {
|
||||
name = "Split";
|
||||
batch_output = false;
|
||||
|
||||
inputs[| 1] = nodeValue("pBox", self, JUNCTION_CONNECT.input, VALUE_TYPE.pbBox, noone )
|
||||
.setVisible(true, true);
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
function Node_PB_Box_Divide(_x, _y, _group = noone) : Node_PB_Box(_x, _y, _group) constructor {
|
||||
name = "Divide";
|
||||
batch_output = false;
|
||||
|
||||
inputs[| 1] = nodeValue("pBox", self, JUNCTION_CONNECT.input, VALUE_TYPE.pbBox, noone )
|
||||
.setVisible(true, true);
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
function Node_PB_Box_Inset(_x, _y, _group = noone) : Node_PB_Box(_x, _y, _group) constructor {
|
||||
name = "Inset";
|
||||
batch_output = false;
|
||||
|
||||
inputs[| 1] = nodeValue("pBox", self, JUNCTION_CONNECT.input, VALUE_TYPE.pbBox, noone )
|
||||
.setVisible(true, true);
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
function Node_PB_Box_Split(_x, _y, _group = noone) : Node_PB_Box(_x, _y, _group) constructor {
|
||||
name = "Split";
|
||||
batch_output = false;
|
||||
|
||||
inputs[| 1] = nodeValue("pBox", self, JUNCTION_CONNECT.input, VALUE_TYPE.pbBox, noone )
|
||||
.setVisible(true, true);
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
function Node_PB_Fx(_x, _y, _group = noone) : Node_PB(_x, _y, _group) constructor {
|
||||
name = "PB FX";
|
||||
batch_output = false;
|
||||
|
||||
inputs[| 0] = nodeValue("pBox", self, JUNCTION_CONNECT.input, VALUE_TYPE.pbBox, noone)
|
||||
.setVisible(true, true);
|
||||
|
|
|
@ -20,7 +20,7 @@ function Node_Processor(_x, _y, _group = noone) : Node(_x, _y, _group) construct
|
|||
manage_atlas = true;
|
||||
atlas_index = 0;
|
||||
|
||||
batch_output = false; //Run processData once with all outputs as array.
|
||||
batch_output = true; //Run processData once with all outputs as array.
|
||||
|
||||
icon = THEME.node_processor_icon;
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
function Node_RGB_Channel(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "RGBA Extract";
|
||||
batch_output = false;
|
||||
|
||||
inputs[| 0] = nodeValue("Surface In", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, noone);
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@ enum NODE_SCATTER_DIST {
|
|||
|
||||
function Node_Scatter(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Scatter";
|
||||
batch_output = false;
|
||||
dimension_index = 1;
|
||||
|
||||
inputs[| 0] = nodeValue("Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, noone);
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
function Node_Shadow_Cast(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Cast Shadow";
|
||||
batch_output = false;
|
||||
|
||||
inputs[| 0] = nodeValue("Background", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, noone);
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
function Node_Shape_Polygon(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Draw Shape Polygon";
|
||||
batch_output = false;
|
||||
|
||||
shapesArray = [ "Rectangle", "Ellipse", "Star", "Capsule", "Ring", "Arc", "Gear", "Cross" ];
|
||||
for( var i = 0, n = array_length(shapesArray); i < n; i++ )
|
||||
|
|
|
@ -1808,14 +1808,11 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
|
|||
static drawJunction = function(_s, _mx, _my) { #region
|
||||
_s /= 2;
|
||||
|
||||
var hov = PANEL_GRAPH.pHOVER && (PANEL_GRAPH.node_hovering == noone || PANEL_GRAPH.node_hovering == node);
|
||||
var _d = 24 * _s;
|
||||
var hov = PANEL_GRAPH.pHOVER && (PANEL_GRAPH.node_hovering == noone || PANEL_GRAPH.node_hovering == node);
|
||||
var _d = 24 * _s;
|
||||
var is_hover = hov && point_in_rectangle(_mx, _my, x - _d, y - _d, x + _d - 1, y + _d - 1);
|
||||
hover_in_graph = is_hover;
|
||||
|
||||
var _bgS = THEME.node_junctions_bg;
|
||||
var _fgS = is_hover? THEME.node_junctions_outline_hover : THEME.node_junctions_outline;
|
||||
|
||||
if(is_dummy) {
|
||||
__draw_sprite_ext(THEME.node_junction_add, is_hover, x, y, _s, _s, 0, c_white, 0.5 + 0.5 * is_hover);
|
||||
|
||||
|
@ -1834,7 +1831,19 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
|
|||
_cbg = merge_color(draw_blend_color, _cbg, draw_blend);
|
||||
_cfg = merge_color(draw_blend_color, _cfg, draw_blend);
|
||||
}
|
||||
|
||||
|
||||
var _bgS, _fgS;
|
||||
|
||||
if(_s > .5) {
|
||||
_bgS = THEME.node_junctions_bg_x2;
|
||||
_fgS = is_hover? THEME.node_junctions_outline_hover_x2 : THEME.node_junctions_outline_x2;
|
||||
|
||||
} else {
|
||||
_bgS = THEME.node_junctions_bg;
|
||||
_fgS = is_hover? THEME.node_junctions_outline_hover : THEME.node_junctions_outline;
|
||||
_s *= 2;
|
||||
}
|
||||
|
||||
__draw_sprite_ext(_bgS, draw_junction_index, x, y, _s, _s, 0, _cbg, 1);
|
||||
__draw_sprite_ext(_fgS, draw_junction_index, x, y, _s, _s, 0, _cfg, 1);
|
||||
}
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
function Node_Vector_Split(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { #region
|
||||
name = "Vector Split";
|
||||
color = COLORS.node_blend_number;
|
||||
batch_output = false;
|
||||
|
||||
setDimension(96, 0);
|
||||
|
||||
draw_padding = 4;
|
||||
|
|
|
@ -26,22 +26,33 @@ function _sprite_load_from_struct(str, theme, key) { #region
|
|||
INLINE
|
||||
|
||||
var path = _sprite_path(str.path, theme);
|
||||
var s = sprite_add(path, str.subimages, false, true, str.xorigin, str.yorigin);
|
||||
var s = sprite_add(path, str.s, false, true, str.x, str.y);
|
||||
|
||||
if(str.slice) {
|
||||
var slice = sprite_nineslice_create();
|
||||
slice.enabled = str.slice.enabled;
|
||||
slice.left = str.slice.left;
|
||||
slice.right = str.slice.right;
|
||||
slice.top = str.slice.top;
|
||||
slice.bottom = str.slice.bottom;
|
||||
|
||||
if(struct_has(str.slice, "tilemode"))
|
||||
slice.tilemode = str.slice.tilemode;
|
||||
|
||||
if(s >= 0) sprite_set_nineslice(s, slice);
|
||||
else log_message("THEME", $"Load sprite {path} failed.");
|
||||
if(s < 0) {
|
||||
log_message("THEME", $"Load sprite {path} failed.");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if(struct_has(str, "slice")) {
|
||||
var slice = sprite_nineslice_create();
|
||||
slice.enabled = true;
|
||||
|
||||
if(is_array(str.slice)) {
|
||||
slice.left = str.slice[0];
|
||||
slice.right = str.slice[1];
|
||||
slice.top = str.slice[2];
|
||||
slice.bottom = str.slice[3];
|
||||
|
||||
} else if(is_real(str.slice)) {
|
||||
slice.left = str.slice;
|
||||
slice.right = str.slice;
|
||||
slice.top = str.slice;
|
||||
slice.bottom = str.slice;
|
||||
|
||||
}
|
||||
sprite_set_nineslice(s, slice);
|
||||
}
|
||||
|
||||
return s;
|
||||
} #endregion
|
||||
|
||||
|
|
Loading…
Reference in a new issue