[Shape] Add corner radius property to gear shape.

This commit is contained in:
Tanasart 2024-10-28 16:14:57 +07:00
parent d7b7f85665
commit ceffc4caea
59 changed files with 1242 additions and 308 deletions

View file

@ -1174,6 +1174,7 @@
{"name":"node_threshold","order":9,"path":"scripts/node_threshold/node_threshold.yy",},
{"name":"node_tile_random","order":16,"path":"scripts/node_tile_random/node_tile_random.yy",},
{"name":"node_tile","order":5,"path":"scripts/node_tile/node_tile.yy",},
{"name":"node_tiler_export","order":5,"path":"scripts/node_tiler_export/node_tiler_export.yy",},
{"name":"node_tiler_tileset","order":3,"path":"scripts/node_tiler_tileset/node_tiler_tileset.yy",},
{"name":"node_time_remap","order":3,"path":"scripts/node_time_remap/node_time_remap.yy",},
{"name":"node_timeline_preview","order":2,"path":"scripts/node_timeline_preview/node_timeline_preview.yy",},
@ -1767,6 +1768,8 @@
{"name":"sh_texture_remap","order":11,"path":"shaders/sh_texture_remap/sh_texture_remap.yy",},
{"name":"sh_threshold","order":18,"path":"shaders/sh_threshold/sh_threshold.yy",},
{"name":"sh_tile_random","order":32,"path":"shaders/sh_tile_random/sh_tile_random.yy",},
{"name":"sh_tile_rule_apply","order":9,"path":"shaders/sh_tile_rule_apply/sh_tile_rule_apply.yy",},
{"name":"sh_tile_rule_select","order":10,"path":"shaders/sh_tile_rule_select/sh_tile_rule_select.yy",},
{"name":"sh_tiler_autoterrain_apply","order":8,"path":"shaders/sh_tiler_autoterrain_apply/sh_tiler_autoterrain_apply.yy",},
{"name":"sh_tiler_autoterrain_mask","order":7,"path":"shaders/sh_tiler_autoterrain_mask/sh_tiler_autoterrain_mask.yy",},
{"name":"sh_time_remap","order":2,"path":"shaders/sh_time_remap/sh_time_remap.yy",},
@ -1826,9 +1829,10 @@
{"name":"s_arrow_16","order":22,"path":"sprites/s_arrow_16/s_arrow_16.yy",},
{"name":"s_arrow_back_32","order":23,"path":"sprites/s_arrow_back_32/s_arrow_back_32.yy",},
{"name":"s_arrow_wire_16","order":24,"path":"sprites/s_arrow_wire_16/s_arrow_wire_16.yy",},
{"name":"s_autotile_11x5","order":3,"path":"sprites/s_autotile_11x5/s_autotile_11x5.yy",},
{"name":"s_autotile_5x3","order":1,"path":"sprites/s_autotile_5x3/s_autotile_5x3.yy",},
{"name":"s_autotile_8x6","order":2,"path":"sprites/s_autotile_8x6/s_autotile_8x6.yy",},
{"name":"s_autoterrain_11x5","order":3,"path":"sprites/s_autoterrain_11x5/s_autoterrain_11x5.yy",},
{"name":"s_autoterrain_5x3","order":1,"path":"sprites/s_autoterrain_5x3/s_autoterrain_5x3.yy",},
{"name":"s_autoterrain_5x5","order":4,"path":"sprites/s_autoterrain_5x5/s_autoterrain_5x5.yy",},
{"name":"s_autoterrain_8x6","order":2,"path":"sprites/s_autoterrain_8x6/s_autoterrain_8x6.yy",},
{"name":"s_biterator_b_grey_long","order":7,"path":"sprites/s_biterator_b_grey_long/s_biterator_b_grey_long.yy",},
{"name":"s_biterator_b_grey_short","order":8,"path":"sprites/s_biterator_b_grey_short/s_biterator_b_grey_short.yy",},
{"name":"s_biterator_b_labels","order":9,"path":"sprites/s_biterator_b_labels/s_biterator_b_labels.yy",},
@ -2576,6 +2580,7 @@
{"name":"s_node_threshold","order":54,"path":"sprites/s_node_threshold/s_node_threshold.yy",},
{"name":"s_node_tile_random","order":22,"path":"sprites/s_node_tile_random/s_node_tile_random.yy",},
{"name":"s_node_tileset_drawer","order":41,"path":"sprites/s_node_tileset_drawer/s_node_tileset_drawer.yy",},
{"name":"s_node_tileset_export","order":42,"path":"sprites/s_node_tileset_export/s_node_tileset_export.yy",},
{"name":"s_node_tileset","order":40,"path":"sprites/s_node_tileset/s_node_tileset.yy",},
{"name":"s_node_time_map","order":55,"path":"sprites/s_node_time_map/s_node_time_map.yy",},
{"name":"s_node_timeline_preview","order":2,"path":"sprites/s_node_timeline_preview/s_node_timeline_preview.yy",},

View file

@ -357,7 +357,6 @@
"IncludedFiles":[
{"$GMIncludedFile":"","%Name":"Actions.zip","CopyToMask":-1,"filePath":"datafiles/data","name":"Actions.zip","resourceType":"GMIncludedFile","resourceVersion":"2.0",},
{"$GMIncludedFile":"","%Name":"icons.afdesign","CopyToMask":-1,"filePath":"datafiles/data/Actions","name":"icons.afdesign","resourceType":"GMIncludedFile","resourceVersion":"2.0",},
{"$GMIncludedFile":"","%Name":"icons.afdesign~lock~","CopyToMask":-1,"filePath":"datafiles/data/Actions","name":"icons.afdesign~lock~","resourceType":"GMIncludedFile","resourceVersion":"2.0",},
{"$GMIncludedFile":"","%Name":"Armature Build.json","CopyToMask":-1,"filePath":"datafiles/data/Actions/Nodes","name":"Armature Build.json","resourceType":"GMIncludedFile","resourceVersion":"2.0",},
{"$GMIncludedFile":"","%Name":"Armature Build.png","CopyToMask":-1,"filePath":"datafiles/data/Actions/Nodes","name":"Armature Build.png","resourceType":"GMIncludedFile","resourceVersion":"2.0",},
{"$GMIncludedFile":"","%Name":"Follow Path.json","CopyToMask":-1,"filePath":"datafiles/data/Actions/Nodes","name":"Follow Path.json","resourceType":"GMIncludedFile","resourceVersion":"2.0",},
@ -1779,6 +1778,7 @@
{"id":{"name":"node_threshold","path":"scripts/node_threshold/node_threshold.yy",},},
{"id":{"name":"node_tile_random","path":"scripts/node_tile_random/node_tile_random.yy",},},
{"id":{"name":"node_tile","path":"scripts/node_tile/node_tile.yy",},},
{"id":{"name":"node_tiler_export","path":"scripts/node_tiler_export/node_tiler_export.yy",},},
{"id":{"name":"node_tiler_tileset","path":"scripts/node_tiler_tileset/node_tiler_tileset.yy",},},
{"id":{"name":"node_tiler","path":"scripts/node_tiler/node_tiler.yy",},},
{"id":{"name":"node_time_remap","path":"scripts/node_time_remap/node_time_remap.yy",},},
@ -2473,6 +2473,8 @@
{"id":{"name":"sh_texture_repeat","path":"shaders/sh_texture_repeat/sh_texture_repeat.yy",},},
{"id":{"name":"sh_threshold","path":"shaders/sh_threshold/sh_threshold.yy",},},
{"id":{"name":"sh_tile_random","path":"shaders/sh_tile_random/sh_tile_random.yy",},},
{"id":{"name":"sh_tile_rule_apply","path":"shaders/sh_tile_rule_apply/sh_tile_rule_apply.yy",},},
{"id":{"name":"sh_tile_rule_select","path":"shaders/sh_tile_rule_select/sh_tile_rule_select.yy",},},
{"id":{"name":"sh_tiler_autoterrain_apply","path":"shaders/sh_tiler_autoterrain_apply/sh_tiler_autoterrain_apply.yy",},},
{"id":{"name":"sh_tiler_autoterrain_mask","path":"shaders/sh_tiler_autoterrain_mask/sh_tiler_autoterrain_mask.yy",},},
{"id":{"name":"sh_time_remap","path":"shaders/sh_time_remap/sh_time_remap.yy",},},
@ -2539,10 +2541,11 @@
{"id":{"name":"s_arrow_16","path":"sprites/s_arrow_16/s_arrow_16.yy",},},
{"id":{"name":"s_arrow_back_32","path":"sprites/s_arrow_back_32/s_arrow_back_32.yy",},},
{"id":{"name":"s_arrow_wire_16","path":"sprites/s_arrow_wire_16/s_arrow_wire_16.yy",},},
{"id":{"name":"s_autotile_11x5","path":"sprites/s_autotile_11x5/s_autotile_11x5.yy",},},
{"id":{"name":"s_autotile_3x3","path":"sprites/s_autotile_3x3/s_autotile_3x3.yy",},},
{"id":{"name":"s_autotile_5x3","path":"sprites/s_autotile_5x3/s_autotile_5x3.yy",},},
{"id":{"name":"s_autotile_8x6","path":"sprites/s_autotile_8x6/s_autotile_8x6.yy",},},
{"id":{"name":"s_autoterrain_11x5","path":"sprites/s_autoterrain_11x5/s_autoterrain_11x5.yy",},},
{"id":{"name":"s_autoterrain_3x3","path":"sprites/s_autoterrain_3x3/s_autoterrain_3x3.yy",},},
{"id":{"name":"s_autoterrain_5x3","path":"sprites/s_autoterrain_5x3/s_autoterrain_5x3.yy",},},
{"id":{"name":"s_autoterrain_5x5","path":"sprites/s_autoterrain_5x5/s_autoterrain_5x5.yy",},},
{"id":{"name":"s_autoterrain_8x6","path":"sprites/s_autoterrain_8x6/s_autoterrain_8x6.yy",},},
{"id":{"name":"s_biterator_b_grey_long","path":"sprites/s_biterator_b_grey_long/s_biterator_b_grey_long.yy",},},
{"id":{"name":"s_biterator_b_grey_short","path":"sprites/s_biterator_b_grey_short/s_biterator_b_grey_short.yy",},},
{"id":{"name":"s_biterator_b_labels","path":"sprites/s_biterator_b_labels/s_biterator_b_labels.yy",},},
@ -3328,6 +3331,7 @@
{"id":{"name":"s_node_threshold","path":"sprites/s_node_threshold/s_node_threshold.yy",},},
{"id":{"name":"s_node_tile_random","path":"sprites/s_node_tile_random/s_node_tile_random.yy",},},
{"id":{"name":"s_node_tileset_drawer","path":"sprites/s_node_tileset_drawer/s_node_tileset_drawer.yy",},},
{"id":{"name":"s_node_tileset_export","path":"sprites/s_node_tileset_export/s_node_tileset_export.yy",},},
{"id":{"name":"s_node_tileset","path":"sprites/s_node_tileset/s_node_tileset.yy",},},
{"id":{"name":"s_node_time_map","path":"sprites/s_node_time_map/s_node_time_map.yy",},},
{"id":{"name":"s_node_timeline_preview","path":"sprites/s_node_timeline_preview/s_node_timeline_preview.yy",},},

View file

@ -1,11 +1,12 @@
enum AUTOTERRAIN_TYPE {
box9,
box25,
side15,
top48,
top55,
}
global.autoterrain_amount = [ 9, 15, 48, 55, ];
global.autoterrain_amount = [ 9, 16, 15, 48, 55, ];
function tiler_brush_autoterrain(_type, _index) constructor {
name = "autoterrain";
@ -22,17 +23,20 @@ function tiler_brush_autoterrain(_type, _index) constructor {
open = false;
sc_type = new scrollBox(["Simple box (3x3)", "Side platform (5x3)", "Godot tile (12x4)", "Gamemaker tileset (11x5)"], function(ind) /*=>*/ { setType(ind); });
sc_type = new scrollBox(["Simple box (3x3)", "Corner box (5x5)", "Side platform (5x3)", "Godot tile (12x4)", "Gamemaker tileset (11x5)"], function(ind) /*=>*/ { setType(ind); });
sc_type.font = f_p3;
static indexMap48 = [ 8, 10, 11, 0, 1, 6, 5, 3, 2, 34, 12, 20, 33, 35, 12, 28, 30, 29, 31, 46, 21, 12, 44, 45, 47, 24, 16, 18, 17, 19, 9, 43, 40, 37, 38, 39, 36, 25, 42, 41, 27, 26, 7, 4, 13, 23, 32, 15, 14, 12 ];
static setType = function(_type) {
type = _type;
switch(type) {
case 0 : index = array_verify_ext(index, 9, function() /*=>*/ {return -1}); break;
case 1 : index = array_verify_ext(index, 15, function() /*=>*/ {return -1}); break;
case 2 : index = array_verify_ext(index, 48, function() /*=>*/ {return -1}); break;
case 3 : index = array_verify_ext(index, 55, function() /*=>*/ {return -1}); break;
case 1 : index = array_verify_ext(index, 25, function() /*=>*/ {return -1}); break;
case 2 : index = array_verify_ext(index, 15, function() /*=>*/ {return -1}); break;
case 3 : index = array_verify_ext(index, 48, function() /*=>*/ {return -1}); break;
case 4 : index = array_verify_ext(index, 55, function() /*=>*/ {return -1}); break;
}
} setType(_type);
@ -79,6 +83,7 @@ function tiler_brush_autoterrain(_type, _index) constructor {
shader_set_surface("maskSurface", mask_surface);
shader_set_i("bitmaskType", type);
shader_set_i("indexMapper48", indexMap48);
shader_set_i("indexes", index);
shader_set_i("indexSize", array_length(index));

View file

@ -1,9 +1,99 @@
function tiler_rule_replacement(_index) constructor {
index = _index;
}
function tiler_rule() constructor {
name = "rule";
open = false;
active = true;
range = 1;
size = [ 1, 1 ];
probability = 100;
_probability = 1;
selection_rules = array_create(9, -1);
selection_rules[4] = -10000;
replacements = [];
sl_prop = new textBox(TEXTBOX_INPUT.number, function(v) /*=>*/ { probability = v; })
.setSlideRange(0, 100);
sl_prop.suffix = "%";
sl_prop.font = f_p3;
__aut = [];
__sel = [];
static shader_select = function(tileset) {
shader_set_i("range", range);
selection_rules = array_verify_ext(selection_rules, (size[0] + range * 2) * (size[1] + range * 2), function() /*=>*/ {return -1} );
__aut = [];
__sel = [];
var autI = [];
for( var i = 0, n = array_length(selection_rules); i < n; i++ ) {
var _r = selection_rules[i];
if(is_array(_r)) {
var _auI = _r[1];
array_push(__sel, 10000 + _auI);
array_push_unique(autI, _auI);
} else
array_push(__sel, _r);
}
for( var i = 0, n = array_length(autI); i < n; i++ ) {
var _i = autI[i];
var _t = tileset.autoterrain[_i];
var _ind = 64 * i;
__aut[_ind] = array_length(_t.index);
for( var j = 0, m = array_length(_t.index); j < m; j++ )
__aut[_ind + 1 + j] = _t.index[j];
}
shader_set_f("selection", __sel);
shader_set_f("selectionGroup", __aut);
}
static shader_submit = function(tileset) {
shader_set_i("range", range);
shader_set_f("probability", probability / 100);
shader_set_f("size", size);
shader_set_f("selection", __sel);
shader_set_f("selectionGroup", __aut);
var rep = [];
var rsz = size[0] * size[1];
for( var i = 0, n = array_length(replacements); i < n; i++ ) {
var _r = replacements[i];
_r.index = array_verify_ext(_r.index, rsz, function() /*=>*/ {return -1} );
array_append(rep, _r.index);
}
shader_set_f("replacements", rep);
shader_set_i("replacementCount", array_length(replacements));
}
static deserialize = function(_struct) {
name = struct_try_get(_struct, "name", name);
size = struct_try_get(_struct, "size", size);
range = struct_try_get(_struct, "range", range);
active = struct_try_get(_struct, "active", active);
selection_rules = struct_try_get(_struct, "selection_rules", selection_rules);
probability = struct_try_get(_struct, "probability", probability);
var _rep = struct_try_get(_struct, "replacements", noone);
if(_rep != noone) {
for( var i = 0, n = array_length(_rep); i < n; i++ )
replacements[i] = new tiler_rule_replacement(_rep[i].index);
}
return self;
}

View file

@ -1,7 +1,7 @@
function checkBox(_onClick) : widget() constructor {
onClick = _onClick;
spr = THEME.checkbox_def;
triggered = false;
spr = THEME.checkbox_def;
static setLua = function(_lua_thread, _lua_key, _lua_func) {
lua_thread = _lua_thread;

View file

@ -63,8 +63,8 @@ function draw_sprite_bbox_uniform(spr, ind, _bbox, _col = c_white, _alp = 1) {
__draw_sprite_stretched_ext(spr, ind, _bbox.xc - _minS / 2, _bbox.yc - _minS / 2, _minS, _minS, _col, _alp);
}
function draw_sprite_uniform(spr, ind, _x, _y, scale, color = c_white) {
INLINE draw_sprite_ext(spr, ind, _x, _y, scale, scale, 0, color, 1);
function draw_sprite_uniform(spr, ind, _x, _y, scale, color = c_white, alpha = 1) {
INLINE draw_sprite_ext(spr, ind, _x, _y, scale, scale, 0, color, alpha);
}
function draw_sprite_ui(spr, ind, _x, _y, xscale = 1, yscale = 1, rot = 0, color = c_white, alpha = 1) {

View file

@ -42,7 +42,7 @@
LATEST_VERSION = 1_18_00_0;
VERSION = 1_18_01_0;
SAVE_VERSION = 1_18_02_0;
VERSION_STRING = MAC? "1.18.003m" : "1.18.3.005";
VERSION_STRING = MAC? "1.18.003m" : "1.18.3.006";
BUILD_NUMBER = 1_18_01_0;
HOTKEYS = ds_map_create();

View file

@ -770,14 +770,16 @@ function Node_Canvas(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
else if(_currTool != noone) {
_tool = _currTool.getToolObject();
if(_tool) {
if(is(_tool, canvas_tool)) {
_tool.node = self;
_tool = _tool.getTool();
_tool.subtool = _currTool.selecting;
array_append(rightTools, _tool.rightTools);
use_color_3d = _tool.use_color_3d;
}
} else
_tool = noone;
}
tool_selection.drawing_surface = drawing_surface;

View file

@ -95,7 +95,7 @@ function Node_Line(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons
lines = [];
line_data = [];
temp_surfaces = [ noone ];
temp_surface = [ noone ];
widthMap = ds_map_create();
@ -541,8 +541,8 @@ function Node_Line(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons
var _padx = _pbbox * (_ppadd[2] - minx);
var _pady = _pbbox * (_ppadd[1] - miny);
temp_surfaces[0] = surface_verify(temp_surfaces[0], _surfDim[0] * _aa, _surfDim[1] * _aa, attrDepth());
var _cPassAA = temp_surfaces[0];
temp_surface[0] = surface_verify(temp_surface[0], _surfDim[0] * _aa, _surfDim[1] * _aa, attrDepth());
var _cPassAA = temp_surface[0];
surface_set_target(_cPassAA);
if(_bg) draw_clear_alpha(0, 1);

View file

@ -11,9 +11,13 @@ function Node_Normal(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) co
newInput(3, nodeValue_Bool("Active", self, true));
active_index = 3;
newInput(4, nodeValue_Bool("Normalize", self, true));
newInput(5, nodeValue_Bool("Flip X", self, true));
input_display_list = [ 3,
["Surfaces", false], 0,
["Normal", false], 1, 2,
["Normal", false], 1, 2, 5, 4,
]
newOutput(0, nodeValue_Output("Surface out", self, VALUE_TYPE.surface, noone));
@ -23,6 +27,8 @@ function Node_Normal(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) co
static processData = function(_outSurf, _data, _output_index, _array_index) {
var _hei = _data[1];
var _smt = _data[2];
var _nor = _data[4];
var _swx = _data[5];
surface_set_shader(_outSurf, sh_normal);
gpu_set_texfilter(true);
@ -30,6 +36,8 @@ function Node_Normal(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) co
shader_set_f("dimension", surface_get_dimension(_data[0]), surface_get_height_safe(_data[0]));
shader_set_f("height", _hei);
shader_set_f("smooth", _smt);
shader_set_i("normal", _nor);
shader_set_i("swapx", _swx);
draw_surface_safe(_data[0]);

View file

@ -16,7 +16,7 @@ function Node_Random_Shape(_x, _y, _group = noone) : Node_Processor(_x, _y, _gro
["Render", false], 2,
]
temp_surfaces = [ noone ];
temp_surface = [ noone ];
function surfaceContentRatio(_surf) {
var s = 0;
@ -139,8 +139,8 @@ function Node_Random_Shape(_x, _y, _group = noone) : Node_Processor(_x, _y, _gro
var _corn = surface_create(_dim[0], _dim[1]);
temp_surfaces[0] = surface_verify(temp_surfaces[0], _adim[0], _adim[1]);
var _cPassAA = temp_surfaces[0];
temp_surface[0] = surface_verify(temp_surface[0], _adim[0], _adim[1]);
var _cPassAA = temp_surface[0];
surface_set_shader(_cPassAA, sh_rsh_corner, true, BLEND.add);
shader_set_f("dimension", _adim[0], _adim[1]);

View file

@ -528,8 +528,9 @@ function __initNodes() {
addNodeObject(input, "Canvas", s_node_canvas, "Node_Canvas", [1, Node_Canvas], ["draw"], "Draw on surface using brush, eraser, etc.");
addNodeObject(input, "Canvas Group", s_node_canvas_group, "Node_Canvas_Group", [1, Node_Canvas_Group],, "Create a group that combines multiple canvas nodes a layers.").setVersion(11740);
addNodeObject(input, "Active Canvas", s_node_active_canvas, "Node_Active_Canvas", [1, Node_Active_Canvas], ["draw"], "Draw using parameterized brush.").setVersion(11570);
addNodeObject(input, "Tileset", s_node_tileset, "Node_Tile_Tileset", [1, Node_Tile_Tileset],, "Create tileset object.").setVersion(1_18_02_0);
addNodeObject(input, "Tile Drawer", s_node_tileset_drawer, "Node_Tile_Drawer", [1, Node_Tile_Drawer],, "Draw using tileset.").setVersion(1_18_02_0);
addNodeObject(input, "Tileset", s_node_tileset, "Node_Tile_Tileset", [1, Node_Tile_Tileset],, "Create tileset object.").setVersion(1_18_03_0);
addNodeObject(input, "Tile Drawer", s_node_tileset_drawer, "Node_Tile_Drawer", [1, Node_Tile_Drawer],, "Draw using tileset.").setVersion(1_18_03_0);
addNodeObject(input, "Export Tilemap", s_node_tileset_export, "Node_Tile_Tilemap_Export", [1, Node_Tile_Tilemap_Export],, "Export tilemap to file.").setVersion(1_18_03_0);
ds_list_add(input, "Files");
addNodeObject(input, "Text File In", s_node_text_file_read, "Node_Text_File_Read", [1, Node_Text_File_Read], ["txt"], "Load .txt in as text.").setVersion(1080);

View file

@ -595,6 +595,7 @@ function Node_Shape(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con
break;
case "Gear":
inputs[ 9].setVisible(true);
inputs[13].setVisible(true);
inputs[25].setVisible(true);
inputs[26].setVisible(true);

View file

@ -90,7 +90,7 @@ function Node_Shape_Polygon(_x, _y, _group = noone) : Node_Processor(_x, _y, _gr
node_draw_transform_init();
temp_surfaces = [ noone ];
temp_surface = [ noone ];
static drawOverlay = function(hover, active, _x, _y, _s, _mx, _my, _snx, _sny) {
if(array_length(current_data) != array_length(inputs)) return;
@ -197,8 +197,8 @@ function Node_Shape_Polygon(_x, _y, _group = noone) : Node_Processor(_x, _y, _gr
var _outSurf = surface_verify(_outData[0], _dim[0], _dim[1], attrDepth());
temp_surfaces[0] = surface_verify(temp_surfaces[0], _dim[0] * _aa, _dim[1] * _aa, attrDepth());
var _cPassAA = temp_surfaces[0];
temp_surface[0] = surface_verify(temp_surface[0], _dim[0] * _aa, _dim[1] * _aa, attrDepth());
var _cPassAA = temp_surface[0];
var data = {
side: _side,

View file

@ -11,19 +11,21 @@ function Node_Tile_Drawer(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou
newInput( 2, nodeValue_Bool("Animated", self, false));
input_display_list = [ 1, 0 ];
newInput( 3, nodeValueSeed(self, VALUE_TYPE.float));
input_display_list = [ 3, 1, 0 ];
input_display_list_tileset = ["Tileset", false, noone, noone];
input_display_list_autoterrains = ["Autoterrain", true, noone, noone];
input_display_list_autoterrains = ["Autoterrains", true, noone, noone];
input_display_list_palette = ["Palette", true, noone, noone];
input_display_list_animated = ["Animated", true, 2, noone];
input_display_list_rule = ["Rule", true, noone, noone];
input_display_list_animated = ["Animated tiles",true, 2, noone];
input_display_list_rule = ["Rules", true, noone, noone];
newOutput(0, nodeValue_Output("Tile output", self, VALUE_TYPE.surface, noone));
newOutput(1, nodeValue_Output("Tile map", self, VALUE_TYPE.surface, noone));
newOutput(2, nodeValue_Output("Index array", self, VALUE_TYPE.integer, []))
.setArrayDepth(1);
// newOutput(2, nodeValue_Output("Index array", self, VALUE_TYPE.integer, []))
// .setArrayDepth(1);
output_display_list = [ 0, 1 ];
@ -41,9 +43,7 @@ function Node_Tile_Drawer(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou
_preview_draw_mask = surface_create_empty(1, 1);
preview_draw_mask = surface_create_empty(1, 1);
attributes.dimension = [ 1, 1 ];
temp_surface = [ 0 ];
temp_surface = [ 0, 0, 0 ];
selection_mask = noone;
#endregion
@ -143,18 +143,17 @@ function Node_Tile_Drawer(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou
}
#region surfaces
var _dim = attributes.dimension;
var _outDim = [ _tileSiz[0] * _dim[0], _tileSiz[1] * _dim[1] ];
var _outDim = [ _tileSiz[0] * _mapSize[0], _tileSiz[1] * _mapSize[1] ];
preview_draw_overlay = surface_verify(preview_draw_overlay, _dim[0], _dim[1], surface_rgba16float);
preview_drawing_tile = surface_verify(preview_drawing_tile, _dim[0] * _tileSiz[0], _dim[1] * _tileSiz[1]);
preview_draw_overlay_tile = surface_verify(preview_draw_overlay_tile, _dim[0] * _tileSiz[0], _dim[1] * _tileSiz[1]);
preview_draw_overlay = surface_verify(preview_draw_overlay, _mapSize[0], _mapSize[1], surface_rgba16float);
preview_drawing_tile = surface_verify(preview_drawing_tile, _mapSize[0] * _tileSiz[0], _mapSize[1] * _tileSiz[1]);
preview_draw_overlay_tile = surface_verify(preview_draw_overlay_tile, _mapSize[0] * _tileSiz[0], _mapSize[1] * _tileSiz[1]);
var __s = surface_get_target();
var _sw = surface_get_width(__s);
var _sh = surface_get_height(__s);
_preview_draw_mask = surface_verify(_preview_draw_mask, _dim[0], _dim[1]);
_preview_draw_mask = surface_verify(_preview_draw_mask, _mapSize[0], _mapSize[1]);
preview_draw_mask = surface_verify( preview_draw_mask, _sw, _sh);
#endregion
@ -163,12 +162,15 @@ function Node_Tile_Drawer(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou
var _currTool = PANEL_PREVIEW.tool_current;
var _tool = _currTool == noone? noone : _currTool.getToolObject();
if(!is(_tool, tiler_tool))
_tool = noone;
if(_tool) {
var brush = tileset.brush;
brush.node = self;
brush.brush_size = tool_attribute.size;
brush.autoterrain = array_safe_get(tileset.autoterrains, tileset.autoterrain_selecting, noone);
brush.autoterrain = is(tileset.object_selecting, tiler_brush_autoterrain)? tileset.object_selecting : noone;
_tool.brush = brush;
_tool.subtool = _currTool.selecting;
@ -206,18 +208,18 @@ function Node_Tile_Drawer(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou
#region draw preview surfaces
surface_set_shader(preview_drawing_tile, sh_draw_tile_map, true, BLEND.over);
shader_set_2("dimension", _outDim);
// surface_set_shader(preview_drawing_tile, sh_draw_tile_map, true, BLEND.over);
// shader_set_2("dimension", _outDim);
shader_set_surface("indexTexture", drawing_surface);
shader_set_2("indexTextureDim", surface_get_dimension(drawing_surface));
// shader_set_surface("indexTexture", drawing_surface);
// shader_set_2("indexTextureDim", surface_get_dimension(drawing_surface));
tileset.shader_submit();
// tileset.shader_submit();
draw_empty();
surface_reset_shader();
// draw_empty();
// surface_reset_shader();
draw_surface_ext(preview_drawing_tile, _x, _y, _s, _s, 0, c_white, 1);
// draw_surface_ext(preview_drawing_tile, _x, _y, _s, _s, 0, c_white, 1);
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@ -245,9 +247,9 @@ function Node_Tile_Drawer(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou
#endregion
//if(!array_empty(autoterrains)) draw_surface_ext(autoterrains[0].mask_surface, 32, 32, 8, 8, 0, c_white, 1);
// draw_surface_ext(canvas_surface, 32, 32, 8, 8, 0, c_white, 1);
// draw_surface_ext(drawing_surface, 232, 32, 8, 8, 0, c_white, 1);
// if(!array_empty(autoterrains)) draw_surface_ext(autoterrains[0].mask_surface, 32, 32, 8, 8, 0, c_white, 1);
// if(surface_exists(canvas_surface)) draw_surface_ext(canvas_surface, 32, 32, 8, 8, 0, c_white, 1);
// if(surface_exists(drawing_surface)) draw_surface_ext(drawing_surface, 232, 32, 8, 8, 0, c_white, 1);
// draw_surface_ext(preview_draw_overlay, 432, 32, 8, 8, 0, c_white, 1);
}
@ -255,7 +257,7 @@ function Node_Tile_Drawer(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou
tileset = _data[0];
if(tileset == noone) {
input_display_list = [ 1, 0 ];
input_display_list = [ 3, 1, 0 ];
return _outData;
}
@ -265,7 +267,7 @@ function Node_Tile_Drawer(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou
input_display_list_animated[3] = tileset.animated_viewer_toggler;
input_display_list_rule[3] = tileset.rules_viewer_toggler;
input_display_list = [ 1, 0,
input_display_list = [ 3, 1, 0,
input_display_list_tileset, tileset.tile_selector,
input_display_list_autoterrains, tileset.autoterrain_selector,
input_display_list_palette, tileset.palette_viewer,
@ -277,17 +279,18 @@ function Node_Tile_Drawer(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou
var _tileSiz = tileset.tileSize;
var _mapSize = _data[1];
var _animated = _data[2];
var _seed = _data[3];
update_on_frame = _animated;
attributes.dimension[0] = _mapSize[0];
attributes.dimension[1] = _mapSize[1];
if(!is_surface(canvas_surface) && buffer_exists(canvas_buffer)) {
canvas_surface = surface_create(_mapSize[0], _mapSize[1], surface_rgba16float);
buffer_set_surface(canvas_buffer, canvas_surface, 0);
} else
canvas_surface = surface_verify(canvas_surface, _mapSize[0], _mapSize[1], surface_rgba16float);
drawing_surface = surface_verify(drawing_surface, _mapSize[0], _mapSize[1], surface_rgba16float);
temp_surface[0] = surface_verify(temp_surface[0], _mapSize[0], _mapSize[1], surface_rgba16float);
temp_surface[1] = surface_verify(temp_surface[1], _mapSize[0], _mapSize[1], surface_rgba16float);
temp_surface[2] = surface_verify(temp_surface[2], _mapSize[0], _mapSize[1], surface_r16float);
surface_set_shader(drawing_surface, noone, true, BLEND.over);
draw_surface(canvas_surface, 0, 0);
@ -299,15 +302,49 @@ function Node_Tile_Drawer(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou
var _tileOut = surface_verify(_outData[0], _outDim[0], _outDim[1]);
var _tileMap = surface_verify(_outData[1], _mapSize[0], _mapSize[1], surface_rgba16float);
var _arrIndx = array_verify( _outData[2], _mapSize[0] * _mapSize[1]);
// var _arrIndx = array_verify( _outData[2], _mapSize[0] * _mapSize[1]);
canvas_buffer = buffer_verify(canvas_buffer, _mapSize[0] * _mapSize[1] * 8);
buffer_get_surface(canvas_buffer, canvas_surface, 0);
surface_set_shader(_tileMap, sh_sample, true, BLEND.over);
#region rules
surface_set_shader(temp_surface[1], sh_sample, true, BLEND.over);
draw_surface(canvas_surface, 0, 0);
surface_reset_shader();
var bg = 0;
for( var i = 0, n = array_length(tileset.ruleTiles); i < n; i++ ) {
var _rule = tileset.ruleTiles[i];
if(!_rule.active) continue;
if(array_empty(_rule.replacements)) continue;
surface_set_shader(temp_surface[2], sh_tile_rule_select, true, BLEND.over);
shader_set_2("dimension", _mapSize);
_rule.shader_select(tileset);
draw_surface(canvas_surface, 0, 0);
surface_reset_shader();
surface_set_shader(temp_surface[bg], sh_tile_rule_apply, true, BLEND.over);
shader_set_2("dimension", _mapSize);
shader_set_f("seed", _seed);
shader_set_surface("group", temp_surface[2]);
_rule.shader_submit(tileset);
draw_surface(temp_surface[!bg], 0, 0);
surface_reset_shader();
bg = !bg;
}
#endregion
surface_set_shader(_tileMap, sh_sample, true, BLEND.over);
draw_surface(temp_surface[!bg], 0, 0);
surface_reset_shader();
var _tileSetDim = surface_get_dimension(_tileSet);
surface_set_shader(_tileOut, sh_draw_tile_map, true, BLEND.over);
@ -322,11 +359,15 @@ function Node_Tile_Drawer(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou
draw_empty();
surface_reset_shader();
return [ _tileOut, _tileMap, _arrIndx ];
return [ _tileOut, _tileMap ];
}
static getPreviewValues = function() { return preview_drawing_tile; }
static getGraphPreviewSurface = function() { return getSingleValue(0, preview_index, true); }
// static getPreviewValues = function() {
// return getSingleValue(0, preview_index, true);
// return preview_drawing_tile;
// }
// static getGraphPreviewSurface = function() { return getSingleValue(0, preview_index, true); }
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

View file

@ -0,0 +1,83 @@
function Node_Tile_Tilemap_Export(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
name = "Export Tilemap";
newInput( 0, nodeValue_Surface("Tilemap", self, noone));
newInput( 1, nodeValue_Path("Path", self, ""))
.setDisplay(VALUE_DISPLAY.path_save, { filter: "" })
.setVisible(true);
export_format = [ "CSV", "JSON" ];
newInput( 2, nodeValue_Enum_Scroll("Format", self, 0, export_format));
insp1UpdateTooltip = "Export";
insp1UpdateIcon = [ THEME.sequence_control, 1, COLORS._main_value_positive ];
static onInspector1Update = function(_fromValue = false) {
export();
}
static export = function() {
var tilemap = inputs[0].getValue();
var path = inputs[1].getValue();
var format = inputs[2].getValue();
if(!is_surface(tilemap)) return;
var _form = surface_get_format(tilemap);
if(_form != surface_rgba16float) {
noti_warning("Invalid tilemap type (RGBA16float only)")
return;
}
var _dim = surface_get_dimension(tilemap);
var _buff = buffer_from_surface(tilemap, false); buffer_to_start(_buff);
var _data = array_create(_dim[1]);
for( var i = 0; i < _dim[1]; i++ ) {
_data[i] = array_create(_dim[0]);
for( var j = 0; j < _dim[0]; j++ ) {
var _a = array_create(4);
_a[0] = buffer_read(_buff, buffer_f16);
_a[1] = buffer_read(_buff, buffer_f16);
_a[2] = buffer_read(_buff, buffer_f16);
_a[3] = buffer_read(_buff, buffer_f16);
_data[i][j] = _a[0];
}
}
buffer_delete(_buff);
switch(export_format[format]) {
case "CSV" :
path = filename_change_ext(path, ".csv");
if(file_exists_empty(path)) file_delete(path);
var f = file_text_open_write(path);
if(f) {
for( var i = 0; i < _dim[1]; i++ ) {
var _txt = string_join_ext(",", _data[i]);
file_text_write_string(f, _txt);
file_text_writeln(f);
}
file_text_close(f);
var _txt = $"Export tilemap complete.";
logNode(_txt);
var noti = log_message("EXPORT", _txt, THEME.noti_icon_tick, COLORS._main_value_positive, false);
noti.path = filename_dir(path);
noti.setOnClick(function() /*=>*/ { shellOpenExplorer(self.path); }, "Open in explorer", THEME.explorer);
} else {
}
break;
}
}
}

View file

@ -0,0 +1,13 @@
{
"$GMScript":"v1",
"%Name":"node_tiler_export",
"isCompatibility":false,
"isDnD":false,
"name":"node_tiler_export",
"parent":{
"name":"tiler",
"path":"folders/nodes/data/tiler.yy",
},
"resourceType":"GMScript",
"resourceVersion":"2.0",
}

View file

@ -19,6 +19,29 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
newOutput(0, nodeValue_Output("Tileset", self, VALUE_TYPE.tileset, self));
static drawTile = function(_tileSet, _tileAmo, _tileSiz, index, _x, _y, _w, _h) {
if(index < -1) { // animated
var _an = -index - 2;
var _at = array_safe_get(animatedTiles, _an, noone);
if(_at == noone) return;
var _prin = array_safe_get(_at.index, safe_mod(current_time / 1000 * 2, array_length(_at.index)), undefined);
if(_prin != undefined) drawTile(_tileSet, _tileAmo, _tileSiz, _prin, _x, _y, _w, _h);
return;
}
var _prc = safe_mod(index, _tileAmo[0]);
var _prr = floor(index / _tileAmo[0]);
var _pr_tx = _prc * _tileSiz[0];
var _pr_ty = _prr * _tileSiz[1];
var _pr_sx = _w / _tileSiz[0];
var _pr_sy = _h / _tileSiz[1];
draw_surface_part_ext(_tileSet, _pr_tx, _pr_ty, _tileSiz[0], _tileSiz[1], _x, _y, _pr_sx, _pr_sy, c_white, 1);
}
#region ++++ tile selector ++++
tile_selector_surface = 0;
tile_selector_mask = 0;
@ -38,6 +61,9 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
tile_selecting = false;
tile_select_ss = [ 0, 0 ];
object_selecting = noone;
object_select_id = noone;
selecting_surface = noone;
selecting_surface_tile = noone;
@ -157,19 +183,34 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
draw_set_color(c_black);
draw_rectangle_width(_tileHov_x, _tileHov_y, _tileHov_x + _tileSel_w - 1, _tileHov_y + _tileSel_h - 1, 1);
if(mouse_press(mb_left, _focus)) {
if(autoterrain_subtile_selecting == noone) {
autoterrain_selecting = noone;
animated_selecting = noone;
if(is(object_selecting, tiler_brush_autoterrain)) TOOLTIP = "Set Autoterrain";
else if(is(object_selecting, tiler_brush_animated)) TOOLTIP = "Set Animated tile";
else if(is(object_selecting, tiler_rule)) TOOLTIP = "Set Rule selector";
else if(is(object_selecting, tiler_rule_replacement)) TOOLTIP = "Set Rule replacement";
if(mouse_press(mb_left, _focus)) {
if(object_selecting == noone) {
tile_selecting = true;
tile_select_ss = [ _mtx, _mty ];
} else if(is(object_selecting, tiler_brush_autoterrain) || is(object_selecting, tiler_brush_animated)) {
if(object_select_id != noone) {
object_selecting.index[object_select_id] = _mid;
object_select_id++;
if(object_select_id >= array_length(object_selecting.index))
object_select_id = noone;
}
} else if(is(object_selecting, tiler_rule)) {
if(object_select_id != noone)
object_selecting.selection_rules[object_select_id] = _mid;
object_selecting = noone;
triggerRender();
} else if(is(object_selecting, tiler_rule_replacement)) {
tile_selecting = true;
tile_select_ss = [ _mtx, _mty ];
} else {
autoterrain[autoterrain_selecting].index[autoterrain_subtile_selecting] = _mid;
autoterrain_subtile_selecting++;
if(autoterrain_subtile_selecting >= array_length(autoterrain[autoterrain_selecting].index))
autoterrain_subtile_selecting = noone;
}
palette_using = false;
@ -207,15 +248,29 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
brush.brush_indices = [];
brush.brush_width = _ts_ex - _ts_sx + 1;
brush.brush_height = _ts_ey - _ts_sy + 1;
var _ind = 0;
for( var i = _ts_sy; i <= _ts_ey; i++ )
for( var j = _ts_sx; j <= _ts_ex; j++ )
brush.brush_indices[i - _ts_sy][j - _ts_sx] = [ i * _tileAmo[0] + j, 0 ];
if(mouse_release(mb_left))
if(mouse_release(mb_left)) {
if(is(object_selecting, tiler_rule_replacement)) {
object_select_id.size[0] = max(object_select_id.size[0], brush.brush_width);
object_select_id.size[1] = max(object_select_id.size[1], brush.brush_height);
var _ind = 0;
for( var i = _ts_sy; i <= _ts_ey; i++ )
for( var j = _ts_sx; j <= _ts_ex; j++ )
object_selecting.index[_ind++] = i * _tileAmo[0] + j;
object_selecting = noone;
object_select_id = noone;
triggerRender();
}
tile_selecting = false;
}
}
#region pan zoom
if(tile_dragging) {
@ -277,15 +332,13 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
draw_surface_ext(tile_selector_mask, _sx, _sy, 1, 1, 0, _cc, 1);
shader_reset();
if(autoterrain_selecting != noone) { // autoterrain
var _att = autoterrain[autoterrain_selecting];
if(is(object_selecting, tiler_brush_autoterrain)) { // autoterrain
surface_set_target(autoterrain_selector_mask);
DRAW_CLEAR
draw_set_color(c_white);
for( var j = 0, m = array_length(_att.index); j < m; j++ ) {
var _bindex = _att.index[j];
for( var j = 0, m = array_length(object_selecting.index); j < m; j++ ) {
var _bindex = object_selecting.index[j];
var _tileSel_row = floor(_bindex / _tileAmo[0]);
var _tileSel_col = safe_mod(_bindex, _tileAmo[0]);
var _tileSel_x = tile_selector_x + _tileSel_col * _tileSiz[0] * tile_selector_s;
@ -313,13 +366,40 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
var _th = ui(48);
_h += ui(8) + _th;
var _sx = _x + ui(8);
var _sy = _ty + ui(8);
var _ss = (_th - ui(16)) / _sel_sh;
var _sw = _ss * _sel_sw;
var _sh = _ss * _sel_sh;
draw_sprite_stretched_ext(THEME.ui_panel_bg, 1, _x, _ty, _w, _th, COLORS.node_composite_bg_blend, 1);
var _shov = _hover && point_in_rectangle(_m[0], _m[1], _sx, _sy, _sx + _sw, _sy + _sh);
var _aa = 0.5 + 0.5 * _shov;
draw_sprite_stretched_ext(THEME.ui_panel, 1, _sx, _sy, _sw, _sh, COLORS._main_icon, _aa);
draw_sprite_uniform(THEME.cross, 0, _sx + _sw / 2, _sy + _sh / 2, 1, COLORS._main_icon, _aa);
if(_shov) {
if(is(object_selecting, tiler_rule)) {
TOOLTIP = "Set Rule selector";
if(mouse_press(mb_left, _focus)) {
if(object_select_id != noone)
object_selecting.selection_rules[object_select_id] = -10000;
object_selecting = noone;
triggerRender();
}
}
}
_sx += _sw + ui(8);
if(brush.brush_width * brush.brush_height != 1)
return _h;
var _bb = brush.brush_indices[0][0];
var _sx = _x + ui(8);
var _variences = [ 0, 1, 2, 3, 8, 16 ];
for( var v = 0, p = array_length(_variences); v < p; v++ ) {
@ -344,20 +424,13 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
draw_empty();
surface_reset_shader();
var _sy = _ty + ui(8);
var _ss = (_th - ui(16)) / _sel_sh;
var _sw = _ss * _sel_sw;
var _sh = _ss * _sel_sh;
var _shov = _hover && point_in_rectangle(_m[0], _m[1], _sx, _sy, _sx + _sw, _sy + _sh);
var _aa = _bb[1] == _var? 1 : 0.5 + 0.5 * _shov;
draw_surface_ext(selecting_surface_tile, _sx, _sy, _ss, _ss, 0, c_white, _aa);
if(_bb[1] == _var) {
draw_set_color(COLORS._main_accent);
draw_rectangle(_sx, _sy, _sx + _sw, _sy + _sh, true);
}
if(_bb[1] == _var)
draw_sprite_stretched_ext(THEME.ui_panel, 1, _sx, _sy, _sw, _sh, COLORS._main_accent);
if(_shov && mouse_press(mb_left, _focus))
_bb[1] = _var;
@ -372,12 +445,8 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
#region ++++ auto terrain ++++
autoterrain = [];
autoterrain_selecting = noone;
autoterrain_selector_h = 0;
autoterrain_subtile_selecting = noone;
autoterrain_selector = new Inspector_Custom_Renderer(function(_x, _y, _w, _m, _hover, _focus, _panel = noone) {
var _yy = _y;
var _h = 0;
@ -393,7 +462,7 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
var by = _yy;
var bs = ui(24);
var _brush_tiles = brush.brush_width * brush.brush_height;
var _fromSel = (_brush_tiles == 9 || _brush_tiles == 15 || _brush_tiles == 48 || _brush_tiles == 55);
var _fromSel = _brush_tiles == 9 || _brush_tiles == 15 || _brush_tiles == 25 ||_brush_tiles == 48 || _brush_tiles == 55;
if(buttonInstant(THEME.button_hide, bx, by, bs, bs, _m, _focus, _hover, _fromSel? "New autoterrain from selection" : "New autoterrain", THEME.add_16, 0, COLORS._main_value_positive) == 2) {
var _new_at = noone;
@ -404,13 +473,14 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
_indx[i * brush.brush_width + j] = brush.brush_indices[i][j][0];
if(_brush_tiles == 9) _new_at = new tiler_brush_autoterrain(AUTOTERRAIN_TYPE.box9, _indx);
else if(_brush_tiles == 25) _new_at = new tiler_brush_autoterrain(AUTOTERRAIN_TYPE.box25, _indx);
else if(_brush_tiles == 15) _new_at = new tiler_brush_autoterrain(AUTOTERRAIN_TYPE.side15, _indx);
else if(_brush_tiles == 48) _new_at = new tiler_brush_autoterrain(AUTOTERRAIN_TYPE.top48, _indx);
else if(_brush_tiles == 55) _new_at = new tiler_brush_autoterrain(AUTOTERRAIN_TYPE.top55, _indx);
else _new_at = new tiler_brush_autoterrain(AUTOTERRAIN_TYPE.box9, _indx);
autoterrain_selecting = array_length(autoterrain);
animated_selecting = noone;
object_selecting = _new_at;
object_select_id = noone;
array_push(autoterrain, _new_at);
if(!array_empty(_indx)) {
@ -440,28 +510,16 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
var _px = _x + ui(8);
var _py = _yy + ui(4);
var _prin = array_safe_get(_at.index, 0, noone);
var _prin = array_safe_get(_at.index, 0, undefined);
if(_prin == noone) {
draw_set_color(COLORS._main_icon);
draw_rectangle(_px, _py, _px + _pw, _py + _ph, true);
} else {
var _prc = safe_mod(_prin, _tileAmo[0]);
var _prr = floor(_prin / _tileAmo[0]);
var _pr_tx = _prc * _tileSiz[0];
var _pr_ty = _prr * _tileSiz[1];
var _pr_sx = _pw / _tileSiz[0];
var _pr_sy = _ph / _tileSiz[1];
draw_surface_part_ext(_tileSet, _pr_tx, _pr_ty, _tileSiz[0], _tileSiz[1], _px, _py, _pr_sx, _pr_sy, c_white, 1);
}
if(_prin == undefined)
draw_sprite_stretched_ext(THEME.ui_panel, 1, _px, _py, _pw, _ph, COLORS._main_icon);
else
drawTile(_tileSet, _tileAmo, _tileSiz, _prin, _px, _py, _pw, _ph);
var _tx = _px + _pw + ui(8);
var _hov = _hover && point_in_rectangle(_m[0], _m[1], _x, _yy, _x + _w, _yy + _hg - 1);
var _cc = i == autoterrain_selecting? COLORS._main_accent : (_hov? COLORS._main_text : COLORS._main_text_sub);
var _cc = object_selecting == _at? COLORS._main_accent : (_hov? COLORS._main_text : COLORS._main_text_sub);
if(renaming == _at) {
tb_rename.setFocusHover(_focus, _hover);
@ -479,7 +537,17 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
}
if(_hov && _m[0] < _x + _w - ui(32)) {
if(_m[0] > _tx) {
if(is(object_selecting, tiler_rule)) {
TOOLTIP = "Set Rule selector";
if(mouse_press(mb_left, _focus)) {
if(object_select_id != noone)
object_selecting.selection_rules[object_select_id] = [ "terrain", i ];
object_selecting = noone;
triggerRender();
}
} else if(_m[0] > _tx) {
if(DOUBLE_CLICK && _focus) {
renaming = _at;
rename_text = _at.name;
@ -488,8 +556,8 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
tb_rename.activate();
} else if(mouse_press(mb_left, _focus)) {
autoterrain_selecting = autoterrain_selecting == i? noone : i;
animated_selecting = noone;
object_selecting = object_selecting == _at? noone : _at;
object_select_id = noone;
brush.brush_indices = [[ [ _prin, 0 ] ]];
brush.brush_width = 1;
@ -497,8 +565,7 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
palette_using = false;
}
} else {
draw_set_color(COLORS._main_accent);
draw_rectangle(_px, _py, _px + _pw, _py + _ph, true);
draw_sprite_stretched_ext(THEME.ui_panel, 1, _px, _py, _pw, _ph, COLORS._main_accent);
if(mouse_press(mb_left, _focus))
_at.open = !_at.open;
@ -531,6 +598,7 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
switch(_at.type) {
case AUTOTERRAIN_TYPE.box9 : _coll = 3; _roww = 3; _over = s_autoterrain_3x3; break;
case AUTOTERRAIN_TYPE.box25 : _coll = 5; _roww = 5; _over = s_autoterrain_5x5; break;
case AUTOTERRAIN_TYPE.side15 : _coll = 5; _roww = 3; _over = s_autoterrain_5x3; break;
case AUTOTERRAIN_TYPE.top48 : _coll = 12; _roww = 4; _over = s_autoterrain_8x6; break;
case AUTOTERRAIN_TYPE.top55 : _coll = 11; _roww = 5; _over = s_autoterrain_11x5; break;
@ -620,9 +688,8 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
draw_rectangle(_at_c_sx, _at_c_sy, _at_c_sx + _dtile_w, _at_c_sy + _dtile_h, true);
if(mouse_press(mb_left, _focus)) {
autoterrain_selecting = i;
animated_selecting = noone;
autoterrain_subtile_selecting = autoterrain_subtile_selecting == _at_id? noone : _at_id;
object_selecting = _at;
object_select_id = object_select_id == _at_id? noone : _at_id;
}
if(mouse_press(mb_right, _focus))
@ -630,9 +697,9 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
}
}
if(autoterrain_selecting == i && autoterrain_subtile_selecting != noone) {
var _at_sl_x = autoterrain_subtile_selecting % _coll;
var _at_sl_y = floor(autoterrain_subtile_selecting / _coll);
if(object_selecting == _at && object_select_id != noone) {
var _at_sl_x = object_select_id % _coll;
var _at_sl_y = floor(object_select_id / _coll);
var _at_c_sx = _pre_sx + _at_sl_x * _dtile_w;
var _at_c_sy = _pre_sy + _at_sl_y * _dtile_h;
@ -649,7 +716,8 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
if(del != -1) {
array_delete(autoterrain, del, 1);
autoterrain_selecting = noone;
object_selecting = noone;
object_select_id = noone;
}
autoterrain_selector_h = max(ui(12), _ah);
@ -837,8 +905,9 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
}
if(palette_tool == 0 && mouse_press(mb_left, _focus)) {
autoterrain_selecting = noone;
animated_selecting = noone;
object_selecting = noone;
object_select_id = noone;
palette_selecting = true;
palette_using = true;
palette_select_ss = [ _mtx, _mty ];
@ -1060,10 +1129,7 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
#region ++++ animated tiles ++++
animatedTiles = [];
animated_selecting = noone;
animated_selector_h = 0;
animated_subtile_selecting = noone;
aTiles = [];
aTilesIndex = [];
@ -1112,11 +1178,11 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
_new_at = new tiler_brush_animated(_indx);
if(_new_at != noone) {
animated_selecting = array_length(animatedTiles);
autoterrain_selecting = noone;
object_selecting = _new_at;
object_select_id = noone;
array_push(animatedTiles, _new_at);
brush.brush_indices = [[ [ -(animated_selecting + 2), 0 ] ]];
brush.brush_indices = [[ [ -(array_length(animatedTiles) + 1), 0 ] ]];
brush.brush_width = 1;
brush.brush_height = 1;
}
@ -1144,28 +1210,16 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
var _px = _x + ui(8);
var _py = _yy + ui(4);
var _prin = array_safe_get(_at.index, safe_mod(current_time / 1000 * 2, array_length(_at.index)), noone);
var _prin = array_safe_get(_at.index, safe_mod(current_time / 1000 * 2, array_length(_at.index)), undefined);
if(_prin == noone) {
draw_set_color(COLORS._main_icon);
draw_rectangle(_px, _py, _px + _pw, _py + _ph, true);
} else {
var _prc = safe_mod(_prin, _tileAmo[0]);
var _prr = floor(_prin / _tileAmo[0]);
var _pr_tx = _prc * _tileSiz[0];
var _pr_ty = _prr * _tileSiz[1];
var _pr_sx = _pw / _tileSiz[0];
var _pr_sy = _ph / _tileSiz[1];
draw_surface_part_ext(_tileSet, _pr_tx, _pr_ty, _tileSiz[0], _tileSiz[1], _px, _py, _pr_sx, _pr_sy, c_white, 1);
}
if(_prin == undefined)
draw_sprite_stretched_ext(THEME.ui_panel, 1, _px, _py, _pw, _ph, COLORS._main_icon);
else
drawTile(_tileSet, _tileAmo, _tileSiz, _prin, _px, _py, _pw, _ph);
var _tx = _px + _pw + ui(8);
var _hov = _hover && point_in_rectangle(_m[0], _m[1], _x, _yy, _x + _w, _yy + _hg - 1);
var _cc = i == animated_selecting? COLORS._main_accent : (_hov? COLORS._main_text : COLORS._main_text_sub);
var _cc = object_selecting == _at? COLORS._main_accent : (_hov? COLORS._main_text : COLORS._main_text_sub);
if(renaming == _at) {
tb_rename.setFocusHover(_focus, _hover);
@ -1183,6 +1237,24 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
}
if(_hov && _m[0] < _x + _w - ui(32)) {
if(is(object_selecting, tiler_rule)) {
TOOLTIP = "Set Rule selector";
if(mouse_press(mb_left, _focus)) {
if(object_select_id != noone)
object_selecting.selection_rules[object_select_id] = -(i + 2);
object_selecting = noone;
triggerRender();
}
} else if(is(object_selecting, tiler_rule_replacement)) {
TOOLTIP = "Set Rule replacement";
if(mouse_press(mb_left, _focus)) {
object_selecting.index = -(i + 2);
object_selecting = noone;
triggerRender();
}
} else if(_m[0] > _tx) {
if(DOUBLE_CLICK && _focus) {
renaming = _at;
rename_text = _at.name;
@ -1191,18 +1263,20 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
tb_rename.activate();
} else if(mouse_press(mb_left, _focus)) {
if(_m[0] > _tx) {
animated_selecting = animated_selecting == i? noone : i;
autoterrain_selecting = noone;
object_selecting = object_selecting == _at? noone : _at;
object_select_id = noone;
brush.brush_indices = [[ [ - (i + 2), 0 ] ]];
brush.brush_indices = [[ [ -(i + 2), 0 ] ]];
brush.brush_width = 1;
brush.brush_height = 1;
palette_using = false;
} else {
_at.open = !_at.open;
}
} else {
draw_sprite_stretched_ext(THEME.ui_panel, 1, _px, _py, _pw, _ph, COLORS._main_accent);
if(mouse_press(mb_left, _focus))
_at.open = !_at.open;
}
}
@ -1256,9 +1330,7 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
surface_reset_shader();
draw_surface_ext(_at.preview_surface_tile, _pre_sx, _pre_sy, _ss, _ss, 0, c_white, 1);
draw_set_color(COLORS._main_icon);
draw_rectangle(_pre_sx, _pre_sy, _pre_sx + _pre_sw * _ss, _pre_sy + _pre_sh * _ss, true);
draw_sprite_stretched_ext(THEME.ui_panel, 1, _pre_sx, _pre_sy, _pre_sw * _ss, _pre_sh * _ss, COLORS._main_icon);
var _dtile_w = _tileSiz[0] * _ss;
var _dtile_h = _tileSiz[1] * _ss;
@ -1276,10 +1348,8 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
draw_rectangle(_at_c_sx, _at_c_sy, _at_c_sx + _dtile_w, _at_c_sy + _dtile_h, true);
if(mouse_press(mb_left, _focus)) {
animated_selecting = i;
autoterrain_selecting = noone;
animated_subtile_selecting = animated_subtile_selecting == _at_id? noone : _at_id;
object_selecting = _at;
object_select_id = object_select_id == _at_id? noone : _at_id;
}
if(mouse_press(mb_right, _focus))
@ -1287,15 +1357,14 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
}
}
if(animated_selecting == i && animated_subtile_selecting != noone) {
var _at_sl_x = animated_subtile_selecting % _coll;
var _at_sl_y = floor(animated_subtile_selecting / _coll);
if(object_selecting == _at && object_select_id != noone) {
var _at_sl_x = object_select_id % _coll;
var _at_sl_y = floor(object_select_id / _coll);
var _at_c_sx = _pre_sx + _at_sl_x * _dtile_w;
var _at_c_sy = _pre_sy + _at_sl_y * _dtile_h;
draw_set_color(COLORS._main_accent);
draw_rectangle(_at_c_sx, _at_c_sy, _at_c_sx + _dtile_w, _at_c_sy + _dtile_h, true);
draw_sprite_stretched_ext(THEME.ui_panel, 1, _at_c_sx, _at_c_sy, _dtile_w, _dtile_h, COLORS._main_accent);
}
_yy += _pre_sh * _ss + ui(4);
@ -1306,7 +1375,8 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
if(del != -1) {
array_delete(animatedTiles, del, 1);
animated_selecting = noone;
object_selecting = noone;
object_select_id = noone;
refreshAnimatedData();
}
@ -1317,10 +1387,9 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
#region ++++ rules ++++
ruleTiles = [];
rule_selecting = noone;
rule_selector_h = 0;
rule_subtile_selecting = noone;
rule_dragging = noone;
rules_viewer = new Inspector_Custom_Renderer(function(_x, _y, _w, _m, _hover, _focus, _panel = noone) {
var _yy = _y;
@ -1339,7 +1408,10 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
if(buttonInstant(THEME.button_hide, bx, by, bs, bs, _m, _focus, _hover, "New rule", THEME.add_16, 0, COLORS._main_value_positive) == 2) {
var _new_rl = new tiler_rule();
_new_rl.name = $"rule {array_length(ruleTiles)}"
_new_rl.open = true;
array_push(ruleTiles, _new_rl);
triggerRender();
}
_h += bs + ui(4);
@ -1348,6 +1420,7 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
var _pd = ui(4);
var _ah = _pd * 2;
var del = -1;
var rl_iHover = 0;
draw_sprite_stretched_ext(THEME.ui_panel_bg, 1, _x, _yy, _w, rule_selector_h, COLORS.node_composite_bg_blend, 1);
@ -1362,34 +1435,28 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
var _px = _x + ui(8);
var _py = _yy + ui(4);
var _prin = 0;
if(_m[1] > _yy) rl_iHover = i;
if(_prin == noone) {
draw_set_color(COLORS._main_icon);
draw_rectangle(_px, _py, _px + _pw, _py + _ph, true);
var _prin = array_safe_get(_rl.replacements, 0, undefined);
} else {
var _prc = safe_mod(_prin, _tileAmo[0]);
var _prr = floor(_prin / _tileAmo[0]);
var _pr_tx = _prc * _tileSiz[0];
var _pr_ty = _prr * _tileSiz[1];
var _pr_sx = _pw / _tileSiz[0];
var _pr_sy = _ph / _tileSiz[1];
draw_surface_part_ext(_tileSet, _pr_tx, _pr_ty, _tileSiz[0], _tileSiz[1], _px, _py, _pr_sx, _pr_sy, c_white, 1);
if(_prin == undefined)
draw_sprite_stretched_ext(THEME.ui_panel, 1, _px, _py, _pw, _ph, COLORS._main_icon);
else if(is(_prin, tiler_rule_replacement)) {
var _ind = array_safe_get(_prin.index, 0);
drawTile(_tileSet, _tileAmo, _tileSiz, _ind, _px, _py, _pw, _ph);
}
var _tx = _px + _pw + ui(8);
var _hov = _hover && point_in_rectangle(_m[0], _m[1], _x, _yy, _x + _w, _yy + _hg - 1);
var _cc = _hov? COLORS._main_text : COLORS._main_text_sub;
if(renaming == _rl) {
tb_rename.setFocusHover(_focus, _hover);
tb_rename.draw(_tx, _yy, _w - _pw - ui(8), _hg, rename_text, _m);
} else {
var _cc = _hov? COLORS._main_text : COLORS._main_text_sub;
if(rule_dragging == _rl) _cc = COLORS._main_accent;
draw_set_text(f_p2, fa_left, fa_center, _cc);
draw_text_add(_tx, _yy + _hg / 2, _rl.name);
@ -1400,33 +1467,225 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
del = i;
}
if(_hov && _m[0] < _x + _w - ui(32)) {
if(DOUBLE_CLICK && _focus) {
if(_hov && _m[0] < _x + _w - ui(32 + 160)) {
if(_m[0] > _tx) {
if(mouse_press(mb_left, _focus)) {
rule_dragging = _rl;
} else if(DOUBLE_CLICK && _focus) {
renaming = _rl;
rename_text = _rl.name;
tb_rename._current_text = _rl.name;
tb_rename.activate();
} else if(mouse_press(mb_left, _focus)) {
if(_m[0] > _tx) {
}
} else {
draw_sprite_stretched_ext(THEME.ui_panel, 1, _px, _py, _pw, _ph, COLORS._main_accent);
if(mouse_press(mb_left, _focus))
_rl.open = !_rl.open;
}
}
var _atWid = _rl.sl_prop;
var _scw = ui(120);
var _sch = ui(20);
var _scx = _x + _w - _scw - ui(32 + 8);
var _scy = _yy + _hg / 2 - _sch / 2;
_atWid.setFocusHover(_focus, _hover);
_atWid.rx = rules_viewer.rx; _atWid.ry = rules_viewer.ry;
_atWid.draw(_scx, _scy, _scw, _sch, _rl.probability, _m);
if(_rl.probability != _rl._probability) {
_rl._probability = _rl.probability;
triggerRender();
}
var _acw = ui(20);
var _ach = ui(20);
var _acx = _scx - _acw - ui(8);
var _acy = _yy + _hg / 2 - _sch / 2;
var _ahv = _hover && point_in_rectangle(_m[0], _m[1], _acx, _acy, _acx + _acw, _acy + _ach);
if(_ahv) {
TOOLTIP = "Active";
if(mouse_press(mb_left, _focus)) {
_rl.active = !_rl.active;
triggerRender();
}
}
draw_sprite_stretched_ext(THEME.checkbox_def, _ahv, _acx, _acy, _acw, _ach, c_white);
if(_rl.active) draw_sprite_stretched_ext(THEME.checkbox_def, 2, _acx, _acy, _acw, _ach, COLORS._main_accent);
_yy += _hg;
_ah += _hg;
if(_at.open) {
if(_rl.open) {
_yy += ui(4);
_ah += ui(4);
var _sls = ui(28);
var _radw = _rl.size[0] + _rl.range * 2;
var _radh = _rl.size[1] + _rl.range * 2;
var _slw = ui(16) + _radw * _sls;
var _slh = ui(16) + _radh * _sls;
var _hh0 = _slh;
draw_sprite_stretched_ext(THEME.ui_panel_bg, 1, _x + ui(8), _yy, _slw, _slh, COLORS.node_composite_bg_blend, 1);
for( var j = 0, m = array_length(_rl.selection_rules); j < m; j++ ) {
var _rl_sel = _rl.selection_rules[j];
var _rl_col = j % _radw;
var _rl_row = floor(j / _radw);
var _cen = _rl_col >= _rl.range && _rl_col < _rl.range + _rl.size[0] &&
_rl_row >= _rl.range && _rl_row < _rl.range + _rl.size[1];
var _rl_x = _x + ui(16) + _rl_col * _sls;
var _rl_y = _yy + ui( 8) + _rl_row * _sls;
var _rl_selected = object_selecting == _rl && object_select_id == j;
var _rl_hov = _hover && point_in_rectangle(_m[0], _m[1], _rl_x, _rl_y, _rl_x + _sls - 1, _rl_y + _sls - 1);
var _pad = ui(2);
var _cc = _rl_selected? COLORS._main_accent : COLORS._main_icon;
var _aa = _rl_selected? 1 : .5 + _rl_hov * .5;
if(is_array(_rl_sel)) {
var _autt = autoterrain[_rl_sel[1]];
drawTile(_tileSet, _tileAmo, _tileSiz, _autt.index[0], _rl_x + ui(2), _rl_y + ui(2), _sls - ui(4), _sls - ui(4));
draw_sprite_uniform(THEME.circle, 0, _rl_x + _sls - ui(8), _rl_y + _sls - ui(8), 1, COLORS._main_accent);
} else if (_rl_sel == -10000) {
draw_sprite_uniform(THEME.cross, 0, _rl_x + _sls / 2, _rl_y + _sls / 2, 1, _cc, _aa);
} else if(_rl_sel != -1) {
drawTile(_tileSet, _tileAmo, _tileSiz, _rl_sel, _rl_x + ui(2), _rl_y + ui(2), _sls - ui(4), _sls - ui(4));
} else if(!_cen) _pad = ui(10);
draw_sprite_stretched_ext(THEME.ui_panel, 1 + _cen, _rl_x + _pad, _rl_y + _pad, _sls - _pad * 2, _sls - _pad * 2, _cc, _aa);
if(_rl_hov) {
if(mouse_press(mb_left, _focus)) {
object_selecting = _rl_selected? noone : _rl;
object_select_id = j;
triggerRender();
}
if(mouse_press(mb_right, _focus)) {
_rl.selection_rules[j] = -1;
object_selecting = noone;
object_select_id = noone;
triggerRender();
}
}
}
if(del != -1) array_delete(ruleTiles, del, 1);
draw_sprite_uniform(THEME.arrow, 0, _x + ui(8) + _slw + ui(8), _yy + _slh / 2, 1, COLORS._main_icon, 1);
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
var _rep = _rl.replacements;
var _siz = _rl.size;
var _rpw = _sls * _siz[0];
var _rph = _sls * _siz[1];
var _dx = ui(8) + _slw + ui(16);
var _rx = _x + _dx;
var _slw = _w - _dx - ui(8);
var _col = max(1, floor((_slw - ui(16)) / _rpw));
var _row = ceil((array_length(_rep) + 1) / _col);
var _slh = ui(16) + _row * _rph;
draw_sprite_stretched_ext(THEME.ui_panel_bg, 1, _rx, _yy, _slw, max(_hh0, _slh), COLORS.node_composite_bg_blend, 1);
var del_rep = -1;
for( var j = 0, m = array_length(_rep) + 1; j < m; j++ ) {
var _rcl = j % _col;
var _rrw = floor(j / _col);
var _rpx = _rx + ui(8) + _rcl * _rpw;
var _rpy = _yy + ui(8) + _rrw * _rph;
var _rl_hov = _hover && point_in_rectangle(_m[0], _m[1], _rpx, _rpy, _rpx + _rpw, _rpy + _rph);
if(j == 0) {
var _cc = _rl_hov? COLORS._main_value_positive : COLORS._main_icon;
draw_sprite_uniform(THEME.add_16, 0, _rpx + _rpw / 2, _rpy + _rph / 2, 1, _cc);
if(_rl_hov && mouse_press(mb_left, _focus)) {
var _new_rep = new tiler_rule_replacement([-1]);
array_push(_rl.replacements, _new_rep);
object_selecting = _new_rep;
object_select_id = _rl;
}
continue;
}
var _replace = _rep[j - 1];
var _repIndex = _replace.index;
if(!is_array(_repIndex)) continue;
for( var k = 0, q = array_length(_repIndex); k < q; k++ ) {
var _repBlockCol = k % _siz[0];
var _repBlockRow = floor(k / _siz[0]);
var _rpbx = _rpx + _repBlockCol * _sls;
var _rpby = _rpy + _repBlockRow * _sls;
if(_replace.index[k] != -1) drawTile(_tileSet, _tileAmo, _tileSiz, _replace.index[k], _rpbx + ui(2), _rpby + ui(2), _sls - ui(4), _sls - ui(4));
}
var _rl_selected = object_selecting == _replace;
var _cc = _rl_selected? COLORS._main_accent : COLORS._main_icon;
var _aa = _rl_selected? 1 : .5 + _rl_hov * .5;
draw_sprite_stretched_ext(THEME.ui_panel, 1, _rpx + ui(2), _rpy + ui(2), _rpw - ui(4), _rph - ui(4), _cc, _aa);
if(_rl_hov) {
if(mouse_press(mb_left, _focus)) {
object_selecting = object_selecting == _replace? noone : _replace;
object_select_id = _rl;
triggerRender();
}
if(mouse_press(mb_right, _focus)) {
del_rep = j;
triggerRender();
}
}
}
if(del_rep != -1) {
array_delete(_rep, del_rep, 1);
triggerRender();
}
_yy += max(_hh0, _slh) + ui(8);
_ah += max(_hh0, _slh) + ui(8);
}
}
if(rule_dragging != noone) {
array_remove(ruleTiles, rule_dragging);
array_insert(ruleTiles, rl_iHover, rule_dragging);
if(mouse_release(mb_left)) {
rule_dragging = noone;
triggerRender();
}
}
if(del != -1) {
array_delete(ruleTiles, del, 1);
triggerRender();
}
rule_selector_h = max(ui(12), _ah);
return _h + _ah;
@ -1444,9 +1703,9 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
input_display_list = [ 1, 0,
["Tileset", false, noone, tile_selector_toggler ], tile_selector,
["Autoterrain", true, noone, autoterrain_selector_toggler ], autoterrain_selector,
["Autoterrains", true, noone, autoterrain_selector_toggler ], autoterrain_selector,
["Palette", true, noone, palette_viewer_toggler ], palette_viewer,
["Animated", true, 2, animated_viewer_toggler ], animated_viewer,
["Animated tiles",true, 2, animated_viewer_toggler ], animated_viewer,
["Rules", true, noone, rules_viewer_toggler ], rules_viewer,
];

View file

@ -1,4 +1,4 @@
function file_read_all(path) { #region
function file_read_all(path) {
INLINE
var f = file_text_open_read(path);
@ -9,9 +9,9 @@ function file_read_all(path) { #region
s += string(file_text_readln(f));
file_text_close(f);
return s;
} #endregion
}
function file_text_read_all_lines(path) { #region
function file_text_read_all_lines(path) {
INLINE
var f = file_text_open_read(path);
@ -22,9 +22,9 @@ function file_text_read_all_lines(path) { #region
array_push(s, file_text_readln(f));
file_text_close(f);
return s;
} #endregion
}
function file_text_write_all(path, str) { #region
function file_text_write_all(path, str) {
INLINE
if(file_exists_empty(path)) file_delete(path);
@ -34,4 +34,4 @@ function file_text_write_all(path, str) { #region
file_text_write_string(f, str);
file_text_close(f);
} #endregion
}

View file

@ -60,6 +60,8 @@ function tiler_tool_brush(node, _brush, eraser = false) : tiler_tool(node) const
_auto.drawing_start(drawing_surface, isEraser);
tiler_draw_point_brush(brush, mouse_cur_x, mouse_cur_y, false);
_auto.drawing_end();
apply_draw_surface();
}
mouse_holding = true;
@ -75,7 +77,6 @@ function tiler_tool_brush(node, _brush, eraser = false) : tiler_tool(node) const
}
mouse_holding = false;
apply_draw_surface();
}
@ -95,6 +96,7 @@ function tiler_tool_brush(node, _brush, eraser = false) : tiler_tool(node) const
_auto.drawing_end();
}
apply_draw_surface();
}
mouse_pre_draw_x = mouse_cur_x;

View file

@ -21,12 +21,11 @@ void main() {
gl_FragColor = vec4(0.);
vec2 px = v_vTexcoord * dimension;
vec2 tileTx = mod(px, tileSize) / tileSize;
vec2 texTx;
vec2 tileTx, texTx;
float index = 0.;
vec2 tileAmo = floor(tileTextureDim / tileSize);
vec4 samIdx = texture2D( indexTexture, floor(px / tileSize) / indexTextureDim );
vec4 samIdx = texture2D( indexTexture, floor(px / tileSize) / (indexTextureDim - 1.) );
if(samIdx.r == 0.) return;
if(samIdx.r > 0.) {

View file

@ -4,6 +4,8 @@ varying vec4 v_vColour;
uniform vec2 dimension;
uniform float height;
uniform float smooth;
uniform int normal;
uniform int swapx;
float bright(in vec4 col) { return dot(col.rgb, vec3(0.2126, 0.7152, 0.0722)) * col.a; }
@ -19,7 +21,7 @@ void main() {
float v0 = bright(texture2D(gm_BaseTexture, v_vTexcoord + tx * vec2( 0., -1.) * siz));
float v1 = bright(texture2D(gm_BaseTexture, v_vTexcoord + tx * vec2( 0., 1.) * siz));
vec2 normal;
vec2 _n;
if(smooth > 0.) {
float d0 = bright(texture2D(gm_BaseTexture, v_vTexcoord + tx * vec2( 1., -1.) * siz));
@ -27,7 +29,7 @@ void main() {
float d2 = bright(texture2D(gm_BaseTexture, v_vTexcoord + tx * vec2(-1., 1.) * siz));
float d3 = bright(texture2D(gm_BaseTexture, v_vTexcoord + tx * vec2( 1., 1.) * siz));
normal = (vec2(h1 - col, 0.)
_n = (vec2(h1 - col, 0.)
+ vec2(col - h0, 0.)
+ vec2(0., v1 - col)
+ vec2(0., col - v0)
@ -38,14 +40,18 @@ void main() {
) / (2. + 2. * sqrt(2.));
} else {
normal = (vec2(h1 - col, 0.)
_n = (vec2(h1 - col, 0.)
+ vec2(col - h0, 0.)
+ vec2(0., v1 - col)
+ vec2(0., col - v0)
) / 2.;
}
normal = normal * height + 0.5;
if(swapx == 1) _n.x = -_n.x;
_n = _n * height;
gl_FragColor = vec4(normal, 1., c.a);
vec3 n3 = vec3(_n, 1.);
if(normal == 1) n3 = normalize(n3);
gl_FragColor = vec4(.5 + n3 * .5, c.a);
}

View file

@ -62,6 +62,13 @@ float dot2(in vec2 v ) { return dot(v,v); }
mat2 rot(in float ang) { return mat2(cos(ang), - sin(ang), sin(ang), cos(ang)); }
float smin( float a, float b, float k ) {
if(k == 0.) return min(a, b);
k *= 1.0/(1.0-sqrt(0.5));
float h = max( k-abs(a-b), 0.0 )/k;
return min(a,b) - k*0.5*(1.0+h-sqrt(1.0-h*(h-2.0)));
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
float eval_curve_segment_t(in float _y0, in float ax0, in float ay0, in float bx1, in float by1, in float _y1, in float prog) {
@ -260,7 +267,7 @@ float sdDonut(vec2 p, float s) {
return max(o, -i);
}
float sdGear(vec2 p, float s, int teeth, vec2 teethSize, float teethAngle) {
float sdGear(vec2 p, float s, int teeth, vec2 teethSize, float teethAngle, float corner) {
float teeth_w = teethSize.y;
float teeth_h = teethSize.x;
@ -273,13 +280,16 @@ float sdGear(vec2 p, float s, int teeth, vec2 teethSize, float teethAngle) {
float d = o;
float _angSt = TAU / float(teeth);
float irad = corner / max(dimension.x, dimension.y) * 16.;
for(int i = 0; i < teeth; i++) {
_p = p;
_p = _p * rot(radians(teethAngle) + float(i) * _angSt);
_p = _p - vec2(1. - teeth_w, .0);
s1 = sdBox(_p, vec2(teeth_w, teeth_h));
d = min(d, s1);
s1 = sdRoundBox(_p, vec2(teeth_w, teeth_h), vec4(corner / 2., corner / 2., 0., 0.));
// d = min(d, s1);
d = smin(d, s1, irad);
}
d = max(d, -i);
@ -451,7 +461,7 @@ void main() {
else if(shape == 14) { d = sdCutDisk( coord, 1., inner ); }
else if(shape == 15) { d = sdPie( coord, vec2(sin(angle), cos(angle)), 1. ); }
else if(shape == 16) { d = sdRoundedCross( coord, 1. - corner ) - corner; }
else if(shape == 18) { d = sdGear( coord, inner, teeth, teethSize, teethAngle); }
else if(shape == 18) { d = sdGear( coord, inner, teeth, teethSize, teethAngle, corner); }
else if(shape == 19) { d = pow(pow(abs(coord.x), squircle_factor) + pow(abs(coord.y), squircle_factor), 1. / squircle_factor) - 1.; }
else if(shape == 17) { d = sdArrow( v_vTexcoord, p1, p2, thickness, arrow, arrow_head); }
else if(shape == 20) { d = sdSegment(v_vTexcoord, p1, p2) - thickness; }

View file

@ -0,0 +1,73 @@
varying vec2 v_vTexcoord;
varying vec4 v_vColour;
uniform sampler2D group;
uniform vec2 dimension;
uniform float seed;
uniform float probability;
uniform vec2 size;
uniform int range;
uniform float selection[64];
uniform float replacements[1024];
uniform int replacementCount;
vec2 tx = 1. / dimension;
float random (in vec2 st, float seed) { return fract(sin(dot(st.xy + seed / 1000., vec2(1892.9898, 78.23453))) * 437.54123); }
bool match(in vec2 p) {
int _w = int(size.x) + range * 2;
int _h = int(size.y) + range * 2;
for(int i = 0; i < _h; i++)
for(int j = 0; j < _w; j++) {
float selInd = selection[i * _w + j];
int _x = j - range;
int _y = i - range;
if(selInd == -1.) continue; // skip matching
if(selInd == -10000.) selInd = -1.; // match empty
vec2 sx = p + vec2(_x, _y) * tx;
if(selInd >= 10000.) {
vec4 gr = texture2D( group, sx );
if(gr.r != selInd) return false;
} else {
vec4 sp = texture2D( gm_BaseTexture, sx );
if(sp.r - 1. != selInd) return false;
}
}
return true;
}
void main() {
vec4 base = texture2D( gm_BaseTexture, v_vTexcoord );
gl_FragColor = base;
vec2 origin = v_vTexcoord;
int repShf = -1;
for(int i = 0; i < int(size.y); i++)
for(int j = 0; j < int(size.x); j++) {
vec2 o = v_vTexcoord - vec2(j, i) * tx;
if(match(o)) {
origin = o;
repShf = i * int(size.x) + j;
break;
}
}
if(repShf == -1) return;
float prop = random(origin, seed);
if(prop > probability) return;
int repIndex = int(random(origin, seed + 100.) * float(replacementCount)) * int(size.x * size.y);
gl_FragColor = vec4(replacements[repIndex + repShf] + 1., 0., 0., 1.);
}

View file

@ -0,0 +1,19 @@
//
// Simple passthrough vertex shader
//
attribute vec3 in_Position; // (x,y,z)
//attribute vec3 in_Normal; // (x,y,z) unused in this shader.
attribute vec4 in_Colour; // (r,g,b,a)
attribute vec2 in_TextureCoord; // (u,v)
varying vec2 v_vTexcoord;
varying vec4 v_vColour;
void main()
{
vec4 object_space_pos = vec4( in_Position.x, in_Position.y, in_Position.z, 1.0);
gl_Position = gm_Matrices[MATRIX_WORLD_VIEW_PROJECTION] * object_space_pos;
v_vColour = in_Colour;
v_vTexcoord = in_TextureCoord;
}

View file

@ -0,0 +1,12 @@
{
"$GMShader":"",
"%Name":"sh_tile_rule_apply",
"name":"sh_tile_rule_apply",
"parent":{
"name":"shaders",
"path":"folders/nodes/data/tiler/shaders.yy",
},
"resourceType":"GMShader",
"resourceVersion":"2.0",
"type":1,
}

View file

@ -0,0 +1,37 @@
varying vec2 v_vTexcoord;
varying vec4 v_vColour;
uniform vec2 dimension;
uniform int range;
uniform float selection[64];
uniform float selectionGroup[640];
void main() {
vec2 tx = 1. / dimension;
vec4 base = texture2D( gm_BaseTexture, v_vTexcoord );
float bs = base.r - 1.;
gl_FragColor = vec4(0.);
if(bs == -1.) return;
int _r = range * 2 + 1;
for(int i = 0; i < _r; i++)
for(int j = 0; j < _r; j++) {
float selInd = selection[i * _r + j];
if(selInd < 10000.) continue;
int _arr = int(selInd - 10000.);
int _len = int(selectionGroup[_arr * 64]);
for(int k = 0; k < _len; k++) {
float _selInd = selectionGroup[_arr * 64 + 1 + k];
if(_selInd == -1.) continue;
if(bs == _selInd) {
gl_FragColor = vec4(selInd, 0., 0., 1.);
return;
}
}
}
}

View file

@ -0,0 +1,19 @@
//
// Simple passthrough vertex shader
//
attribute vec3 in_Position; // (x,y,z)
//attribute vec3 in_Normal; // (x,y,z) unused in this shader.
attribute vec4 in_Colour; // (r,g,b,a)
attribute vec2 in_TextureCoord; // (u,v)
varying vec2 v_vTexcoord;
varying vec4 v_vColour;
void main()
{
vec4 object_space_pos = vec4( in_Position.x, in_Position.y, in_Position.z, 1.0);
gl_Position = gm_Matrices[MATRIX_WORLD_VIEW_PROJECTION] * object_space_pos;
v_vColour = in_Colour;
v_vTexcoord = in_TextureCoord;
}

View file

@ -0,0 +1,12 @@
{
"$GMShader":"",
"%Name":"sh_tile_rule_select",
"name":"sh_tile_rule_select",
"parent":{
"name":"shaders",
"path":"folders/nodes/data/tiler/shaders.yy",
},
"resourceType":"GMShader",
"resourceVersion":"2.0",
"type":1,
}

View file

@ -15,6 +15,7 @@ uniform int bitmaskType;
uniform int indexes[1024];
uniform int indexSize;
uniform int erase;
uniform int indexMapper48[64];
vec2 tx = 1. / dimension;
@ -79,6 +80,61 @@ void main() {
if(_1(i1) && _1(i3) && _1(i5) && _0(i7)) index = 7;
} else if(bitmaskType == 1) {
index = 12;
if(_A(i0) && _0(i1) && _A(i2) &&
_1(i3) && _1(i5) &&
_A(i6) && _1(i7) && _A(i8)) index = 2;
if(_A(i0) && _1(i1) && _A(i2) &&
_0(i3) && _1(i5) &&
_A(i6) && _1(i7) && _A(i8)) index = 10;
if(_A(i0) && _1(i1) && _A(i2) &&
_1(i3) && _0(i5) &&
_A(i6) && _1(i7) && _A(i8)) index = 14;
if(_A(i0) && _1(i1) && _A(i2) &&
_1(i3) && _1(i5) &&
_A(i6) && _0(i7) && _A(i8)) index = 22;
//////////////////////////////////////////////////////////////////////////////////////////////////
if(_A(i0) && _0(i1) && _A(i2) &&
_0(i3) && _1(i5) &&
_A(i6) && _1(i7) && _A(i8)) index = 1;
if(_A(i0) && _0(i1) && _A(i2) &&
_1(i3) && _0(i5) &&
_A(i6) && _1(i7) && _A(i8)) index = 3;
if(_A(i0) && _1(i1) && _A(i2) &&
_0(i3) && _1(i5) &&
_A(i6) && _0(i7) && _A(i8)) index = 21;
if(_A(i0) && _1(i1) && _A(i2) &&
_1(i3) && _0(i5) &&
_A(i6) && _0(i7) && _A(i8)) index = 23;
//////////////////////////////////////////////////////////////////////////////////////////////////
if(_0(i0) && _1(i1) && _A(i2) &&
_1(i3) && _1(i5) &&
_A(i6) && _1(i7) && _A(i8)) index = 6;
if(_A(i0) && _1(i1) && _0(i2) &&
_1(i3) && _1(i5) &&
_A(i6) && _1(i7) && _A(i8)) index = 8;
if(_A(i0) && _1(i1) && _A(i2) &&
_1(i3) && _1(i5) &&
_0(i6) && _1(i7) && _A(i8)) index = 16;
if(_A(i0) && _1(i1) && _A(i2) &&
_1(i3) && _1(i5) &&
_A(i6) && _1(i7) && _0(i8)) index = 18;
} else if(bitmaskType == 2) {
index = 6;
if(_0(i1) && _0(i3) && _1(i5) && _1(i7)) index = 0;
@ -103,7 +159,7 @@ void main() {
if(_0(i0) && _0(i8)) index = 14;
}
} else if(bitmaskType == 2 || bitmaskType == 3) {
} else if(bitmaskType == 3 || bitmaskType == 4) {
index = 12;
if(_A(i0) && _0(i1) && _A(i2) &&
@ -314,10 +370,7 @@ void main() {
_1(i3) && _1(i5) &&
_0(i6) && _1(i7) && _0(i8)) index = 52;
if(bitmaskType == 2) {
if(index == 0) index == 0;
else if(index == 0) index == 0;
}
if(bitmaskType == 2) index = indexMapper48[index];
}
float res = float(indexes[index]);

View file

Before

Width:  |  Height:  |  Size: 430 B

After

Width:  |  Height:  |  Size: 430 B

View file

@ -1,6 +1,6 @@
{
"$GMSprite":"",
"%Name":"s_autotile_11x5",
"%Name":"s_autoterrain_11x5",
"bboxMode":0,
"bbox_bottom":19,
"bbox_left":1,
@ -21,7 +21,7 @@
"layers":[
{"$GMImageLayer":"","%Name":"ebef9aaa-f543-4c23-9c83-7b884a011c18","blendMode":0,"displayName":"default","isLocked":false,"name":"ebef9aaa-f543-4c23-9c83-7b884a011c18","opacity":100.0,"resourceType":"GMImageLayer","resourceVersion":"2.0","visible":true,},
],
"name":"s_autotile_11x5",
"name":"s_autoterrain_11x5",
"nineSlice":null,
"origin":0,
"parent":{
@ -33,7 +33,7 @@
"resourceVersion":"2.0",
"sequence":{
"$GMSequence":"",
"%Name":"s_autotile_11x5",
"%Name":"s_autoterrain_11x5",
"autoRecord":true,
"backdropHeight":768,
"backdropImageOpacity":0.5,
@ -57,7 +57,7 @@
"resourceType":"KeyframeStore<MomentsEventKeyframe>",
"resourceVersion":"2.0",
},
"name":"s_autotile_11x5",
"name":"s_autoterrain_11x5",
"playback":1,
"playbackSpeed":30.0,
"playbackSpeedType":0,
@ -69,7 +69,7 @@
"tracks":[
{"$GMSpriteFramesTrack":"","builtinName":0,"events":[],"inheritsTrackColour":true,"interpolation":1,"isCreationTrack":false,"keyframes":{"$KeyframeStore<SpriteFrameKeyframe>":"","Keyframes":[
{"$Keyframe<SpriteFrameKeyframe>":"","Channels":{
"0":{"$SpriteFrameKeyframe":"","Id":{"name":"01232f7d-baf1-431a-a423-87f5315b841e","path":"sprites/s_autotile_11x5/s_autotile_11x5.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",},
"0":{"$SpriteFrameKeyframe":"","Id":{"name":"01232f7d-baf1-431a-a423-87f5315b841e","path":"sprites/s_autoterrain_11x5/s_autoterrain_11x5.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",},
},"Disabled":false,"id":"c2970cc7-3433-47a3-b228-86e7fc0ccfd3","IsCreationKey":false,"Key":0.0,"Length":1.0,"resourceType":"Keyframe<SpriteFrameKeyframe>","resourceVersion":"2.0","Stretch":false,},
],"resourceType":"KeyframeStore<SpriteFrameKeyframe>","resourceVersion":"2.0",},"modifiers":[],"name":"frames","resourceType":"GMSpriteFramesTrack","resourceVersion":"2.0","spriteId":null,"trackColour":0,"tracks":[],"traits":0,},
],

View file

Before

Width:  |  Height:  |  Size: 306 B

After

Width:  |  Height:  |  Size: 306 B

View file

@ -1,6 +1,6 @@
{
"$GMSprite":"",
"%Name":"s_autotile_3x3",
"%Name":"s_autoterrain_3x3",
"bboxMode":0,
"bbox_bottom":10,
"bbox_left":1,
@ -21,7 +21,7 @@
"layers":[
{"$GMImageLayer":"","%Name":"991afa55-558a-473d-a893-36b42e44b7d0","blendMode":0,"displayName":"default","isLocked":false,"name":"991afa55-558a-473d-a893-36b42e44b7d0","opacity":100.0,"resourceType":"GMImageLayer","resourceVersion":"2.0","visible":true,},
],
"name":"s_autotile_3x3",
"name":"s_autoterrain_3x3",
"nineSlice":null,
"origin":0,
"parent":{
@ -33,7 +33,7 @@
"resourceVersion":"2.0",
"sequence":{
"$GMSequence":"",
"%Name":"s_autotile_3x3",
"%Name":"s_autoterrain_3x3",
"autoRecord":true,
"backdropHeight":768,
"backdropImageOpacity":0.5,
@ -57,7 +57,7 @@
"resourceType":"KeyframeStore<MomentsEventKeyframe>",
"resourceVersion":"2.0",
},
"name":"s_autotile_3x3",
"name":"s_autoterrain_3x3",
"playback":1,
"playbackSpeed":30.0,
"playbackSpeedType":0,
@ -69,7 +69,7 @@
"tracks":[
{"$GMSpriteFramesTrack":"","builtinName":0,"events":[],"inheritsTrackColour":true,"interpolation":1,"isCreationTrack":false,"keyframes":{"$KeyframeStore<SpriteFrameKeyframe>":"","Keyframes":[
{"$Keyframe<SpriteFrameKeyframe>":"","Channels":{
"0":{"$SpriteFrameKeyframe":"","Id":{"name":"489436ec-6bcc-43d3-937c-b67a3080c21b","path":"sprites/s_autotile_3x3/s_autotile_3x3.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",},
"0":{"$SpriteFrameKeyframe":"","Id":{"name":"489436ec-6bcc-43d3-937c-b67a3080c21b","path":"sprites/s_autoterrain_3x3/s_autoterrain_3x3.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",},
},"Disabled":false,"id":"a8508d65-3502-4f18-a8ee-8c1db13c8fa2","IsCreationKey":false,"Key":0.0,"Length":1.0,"resourceType":"Keyframe<SpriteFrameKeyframe>","resourceVersion":"2.0","Stretch":false,},
],"resourceType":"KeyframeStore<SpriteFrameKeyframe>","resourceVersion":"2.0",},"modifiers":[],"name":"frames","resourceType":"GMSpriteFramesTrack","resourceVersion":"2.0","spriteId":null,"trackColour":0,"tracks":[],"traits":0,},
],

View file

Before

Width:  |  Height:  |  Size: 335 B

After

Width:  |  Height:  |  Size: 335 B

View file

@ -1,6 +1,6 @@
{
"$GMSprite":"",
"%Name":"s_autotile_5x3",
"%Name":"s_autoterrain_5x3",
"bboxMode":0,
"bbox_bottom":11,
"bbox_left":1,
@ -21,7 +21,7 @@
"layers":[
{"$GMImageLayer":"","%Name":"9fb628f1-89bb-421e-86a4-4569f01ce93e","blendMode":0,"displayName":"default","isLocked":false,"name":"9fb628f1-89bb-421e-86a4-4569f01ce93e","opacity":100.0,"resourceType":"GMImageLayer","resourceVersion":"2.0","visible":true,},
],
"name":"s_autotile_5x3",
"name":"s_autoterrain_5x3",
"nineSlice":null,
"origin":0,
"parent":{
@ -33,7 +33,7 @@
"resourceVersion":"2.0",
"sequence":{
"$GMSequence":"",
"%Name":"s_autotile_5x3",
"%Name":"s_autoterrain_5x3",
"autoRecord":true,
"backdropHeight":768,
"backdropImageOpacity":0.5,
@ -57,7 +57,7 @@
"resourceType":"KeyframeStore<MomentsEventKeyframe>",
"resourceVersion":"2.0",
},
"name":"s_autotile_5x3",
"name":"s_autoterrain_5x3",
"playback":1,
"playbackSpeed":30.0,
"playbackSpeedType":0,
@ -69,7 +69,7 @@
"tracks":[
{"$GMSpriteFramesTrack":"","builtinName":0,"events":[],"inheritsTrackColour":true,"interpolation":1,"isCreationTrack":false,"keyframes":{"$KeyframeStore<SpriteFrameKeyframe>":"","Keyframes":[
{"$Keyframe<SpriteFrameKeyframe>":"","Channels":{
"0":{"$SpriteFrameKeyframe":"","Id":{"name":"e3f83286-9b7e-4bd4-b2ea-c08183709b23","path":"sprites/s_autotile_5x3/s_autotile_5x3.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",},
"0":{"$SpriteFrameKeyframe":"","Id":{"name":"e3f83286-9b7e-4bd4-b2ea-c08183709b23","path":"sprites/s_autoterrain_5x3/s_autoterrain_5x3.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",},
},"Disabled":false,"id":"36ea370b-9cec-43d4-8aa3-92b69e692782","IsCreationKey":false,"Key":0.0,"Length":1.0,"resourceType":"Keyframe<SpriteFrameKeyframe>","resourceVersion":"2.0","Stretch":false,},
],"resourceType":"KeyframeStore<SpriteFrameKeyframe>","resourceVersion":"2.0",},"modifiers":[],"name":"frames","resourceType":"GMSpriteFramesTrack","resourceVersion":"2.0","spriteId":null,"trackColour":0,"tracks":[],"traits":0,},
],

Binary file not shown.

After

Width:  |  Height:  |  Size: 324 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 324 B

View file

@ -0,0 +1,90 @@
{
"$GMSprite":"",
"%Name":"s_autoterrain_5x5",
"bboxMode":0,
"bbox_bottom":17,
"bbox_left":2,
"bbox_right":17,
"bbox_top":2,
"collisionKind":1,
"collisionTolerance":0,
"DynamicTexturePage":false,
"edgeFiltering":false,
"For3D":false,
"frames":[
{"$GMSpriteFrame":"","%Name":"333c6f4d-d18f-465f-929f-92782d6684d5","name":"333c6f4d-d18f-465f-929f-92782d6684d5","resourceType":"GMSpriteFrame","resourceVersion":"2.0",},
],
"gridX":0,
"gridY":0,
"height":20,
"HTile":false,
"layers":[
{"$GMImageLayer":"","%Name":"cd0df110-6429-4bd1-a2db-58355c77f9a5","blendMode":0,"displayName":"default","isLocked":false,"name":"cd0df110-6429-4bd1-a2db-58355c77f9a5","opacity":100.0,"resourceType":"GMImageLayer","resourceVersion":"2.0","visible":true,},
],
"name":"s_autoterrain_5x5",
"nineSlice":null,
"origin":4,
"parent":{
"name":"sprites",
"path":"folders/nodes/data/tiler/sprites.yy",
},
"preMultiplyAlpha":false,
"resourceType":"GMSprite",
"resourceVersion":"2.0",
"sequence":{
"$GMSequence":"",
"%Name":"s_autoterrain_5x5",
"autoRecord":true,
"backdropHeight":768,
"backdropImageOpacity":0.5,
"backdropImagePath":"",
"backdropWidth":1366,
"backdropXOffset":0.0,
"backdropYOffset":0.0,
"events":{
"$KeyframeStore<MessageEventKeyframe>":"",
"Keyframes":[],
"resourceType":"KeyframeStore<MessageEventKeyframe>",
"resourceVersion":"2.0",
},
"eventStubScript":null,
"eventToFunction":{},
"length":1.0,
"lockOrigin":false,
"moments":{
"$KeyframeStore<MomentsEventKeyframe>":"",
"Keyframes":[],
"resourceType":"KeyframeStore<MomentsEventKeyframe>",
"resourceVersion":"2.0",
},
"name":"s_autoterrain_5x5",
"playback":1,
"playbackSpeed":30.0,
"playbackSpeedType":0,
"resourceType":"GMSequence",
"resourceVersion":"2.0",
"showBackdrop":true,
"showBackdropImage":false,
"timeUnits":1,
"tracks":[
{"$GMSpriteFramesTrack":"","builtinName":0,"events":[],"inheritsTrackColour":true,"interpolation":1,"isCreationTrack":false,"keyframes":{"$KeyframeStore<SpriteFrameKeyframe>":"","Keyframes":[
{"$Keyframe<SpriteFrameKeyframe>":"","Channels":{
"0":{"$SpriteFrameKeyframe":"","Id":{"name":"333c6f4d-d18f-465f-929f-92782d6684d5","path":"sprites/s_autoterrain_5x5/s_autoterrain_5x5.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",},
},"Disabled":false,"id":"2b8f6d09-964d-44ce-8778-8ecbb11ddce8","IsCreationKey":false,"Key":0.0,"Length":1.0,"resourceType":"Keyframe<SpriteFrameKeyframe>","resourceVersion":"2.0","Stretch":false,},
],"resourceType":"KeyframeStore<SpriteFrameKeyframe>","resourceVersion":"2.0",},"modifiers":[],"name":"frames","resourceType":"GMSpriteFramesTrack","resourceVersion":"2.0","spriteId":null,"trackColour":0,"tracks":[],"traits":0,},
],
"visibleRange":null,
"volume":1.0,
"xorigin":10,
"yorigin":10,
},
"swatchColours":null,
"swfPrecision":0.5,
"textureGroupId":{
"name":"Default",
"path":"texturegroups/Default",
},
"type":0,
"VTile":false,
"width":20,
}

View file

Before

Width:  |  Height:  |  Size: 420 B

After

Width:  |  Height:  |  Size: 420 B

View file

@ -1,6 +1,6 @@
{
"$GMSprite":"",
"%Name":"s_autotile_8x6",
"%Name":"s_autoterrain_8x6",
"bboxMode":0,
"bbox_bottom":15,
"bbox_left":1,
@ -21,7 +21,7 @@
"layers":[
{"$GMImageLayer":"","%Name":"f68055ce-ac86-4b01-82e6-52237403ebaf","blendMode":0,"displayName":"default","isLocked":false,"name":"f68055ce-ac86-4b01-82e6-52237403ebaf","opacity":100.0,"resourceType":"GMImageLayer","resourceVersion":"2.0","visible":true,},
],
"name":"s_autotile_8x6",
"name":"s_autoterrain_8x6",
"nineSlice":null,
"origin":0,
"parent":{
@ -33,7 +33,7 @@
"resourceVersion":"2.0",
"sequence":{
"$GMSequence":"",
"%Name":"s_autotile_8x6",
"%Name":"s_autoterrain_8x6",
"autoRecord":true,
"backdropHeight":768,
"backdropImageOpacity":0.5,
@ -57,7 +57,7 @@
"resourceType":"KeyframeStore<MomentsEventKeyframe>",
"resourceVersion":"2.0",
},
"name":"s_autotile_8x6",
"name":"s_autoterrain_8x6",
"playback":1,
"playbackSpeed":30.0,
"playbackSpeedType":0,
@ -69,7 +69,7 @@
"tracks":[
{"$GMSpriteFramesTrack":"","builtinName":0,"events":[],"inheritsTrackColour":true,"interpolation":1,"isCreationTrack":false,"keyframes":{"$KeyframeStore<SpriteFrameKeyframe>":"","Keyframes":[
{"$Keyframe<SpriteFrameKeyframe>":"","Channels":{
"0":{"$SpriteFrameKeyframe":"","Id":{"name":"b83bc046-0985-4dc1-8946-97dfc2b07310","path":"sprites/s_autotile_8x6/s_autotile_8x6.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",},
"0":{"$SpriteFrameKeyframe":"","Id":{"name":"b83bc046-0985-4dc1-8946-97dfc2b07310","path":"sprites/s_autoterrain_8x6/s_autoterrain_8x6.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",},
},"Disabled":false,"id":"71c3750d-2b37-491b-82a1-e81aa5777085","IsCreationKey":false,"Key":0.0,"Length":1.0,"resourceType":"Keyframe<SpriteFrameKeyframe>","resourceVersion":"2.0","Stretch":false,},
],"resourceType":"KeyframeStore<SpriteFrameKeyframe>","resourceVersion":"2.0",},"modifiers":[],"name":"frames","resourceType":"GMSpriteFramesTrack","resourceVersion":"2.0","spriteId":null,"trackColour":0,"tracks":[],"traits":0,},
],

Binary file not shown.

Before

Width:  |  Height:  |  Size: 834 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 835 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 835 B

View file

@ -12,14 +12,14 @@
"edgeFiltering":false,
"For3D":false,
"frames":[
{"$GMSpriteFrame":"","%Name":"05965c8d-83ef-49f2-92ed-2c79e632f392","name":"05965c8d-83ef-49f2-92ed-2c79e632f392","resourceType":"GMSpriteFrame","resourceVersion":"2.0",},
{"$GMSpriteFrame":"","%Name":"0c493bee-f15b-452e-b22b-0eb4f4b1a6a9","name":"0c493bee-f15b-452e-b22b-0eb4f4b1a6a9","resourceType":"GMSpriteFrame","resourceVersion":"2.0",},
],
"gridX":0,
"gridY":0,
"height":64,
"HTile":false,
"layers":[
{"$GMImageLayer":"","%Name":"ec92eda4-1e09-4847-a92f-f90e1c4b090c","blendMode":0,"displayName":"default","isLocked":false,"name":"ec92eda4-1e09-4847-a92f-f90e1c4b090c","opacity":100.0,"resourceType":"GMImageLayer","resourceVersion":"2.0","visible":true,},
{"$GMImageLayer":"","%Name":"a478b705-fbbc-4b61-aab2-73d2ceb068dc","blendMode":0,"displayName":"default","isLocked":false,"name":"a478b705-fbbc-4b61-aab2-73d2ceb068dc","opacity":100.0,"resourceType":"GMImageLayer","resourceVersion":"2.0","visible":true,},
],
"name":"s_node_tileset",
"nineSlice":null,
@ -69,8 +69,8 @@
"tracks":[
{"$GMSpriteFramesTrack":"","builtinName":0,"events":[],"inheritsTrackColour":true,"interpolation":1,"isCreationTrack":false,"keyframes":{"$KeyframeStore<SpriteFrameKeyframe>":"","Keyframes":[
{"$Keyframe<SpriteFrameKeyframe>":"","Channels":{
"0":{"$SpriteFrameKeyframe":"","Id":{"name":"05965c8d-83ef-49f2-92ed-2c79e632f392","path":"sprites/s_node_tileset/s_node_tileset.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",},
},"Disabled":false,"id":"5cbd7933-8ded-481c-a560-2007a5e2e0de","IsCreationKey":false,"Key":0.0,"Length":1.0,"resourceType":"Keyframe<SpriteFrameKeyframe>","resourceVersion":"2.0","Stretch":false,},
"0":{"$SpriteFrameKeyframe":"","Id":{"name":"0c493bee-f15b-452e-b22b-0eb4f4b1a6a9","path":"sprites/s_node_tileset/s_node_tileset.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",},
},"Disabled":false,"id":"c4d7e3be-cadc-41a9-a3aa-5dada431e473","IsCreationKey":false,"Key":0.0,"Length":1.0,"resourceType":"Keyframe<SpriteFrameKeyframe>","resourceVersion":"2.0","Stretch":false,},
],"resourceType":"KeyframeStore<SpriteFrameKeyframe>","resourceVersion":"2.0",},"modifiers":[],"name":"frames","resourceType":"GMSpriteFramesTrack","resourceVersion":"2.0","spriteId":null,"trackColour":0,"tracks":[],"traits":0,},
],
"visibleRange":null,

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View file

@ -12,14 +12,14 @@
"edgeFiltering":false,
"For3D":false,
"frames":[
{"$GMSpriteFrame":"","%Name":"c3b4ed40-48e3-4bd9-be74-cdb201d5ce07","name":"c3b4ed40-48e3-4bd9-be74-cdb201d5ce07","resourceType":"GMSpriteFrame","resourceVersion":"2.0",},
{"$GMSpriteFrame":"","%Name":"c19e60e4-752e-4d33-84d4-8cb8fd6d090e","name":"c19e60e4-752e-4d33-84d4-8cb8fd6d090e","resourceType":"GMSpriteFrame","resourceVersion":"2.0",},
],
"gridX":0,
"gridY":0,
"height":64,
"HTile":false,
"layers":[
{"$GMImageLayer":"","%Name":"17b46b13-d023-44d6-a82c-1baa780ada99","blendMode":0,"displayName":"default","isLocked":false,"name":"17b46b13-d023-44d6-a82c-1baa780ada99","opacity":100.0,"resourceType":"GMImageLayer","resourceVersion":"2.0","visible":true,},
{"$GMImageLayer":"","%Name":"3ebbef57-3950-4b2b-8f28-985405db67a8","blendMode":0,"displayName":"default","isLocked":false,"name":"3ebbef57-3950-4b2b-8f28-985405db67a8","opacity":100.0,"resourceType":"GMImageLayer","resourceVersion":"2.0","visible":true,},
],
"name":"s_node_tileset_drawer",
"nineSlice":null,
@ -69,8 +69,8 @@
"tracks":[
{"$GMSpriteFramesTrack":"","builtinName":0,"events":[],"inheritsTrackColour":true,"interpolation":1,"isCreationTrack":false,"keyframes":{"$KeyframeStore<SpriteFrameKeyframe>":"","Keyframes":[
{"$Keyframe<SpriteFrameKeyframe>":"","Channels":{
"0":{"$SpriteFrameKeyframe":"","Id":{"name":"c3b4ed40-48e3-4bd9-be74-cdb201d5ce07","path":"sprites/s_node_tileset_drawer/s_node_tileset_drawer.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",},
},"Disabled":false,"id":"c2cfdd19-a390-4eeb-a59b-7f180a8285ef","IsCreationKey":false,"Key":0.0,"Length":1.0,"resourceType":"Keyframe<SpriteFrameKeyframe>","resourceVersion":"2.0","Stretch":false,},
"0":{"$SpriteFrameKeyframe":"","Id":{"name":"c19e60e4-752e-4d33-84d4-8cb8fd6d090e","path":"sprites/s_node_tileset_drawer/s_node_tileset_drawer.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",},
},"Disabled":false,"id":"df124ed2-0439-43fb-9437-1f3ab99bbac3","IsCreationKey":false,"Key":0.0,"Length":1.0,"resourceType":"Keyframe<SpriteFrameKeyframe>","resourceVersion":"2.0","Stretch":false,},
],"resourceType":"KeyframeStore<SpriteFrameKeyframe>","resourceVersion":"2.0",},"modifiers":[],"name":"frames","resourceType":"GMSpriteFramesTrack","resourceVersion":"2.0","spriteId":null,"trackColour":0,"tracks":[],"traits":0,},
],
"visibleRange":null,

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View file

@ -0,0 +1,90 @@
{
"$GMSprite":"",
"%Name":"s_node_tileset_export",
"bboxMode":0,
"bbox_bottom":61,
"bbox_left":4,
"bbox_right":59,
"bbox_top":2,
"collisionKind":1,
"collisionTolerance":0,
"DynamicTexturePage":false,
"edgeFiltering":false,
"For3D":false,
"frames":[
{"$GMSpriteFrame":"","%Name":"41ad1ef4-812c-4234-873f-50652a2e18cb","name":"41ad1ef4-812c-4234-873f-50652a2e18cb","resourceType":"GMSpriteFrame","resourceVersion":"2.0",},
],
"gridX":0,
"gridY":0,
"height":64,
"HTile":false,
"layers":[
{"$GMImageLayer":"","%Name":"fc03369a-caa3-4b07-9134-abc0293d62e6","blendMode":0,"displayName":"default","isLocked":false,"name":"fc03369a-caa3-4b07-9134-abc0293d62e6","opacity":100.0,"resourceType":"GMImageLayer","resourceVersion":"2.0","visible":true,},
],
"name":"s_node_tileset_export",
"nineSlice":null,
"origin":4,
"parent":{
"name":"IO",
"path":"folders/nodes/icons/IO.yy",
},
"preMultiplyAlpha":false,
"resourceType":"GMSprite",
"resourceVersion":"2.0",
"sequence":{
"$GMSequence":"",
"%Name":"s_node_tileset_export",
"autoRecord":true,
"backdropHeight":768,
"backdropImageOpacity":0.5,
"backdropImagePath":"",
"backdropWidth":1366,
"backdropXOffset":0.0,
"backdropYOffset":0.0,
"events":{
"$KeyframeStore<MessageEventKeyframe>":"",
"Keyframes":[],
"resourceType":"KeyframeStore<MessageEventKeyframe>",
"resourceVersion":"2.0",
},
"eventStubScript":null,
"eventToFunction":{},
"length":1.0,
"lockOrigin":false,
"moments":{
"$KeyframeStore<MomentsEventKeyframe>":"",
"Keyframes":[],
"resourceType":"KeyframeStore<MomentsEventKeyframe>",
"resourceVersion":"2.0",
},
"name":"s_node_tileset_export",
"playback":1,
"playbackSpeed":30.0,
"playbackSpeedType":0,
"resourceType":"GMSequence",
"resourceVersion":"2.0",
"showBackdrop":true,
"showBackdropImage":false,
"timeUnits":1,
"tracks":[
{"$GMSpriteFramesTrack":"","builtinName":0,"events":[],"inheritsTrackColour":true,"interpolation":1,"isCreationTrack":false,"keyframes":{"$KeyframeStore<SpriteFrameKeyframe>":"","Keyframes":[
{"$Keyframe<SpriteFrameKeyframe>":"","Channels":{
"0":{"$SpriteFrameKeyframe":"","Id":{"name":"41ad1ef4-812c-4234-873f-50652a2e18cb","path":"sprites/s_node_tileset_export/s_node_tileset_export.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",},
},"Disabled":false,"id":"7a774c57-8fb5-4744-bf39-c20e7e9a1ac7","IsCreationKey":false,"Key":0.0,"Length":1.0,"resourceType":"Keyframe<SpriteFrameKeyframe>","resourceVersion":"2.0","Stretch":false,},
],"resourceType":"KeyframeStore<SpriteFrameKeyframe>","resourceVersion":"2.0",},"modifiers":[],"name":"frames","resourceType":"GMSpriteFramesTrack","resourceVersion":"2.0","spriteId":null,"trackColour":0,"tracks":[],"traits":0,},
],
"visibleRange":null,
"volume":1.0,
"xorigin":32,
"yorigin":32,
},
"swatchColours":null,
"swfPrecision":0.5,
"textureGroupId":{
"name":"Default",
"path":"texturegroups/Default",
},
"type":0,
"VTile":false,
"width":64,
}