- [Math, Pixel math] Add fract operation. - [Pixel math] Add operations to match with math nodes.
|
@ -103,6 +103,7 @@
|
||||||
{"name":"generators","order":1,"path":"folders/nodes/data/simulation/VFX/generators.yy",},
|
{"name":"generators","order":1,"path":"folders/nodes/data/simulation/VFX/generators.yy",},
|
||||||
{"name":"tiler","order":31,"path":"folders/nodes/data/tiler.yy",},
|
{"name":"tiler","order":31,"path":"folders/nodes/data/tiler.yy",},
|
||||||
{"name":"shaders","order":2,"path":"folders/nodes/data/tiler/shaders.yy",},
|
{"name":"shaders","order":2,"path":"folders/nodes/data/tiler/shaders.yy",},
|
||||||
|
{"name":"sprites","order":4,"path":"folders/nodes/data/tiler/sprites.yy",},
|
||||||
{"name":"tools","order":1,"path":"folders/nodes/data/tiler/tools.yy",},
|
{"name":"tools","order":1,"path":"folders/nodes/data/tiler/tools.yy",},
|
||||||
{"name":"transform","order":28,"path":"folders/nodes/data/transform.yy",},
|
{"name":"transform","order":28,"path":"folders/nodes/data/transform.yy",},
|
||||||
{"name":"value","order":29,"path":"folders/nodes/data/value.yy",},
|
{"name":"value","order":29,"path":"folders/nodes/data/value.yy",},
|
||||||
|
@ -405,8 +406,9 @@
|
||||||
{"name":"__strandSim","order":2,"path":"scripts/__strandSim/__strandSim.yy",},
|
{"name":"__strandSim","order":2,"path":"scripts/__strandSim/__strandSim.yy",},
|
||||||
{"name":"__surface","order":7,"path":"scripts/__surface/__surface.yy",},
|
{"name":"__surface","order":7,"path":"scripts/__surface/__surface.yy",},
|
||||||
{"name":"__tiler_animated","order":1,"path":"scripts/__tiler_animated/__tiler_animated.yy",},
|
{"name":"__tiler_animated","order":1,"path":"scripts/__tiler_animated/__tiler_animated.yy",},
|
||||||
{"name":"__tiler_autotile","order":6,"path":"scripts/__tiler_autotile/__tiler_autotile.yy",},
|
{"name":"__tiler_autoterrain","order":6,"path":"scripts/__tiler_autoterrain/__tiler_autoterrain.yy",},
|
||||||
{"name":"__tiler_brush","order":2,"path":"scripts/__tiler_brush/__tiler_brush.yy",},
|
{"name":"__tiler_brush","order":2,"path":"scripts/__tiler_brush/__tiler_brush.yy",},
|
||||||
|
{"name":"__tiler_rule","order":7,"path":"scripts/__tiler_rule/__tiler_rule.yy",},
|
||||||
{"name":"__tiler_tool","order":2,"path":"scripts/__tiler_tool/__tiler_tool.yy",},
|
{"name":"__tiler_tool","order":2,"path":"scripts/__tiler_tool/__tiler_tool.yy",},
|
||||||
{"name":"__vec2","order":7,"path":"scripts/__vec2/__vec2.yy",},
|
{"name":"__vec2","order":7,"path":"scripts/__vec2/__vec2.yy",},
|
||||||
{"name":"__vec3","order":8,"path":"scripts/__vec3/__vec3.yy",},
|
{"name":"__vec3","order":8,"path":"scripts/__vec3/__vec3.yy",},
|
||||||
|
@ -1327,6 +1329,7 @@
|
||||||
{"name":"path_reader","order":5,"path":"scripts/path_reader/path_reader.yy",},
|
{"name":"path_reader","order":5,"path":"scripts/path_reader/path_reader.yy",},
|
||||||
{"name":"pathAnchorBox","order":17,"path":"scripts/pathAnchorBox/pathAnchorBox.yy",},
|
{"name":"pathAnchorBox","order":17,"path":"scripts/pathAnchorBox/pathAnchorBox.yy",},
|
||||||
{"name":"pathArrayBox","order":12,"path":"scripts/pathArrayBox/pathArrayBox.yy",},
|
{"name":"pathArrayBox","order":12,"path":"scripts/pathArrayBox/pathArrayBox.yy",},
|
||||||
|
{"name":"pathnodeBox","order":17,"path":"scripts/pathnodeBox/pathnodeBox.yy",},
|
||||||
{"name":"pcx_parse","order":3,"path":"scripts/pcx_parse/pcx_parse.yy",},
|
{"name":"pcx_parse","order":3,"path":"scripts/pcx_parse/pcx_parse.yy",},
|
||||||
{"name":"pcx_server","order":2,"path":"scripts/pcx_server/pcx_server.yy",},
|
{"name":"pcx_server","order":2,"path":"scripts/pcx_server/pcx_server.yy",},
|
||||||
{"name":"perlin_noise","order":5,"path":"scripts/perlin_noise/perlin_noise.yy",},
|
{"name":"perlin_noise","order":5,"path":"scripts/perlin_noise/perlin_noise.yy",},
|
||||||
|
@ -1764,8 +1767,8 @@
|
||||||
{"name":"sh_texture_remap","order":11,"path":"shaders/sh_texture_remap/sh_texture_remap.yy",},
|
{"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_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_random","order":32,"path":"shaders/sh_tile_random/sh_tile_random.yy",},
|
||||||
{"name":"sh_tiler_autotile_apply","order":8,"path":"shaders/sh_tiler_autotile_apply/sh_tiler_autotile_apply.yy",},
|
{"name":"sh_tiler_autoterrain_apply","order":8,"path":"shaders/sh_tiler_autoterrain_apply/sh_tiler_autoterrain_apply.yy",},
|
||||||
{"name":"sh_tiler_autotile_mask","order":7,"path":"shaders/sh_tiler_autotile_mask/sh_tiler_autotile_mask.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",},
|
{"name":"sh_time_remap","order":2,"path":"shaders/sh_time_remap/sh_time_remap.yy",},
|
||||||
{"name":"sh_trail_filler_pass1","order":26,"path":"shaders/sh_trail_filler_pass1/sh_trail_filler_pass1.yy",},
|
{"name":"sh_trail_filler_pass1","order":26,"path":"shaders/sh_trail_filler_pass1/sh_trail_filler_pass1.yy",},
|
||||||
{"name":"sh_trail_filler_pass2","order":28,"path":"shaders/sh_trail_filler_pass2/sh_trail_filler_pass2.yy",},
|
{"name":"sh_trail_filler_pass2","order":28,"path":"shaders/sh_trail_filler_pass2/sh_trail_filler_pass2.yy",},
|
||||||
|
@ -1823,6 +1826,9 @@
|
||||||
{"name":"s_arrow_16","order":22,"path":"sprites/s_arrow_16/s_arrow_16.yy",},
|
{"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_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_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_biterator_b_grey_long","order":7,"path":"sprites/s_biterator_b_grey_long/s_biterator_b_grey_long.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_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",},
|
{"name":"s_biterator_b_labels","order":9,"path":"sprites/s_biterator_b_labels/s_biterator_b_labels.yy",},
|
||||||
|
@ -2332,6 +2338,7 @@
|
||||||
{"name":"s_node_lua_global","order":19,"path":"sprites/s_node_lua_global/s_node_lua_global.yy",},
|
{"name":"s_node_lua_global","order":19,"path":"sprites/s_node_lua_global/s_node_lua_global.yy",},
|
||||||
{"name":"s_node_lua_surface","order":18,"path":"sprites/s_node_lua_surface/s_node_lua_surface.yy",},
|
{"name":"s_node_lua_surface","order":18,"path":"sprites/s_node_lua_surface/s_node_lua_surface.yy",},
|
||||||
{"name":"s_node_magnitude","order":18,"path":"sprites/s_node_magnitude/s_node_magnitude.yy",},
|
{"name":"s_node_magnitude","order":18,"path":"sprites/s_node_magnitude/s_node_magnitude.yy",},
|
||||||
|
{"name":"s_node_math_operators","order":31,"path":"sprites/s_node_math_operators/s_node_math_operators.yy",},
|
||||||
{"name":"s_node_math","order":6,"path":"sprites/s_node_math/s_node_math.yy",},
|
{"name":"s_node_math","order":6,"path":"sprites/s_node_math/s_node_math.yy",},
|
||||||
{"name":"s_node_mesh_transform","order":1,"path":"sprites/s_node_mesh_transform/s_node_mesh_transform.yy",},
|
{"name":"s_node_mesh_transform","order":1,"path":"sprites/s_node_mesh_transform/s_node_mesh_transform.yy",},
|
||||||
{"name":"s_node_mesh_type","order":15,"path":"sprites/s_node_mesh_type/s_node_mesh_type.yy",},
|
{"name":"s_node_mesh_type","order":15,"path":"sprites/s_node_mesh_type/s_node_mesh_type.yy",},
|
||||||
|
|
|
@ -201,6 +201,7 @@
|
||||||
{"$GMFolder":"","%Name":"generators","folderPath":"folders/nodes/data/simulation/VFX/generators.yy","name":"generators","resourceType":"GMFolder","resourceVersion":"2.0",},
|
{"$GMFolder":"","%Name":"generators","folderPath":"folders/nodes/data/simulation/VFX/generators.yy","name":"generators","resourceType":"GMFolder","resourceVersion":"2.0",},
|
||||||
{"$GMFolder":"","%Name":"tiler","folderPath":"folders/nodes/data/tiler.yy","name":"tiler","resourceType":"GMFolder","resourceVersion":"2.0",},
|
{"$GMFolder":"","%Name":"tiler","folderPath":"folders/nodes/data/tiler.yy","name":"tiler","resourceType":"GMFolder","resourceVersion":"2.0",},
|
||||||
{"$GMFolder":"","%Name":"shaders","folderPath":"folders/nodes/data/tiler/shaders.yy","name":"shaders","resourceType":"GMFolder","resourceVersion":"2.0",},
|
{"$GMFolder":"","%Name":"shaders","folderPath":"folders/nodes/data/tiler/shaders.yy","name":"shaders","resourceType":"GMFolder","resourceVersion":"2.0",},
|
||||||
|
{"$GMFolder":"","%Name":"sprites","folderPath":"folders/nodes/data/tiler/sprites.yy","name":"sprites","resourceType":"GMFolder","resourceVersion":"2.0",},
|
||||||
{"$GMFolder":"","%Name":"tools","folderPath":"folders/nodes/data/tiler/tools.yy","name":"tools","resourceType":"GMFolder","resourceVersion":"2.0",},
|
{"$GMFolder":"","%Name":"tools","folderPath":"folders/nodes/data/tiler/tools.yy","name":"tools","resourceType":"GMFolder","resourceVersion":"2.0",},
|
||||||
{"$GMFolder":"","%Name":"transform","folderPath":"folders/nodes/data/transform.yy","name":"transform","resourceType":"GMFolder","resourceVersion":"2.0",},
|
{"$GMFolder":"","%Name":"transform","folderPath":"folders/nodes/data/transform.yy","name":"transform","resourceType":"GMFolder","resourceVersion":"2.0",},
|
||||||
{"$GMFolder":"","%Name":"value","folderPath":"folders/nodes/data/value.yy","name":"value","resourceType":"GMFolder","resourceVersion":"2.0",},
|
{"$GMFolder":"","%Name":"value","folderPath":"folders/nodes/data/value.yy","name":"value","resourceType":"GMFolder","resourceVersion":"2.0",},
|
||||||
|
@ -356,6 +357,7 @@
|
||||||
"IncludedFiles":[
|
"IncludedFiles":[
|
||||||
{"$GMIncludedFile":"","%Name":"Actions.zip","CopyToMask":-1,"filePath":"datafiles/data","name":"Actions.zip","resourceType":"GMIncludedFile","resourceVersion":"2.0",},
|
{"$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","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.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":"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",},
|
{"$GMIncludedFile":"","%Name":"Follow Path.json","CopyToMask":-1,"filePath":"datafiles/data/Actions/Nodes","name":"Follow Path.json","resourceType":"GMIncludedFile","resourceVersion":"2.0",},
|
||||||
|
@ -364,6 +366,8 @@
|
||||||
{"$GMIncludedFile":"","%Name":"Iso cube.png","CopyToMask":-1,"filePath":"datafiles/data/Actions/Nodes","name":"Iso cube.png","resourceType":"GMIncludedFile","resourceVersion":"2.0",},
|
{"$GMIncludedFile":"","%Name":"Iso cube.png","CopyToMask":-1,"filePath":"datafiles/data/Actions/Nodes","name":"Iso cube.png","resourceType":"GMIncludedFile","resourceVersion":"2.0",},
|
||||||
{"$GMIncludedFile":"","%Name":"Line from Path.json","CopyToMask":-1,"filePath":"datafiles/data/Actions/Nodes","name":"Line from Path.json","resourceType":"GMIncludedFile","resourceVersion":"2.0",},
|
{"$GMIncludedFile":"","%Name":"Line from Path.json","CopyToMask":-1,"filePath":"datafiles/data/Actions/Nodes","name":"Line from Path.json","resourceType":"GMIncludedFile","resourceVersion":"2.0",},
|
||||||
{"$GMIncludedFile":"","%Name":"Line from Path.png","CopyToMask":-1,"filePath":"datafiles/data/Actions/Nodes","name":"Line from Path.png","resourceType":"GMIncludedFile","resourceVersion":"2.0",},
|
{"$GMIncludedFile":"","%Name":"Line from Path.png","CopyToMask":-1,"filePath":"datafiles/data/Actions/Nodes","name":"Line from Path.png","resourceType":"GMIncludedFile","resourceVersion":"2.0",},
|
||||||
|
{"$GMIncludedFile":"","%Name":"Pixel iso cube.json","CopyToMask":-1,"filePath":"datafiles/data/Actions/Nodes","name":"Pixel iso cube.json","resourceType":"GMIncludedFile","resourceVersion":"2.0",},
|
||||||
|
{"$GMIncludedFile":"","%Name":"Pixel iso cube.png","CopyToMask":-1,"filePath":"datafiles/data/Actions/Nodes","name":"Pixel iso cube.png","resourceType":"GMIncludedFile","resourceVersion":"2.0",},
|
||||||
{"$GMIncludedFile":"","%Name":"Addons.zip","CopyToMask":-1,"filePath":"datafiles/data","name":"Addons.zip","resourceType":"GMIncludedFile","resourceVersion":"2.0",},
|
{"$GMIncludedFile":"","%Name":"Addons.zip","CopyToMask":-1,"filePath":"datafiles/data","name":"Addons.zip","resourceType":"GMIncludedFile","resourceVersion":"2.0",},
|
||||||
{"$GMIncludedFile":"","%Name":"Assets.zip","CopyToMask":-1,"filePath":"datafiles/data","name":"Assets.zip","resourceType":"GMIncludedFile","resourceVersion":"2.0",},
|
{"$GMIncludedFile":"","%Name":"Assets.zip","CopyToMask":-1,"filePath":"datafiles/data","name":"Assets.zip","resourceType":"GMIncludedFile","resourceVersion":"2.0",},
|
||||||
{"$GMIncludedFile":"","%Name":"Collections.zip","CopyToMask":-1,"filePath":"datafiles/data","name":"Collections.zip","resourceType":"GMIncludedFile","resourceVersion":"2.0",},
|
{"$GMIncludedFile":"","%Name":"Collections.zip","CopyToMask":-1,"filePath":"datafiles/data","name":"Collections.zip","resourceType":"GMIncludedFile","resourceVersion":"2.0",},
|
||||||
|
@ -894,8 +898,9 @@
|
||||||
{"id":{"name":"__strandSim","path":"scripts/__strandSim/__strandSim.yy",},},
|
{"id":{"name":"__strandSim","path":"scripts/__strandSim/__strandSim.yy",},},
|
||||||
{"id":{"name":"__surface","path":"scripts/__surface/__surface.yy",},},
|
{"id":{"name":"__surface","path":"scripts/__surface/__surface.yy",},},
|
||||||
{"id":{"name":"__tiler_animated","path":"scripts/__tiler_animated/__tiler_animated.yy",},},
|
{"id":{"name":"__tiler_animated","path":"scripts/__tiler_animated/__tiler_animated.yy",},},
|
||||||
{"id":{"name":"__tiler_autotile","path":"scripts/__tiler_autotile/__tiler_autotile.yy",},},
|
{"id":{"name":"__tiler_autoterrain","path":"scripts/__tiler_autoterrain/__tiler_autoterrain.yy",},},
|
||||||
{"id":{"name":"__tiler_brush","path":"scripts/__tiler_brush/__tiler_brush.yy",},},
|
{"id":{"name":"__tiler_brush","path":"scripts/__tiler_brush/__tiler_brush.yy",},},
|
||||||
|
{"id":{"name":"__tiler_rule","path":"scripts/__tiler_rule/__tiler_rule.yy",},},
|
||||||
{"id":{"name":"__tiler_tool","path":"scripts/__tiler_tool/__tiler_tool.yy",},},
|
{"id":{"name":"__tiler_tool","path":"scripts/__tiler_tool/__tiler_tool.yy",},},
|
||||||
{"id":{"name":"__vec2","path":"scripts/__vec2/__vec2.yy",},},
|
{"id":{"name":"__vec2","path":"scripts/__vec2/__vec2.yy",},},
|
||||||
{"id":{"name":"__vec3","path":"scripts/__vec3/__vec3.yy",},},
|
{"id":{"name":"__vec3","path":"scripts/__vec3/__vec3.yy",},},
|
||||||
|
@ -1953,6 +1958,7 @@
|
||||||
{"id":{"name":"path_reader","path":"scripts/path_reader/path_reader.yy",},},
|
{"id":{"name":"path_reader","path":"scripts/path_reader/path_reader.yy",},},
|
||||||
{"id":{"name":"pathAnchorBox","path":"scripts/pathAnchorBox/pathAnchorBox.yy",},},
|
{"id":{"name":"pathAnchorBox","path":"scripts/pathAnchorBox/pathAnchorBox.yy",},},
|
||||||
{"id":{"name":"pathArrayBox","path":"scripts/pathArrayBox/pathArrayBox.yy",},},
|
{"id":{"name":"pathArrayBox","path":"scripts/pathArrayBox/pathArrayBox.yy",},},
|
||||||
|
{"id":{"name":"pathnodeBox","path":"scripts/pathnodeBox/pathnodeBox.yy",},},
|
||||||
{"id":{"name":"patreon_email_check","path":"scripts/patreon_email_check/patreon_email_check.yy",},},
|
{"id":{"name":"patreon_email_check","path":"scripts/patreon_email_check/patreon_email_check.yy",},},
|
||||||
{"id":{"name":"pcx_ast","path":"scripts/pcx_ast/pcx_ast.yy",},},
|
{"id":{"name":"pcx_ast","path":"scripts/pcx_ast/pcx_ast.yy",},},
|
||||||
{"id":{"name":"pcx_parse","path":"scripts/pcx_parse/pcx_parse.yy",},},
|
{"id":{"name":"pcx_parse","path":"scripts/pcx_parse/pcx_parse.yy",},},
|
||||||
|
@ -2467,8 +2473,8 @@
|
||||||
{"id":{"name":"sh_texture_repeat","path":"shaders/sh_texture_repeat/sh_texture_repeat.yy",},},
|
{"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_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_random","path":"shaders/sh_tile_random/sh_tile_random.yy",},},
|
||||||
{"id":{"name":"sh_tiler_autotile_apply","path":"shaders/sh_tiler_autotile_apply/sh_tiler_autotile_apply.yy",},},
|
{"id":{"name":"sh_tiler_autoterrain_apply","path":"shaders/sh_tiler_autoterrain_apply/sh_tiler_autoterrain_apply.yy",},},
|
||||||
{"id":{"name":"sh_tiler_autotile_mask","path":"shaders/sh_tiler_autotile_mask/sh_tiler_autotile_mask.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",},},
|
{"id":{"name":"sh_time_remap","path":"shaders/sh_time_remap/sh_time_remap.yy",},},
|
||||||
{"id":{"name":"sh_trail_filler_pass1","path":"shaders/sh_trail_filler_pass1/sh_trail_filler_pass1.yy",},},
|
{"id":{"name":"sh_trail_filler_pass1","path":"shaders/sh_trail_filler_pass1/sh_trail_filler_pass1.yy",},},
|
||||||
{"id":{"name":"sh_trail_filler_pass2","path":"shaders/sh_trail_filler_pass2/sh_trail_filler_pass2.yy",},},
|
{"id":{"name":"sh_trail_filler_pass2","path":"shaders/sh_trail_filler_pass2/sh_trail_filler_pass2.yy",},},
|
||||||
|
@ -2533,6 +2539,10 @@
|
||||||
{"id":{"name":"s_arrow_16","path":"sprites/s_arrow_16/s_arrow_16.yy",},},
|
{"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_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_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_biterator_b_grey_long","path":"sprites/s_biterator_b_grey_long/s_biterator_b_grey_long.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_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",},},
|
{"id":{"name":"s_biterator_b_labels","path":"sprites/s_biterator_b_labels/s_biterator_b_labels.yy",},},
|
||||||
|
@ -3073,6 +3083,7 @@
|
||||||
{"id":{"name":"s_node_lua_global","path":"sprites/s_node_lua_global/s_node_lua_global.yy",},},
|
{"id":{"name":"s_node_lua_global","path":"sprites/s_node_lua_global/s_node_lua_global.yy",},},
|
||||||
{"id":{"name":"s_node_lua_surface","path":"sprites/s_node_lua_surface/s_node_lua_surface.yy",},},
|
{"id":{"name":"s_node_lua_surface","path":"sprites/s_node_lua_surface/s_node_lua_surface.yy",},},
|
||||||
{"id":{"name":"s_node_magnitude","path":"sprites/s_node_magnitude/s_node_magnitude.yy",},},
|
{"id":{"name":"s_node_magnitude","path":"sprites/s_node_magnitude/s_node_magnitude.yy",},},
|
||||||
|
{"id":{"name":"s_node_math_operators","path":"sprites/s_node_math_operators/s_node_math_operators.yy",},},
|
||||||
{"id":{"name":"s_node_math","path":"sprites/s_node_math/s_node_math.yy",},},
|
{"id":{"name":"s_node_math","path":"sprites/s_node_math/s_node_math.yy",},},
|
||||||
{"id":{"name":"s_node_mesh_path","path":"sprites/s_node_mesh_path/s_node_mesh_path.yy",},},
|
{"id":{"name":"s_node_mesh_path","path":"sprites/s_node_mesh_path/s_node_mesh_path.yy",},},
|
||||||
{"id":{"name":"s_node_mesh_transform","path":"sprites/s_node_mesh_transform/s_node_mesh_transform.yy",},},
|
{"id":{"name":"s_node_mesh_transform","path":"sprites/s_node_mesh_transform/s_node_mesh_transform.yy",},},
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
{ "index": "orthographic_scale", "value": 0.5 },
|
{ "index": "orthographic_scale", "value": 0.5 },
|
||||||
{ "index": "postioning_mode", "value": 2 },
|
{ "index": "postioning_mode", "value": 2 },
|
||||||
{ "index": "horizontal_angle", "value": 45 },
|
{ "index": "horizontal_angle", "value": 45 },
|
||||||
{ "index": "vertical_angle", "value": 30 },
|
{ "index": "vertical_angle", "value": 35.264 },
|
||||||
{ "index": "l1_h_angle", "value": 0 },
|
{ "index": "l1_h_angle", "value": 0 },
|
||||||
{ "index": "l1_v_angle", "value": 75 },
|
{ "index": "l1_v_angle", "value": 75 },
|
||||||
{ "index": "l2_intensity", "value": 0 }
|
{ "index": "l2_intensity", "value": 0 }
|
||||||
|
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
24
datafiles/data/Actions/Nodes/Pixel iso cube.json
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
{
|
||||||
|
"name": "Pixel iso cube",
|
||||||
|
"tags": [],
|
||||||
|
"tooltip": "",
|
||||||
|
"location": ["3D", "3D"],
|
||||||
|
"sprPath": "./Pixel iso cube.png",
|
||||||
|
"nodes": [
|
||||||
|
{ "id": "cube", "node": "Node_3D_Mesh_Cube", "x": 0, "y": 0 },
|
||||||
|
{ "id": "camera", "node": "Node_3D_Camera_Set", "x": 320, "y": 0,
|
||||||
|
"setValues": [ { "index": "projection", "value": 1 },
|
||||||
|
{ "index": "orthographic_scale", "value": 0.5 },
|
||||||
|
{ "index": "postioning_mode", "value": 2 },
|
||||||
|
{ "index": "horizontal_angle", "value": 45 },
|
||||||
|
{ "index": "vertical_angle", "value": 30 },
|
||||||
|
{ "index": "l1_h_angle", "value": 0 },
|
||||||
|
{ "index": "l1_v_angle", "value": 75 },
|
||||||
|
{ "index": "l2_intensity", "value": 0 }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"connections": [
|
||||||
|
{ "from": "cube", "fromIndex": 0, "to": "camera", "toIndex": "scene" }
|
||||||
|
]
|
||||||
|
}
|
BIN
datafiles/data/Actions/Nodes/Pixel iso cube.png
Normal file
After Width: | Height: | Size: 2.1 KiB |
BIN
datafiles/data/Actions/icons.afdesign~lock~
Normal file
|
@ -111,7 +111,7 @@ event_inherited();
|
||||||
if(sc_content.hover && point_in_rectangle(_m[0], _m[1], 0, _ly, _dw, _ly + hght - 1)) {
|
if(sc_content.hover && point_in_rectangle(_m[0], _m[1], 0, _ly, _dw, _ly + hght - 1)) {
|
||||||
sc_content.hover_content = true;
|
sc_content.hover_content = true;
|
||||||
selecting = i;
|
selecting = i;
|
||||||
hov = i;
|
hov = _val;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(selecting == i) {
|
if(selecting == i) {
|
||||||
|
@ -158,7 +158,7 @@ event_inherited();
|
||||||
if(update_hover) {
|
if(update_hover) {
|
||||||
UNDO_HOLDING = true;
|
UNDO_HOLDING = true;
|
||||||
|
|
||||||
if(hov != noone) scrollbox.onModify(hov);
|
if(hov != noone) scrollbox.onModify(array_find(scrollbox.data, hov));
|
||||||
else if(initVal > -1) scrollbox.onModify(initVal);
|
else if(initVal > -1) scrollbox.onModify(initVal);
|
||||||
|
|
||||||
UNDO_HOLDING = false;
|
UNDO_HOLDING = false;
|
||||||
|
|
|
@ -1,13 +1,14 @@
|
||||||
enum AUTOTILE_TYPE {
|
enum AUTOTERRAIN_TYPE {
|
||||||
box9,
|
box9,
|
||||||
side15,
|
side15,
|
||||||
top48,
|
top48,
|
||||||
top55,
|
top55,
|
||||||
}
|
}
|
||||||
|
|
||||||
function tiler_brush_autotile(_type, _index) constructor {
|
global.autoterrain_amount = [ 9, 15, 48, 55, ];
|
||||||
name = "autotile";
|
|
||||||
type = _type;
|
function tiler_brush_autoterrain(_type, _index) constructor {
|
||||||
|
name = "autoterrain";
|
||||||
index = _index;
|
index = _index;
|
||||||
|
|
||||||
mask_surface = noone;
|
mask_surface = noone;
|
||||||
|
@ -21,6 +22,21 @@ function tiler_brush_autotile(_type, _index) constructor {
|
||||||
|
|
||||||
open = false;
|
open = false;
|
||||||
|
|
||||||
|
sc_type = new scrollBox(["Simple box (3x3)", "Side platform (5x3)", "Godot tile (12x4)", "Gamemaker tileset (11x5)"], function(ind) /*=>*/ { setType(ind); });
|
||||||
|
sc_type.font = f_p3;
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
} setType(_type);
|
||||||
|
|
||||||
static drawing_start = function(surface, _erase = false) {
|
static drawing_start = function(surface, _erase = false) {
|
||||||
target_surface = surface;
|
target_surface = surface;
|
||||||
eraseMode = _erase;
|
eraseMode = _erase;
|
||||||
|
@ -45,12 +61,12 @@ function tiler_brush_autotile(_type, _index) constructor {
|
||||||
mask_surface = surface_verify(mask_surface, _dim[0], _dim[1], surface_r8unorm);
|
mask_surface = surface_verify(mask_surface, _dim[0], _dim[1], surface_r8unorm);
|
||||||
update_surface = surface_verify(update_surface, _dim[0], _dim[1], surface_rgba16float);
|
update_surface = surface_verify(update_surface, _dim[0], _dim[1], surface_rgba16float);
|
||||||
|
|
||||||
// autotile mask
|
// autoterrain mask
|
||||||
// #000000 : not part of autotile
|
// #000000 : not part of autoterrain
|
||||||
// #808080 : part of autotile, read only
|
// #808080 : part of autoterrain, read only
|
||||||
// #FFFFFF : part of autotile, writable
|
// #FFFFFF : part of autoterrain, writable
|
||||||
|
|
||||||
surface_set_shader(mask_surface, sh_tiler_autotile_mask);
|
surface_set_shader(mask_surface, sh_tiler_autoterrain_mask);
|
||||||
shader_set_surface("drawSurface", drawing_surface);
|
shader_set_surface("drawSurface", drawing_surface);
|
||||||
shader_set_i("indexes", index);
|
shader_set_i("indexes", index);
|
||||||
shader_set_i("indexSize", array_length(index));
|
shader_set_i("indexSize", array_length(index));
|
||||||
|
@ -58,7 +74,7 @@ function tiler_brush_autotile(_type, _index) constructor {
|
||||||
draw_surface(target_surface, 0, 0);
|
draw_surface(target_surface, 0, 0);
|
||||||
surface_reset_shader();
|
surface_reset_shader();
|
||||||
|
|
||||||
surface_set_shader(update_surface, sh_tiler_autotile_apply);
|
surface_set_shader(update_surface, sh_tiler_autoterrain_apply);
|
||||||
shader_set_2("dimension", _dim);
|
shader_set_2("dimension", _dim);
|
||||||
|
|
||||||
shader_set_surface("maskSurface", mask_surface);
|
shader_set_surface("maskSurface", mask_surface);
|
13
scripts/__tiler_autoterrain/__tiler_autoterrain.yy
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
{
|
||||||
|
"$GMScript":"v1",
|
||||||
|
"%Name":"__tiler_autoterrain",
|
||||||
|
"isCompatibility":false,
|
||||||
|
"isDnD":false,
|
||||||
|
"name":"__tiler_autoterrain",
|
||||||
|
"parent":{
|
||||||
|
"name":"tools",
|
||||||
|
"path":"folders/nodes/data/tiler/tools.yy",
|
||||||
|
},
|
||||||
|
"resourceType":"GMScript",
|
||||||
|
"resourceVersion":"2.0",
|
||||||
|
}
|
|
@ -5,7 +5,7 @@ function tiler_brush(node) constructor {
|
||||||
brush_height = 0;
|
brush_height = 0;
|
||||||
brush_surface = noone;
|
brush_surface = noone;
|
||||||
brush_erase = false;
|
brush_erase = false;
|
||||||
autotiler = noone;
|
autoterrain = noone;
|
||||||
|
|
||||||
brush_sizing = false;
|
brush_sizing = false;
|
||||||
brush_sizing_s = 0;
|
brush_sizing_s = 0;
|
||||||
|
|
10
scripts/__tiler_rule/__tiler_rule.gml
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
function tiler_rule() constructor {
|
||||||
|
name = "rule";
|
||||||
|
open = false;
|
||||||
|
|
||||||
|
static deserialize = function(_struct) {
|
||||||
|
name = struct_try_get(_struct, "name", name);
|
||||||
|
|
||||||
|
return self;
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,9 +1,9 @@
|
||||||
{
|
{
|
||||||
"$GMScript":"v1",
|
"$GMScript":"v1",
|
||||||
"%Name":"__tiler_autotile",
|
"%Name":"__tiler_rule",
|
||||||
"isCompatibility":false,
|
"isCompatibility":false,
|
||||||
"isDnD":false,
|
"isDnD":false,
|
||||||
"name":"__tiler_autotile",
|
"name":"__tiler_rule",
|
||||||
"parent":{
|
"parent":{
|
||||||
"name":"tools",
|
"name":"tools",
|
||||||
"path":"folders/nodes/data/tiler/tools.yy",
|
"path":"folders/nodes/data/tiler/tools.yy",
|
|
@ -52,7 +52,8 @@ function array_resize_fill(arr, size, fill = 0) {
|
||||||
enum ARRAY_OVERFLOW {
|
enum ARRAY_OVERFLOW {
|
||||||
_default,
|
_default,
|
||||||
loop,
|
loop,
|
||||||
pingpong
|
pingpong,
|
||||||
|
clamp
|
||||||
}
|
}
|
||||||
|
|
||||||
#macro aGetF array_safe_get_fast
|
#macro aGetF array_safe_get_fast
|
||||||
|
@ -71,7 +72,10 @@ function array_safe_get(arr, index, def = 0, overflow = ARRAY_OVERFLOW._default)
|
||||||
var len = array_length(arr);
|
var len = array_length(arr);
|
||||||
if(len == 0) return def;
|
if(len == 0) return def;
|
||||||
|
|
||||||
if(overflow == ARRAY_OVERFLOW.loop) {
|
if(overflow == ARRAY_OVERFLOW.clamp) {
|
||||||
|
index = clamp(index, 0, len - 1);
|
||||||
|
|
||||||
|
} else if(overflow == ARRAY_OVERFLOW.loop) {
|
||||||
if(index < 0)
|
if(index < 0)
|
||||||
index = len - safe_mod(abs(index), len);
|
index = len - safe_mod(abs(index), len);
|
||||||
index = index % len;
|
index = index % len;
|
||||||
|
|
|
@ -1,3 +1,13 @@
|
||||||
|
function buffer_verify(buffer, _size, buffer_kind = buffer_fixed) {
|
||||||
|
if(buffer <= 0) return buffer_create(_size, buffer_kind, 1);
|
||||||
|
if(!buffer_exists(buffer)) return buffer_create(_size, buffer_kind, 1);
|
||||||
|
|
||||||
|
var _s = buffer_get_size(buffer);
|
||||||
|
if(_s != _size) buffer_resize(buffer, _size);
|
||||||
|
|
||||||
|
return buffer;
|
||||||
|
}
|
||||||
|
|
||||||
function buffer_get_color(buffer, _x, _y, w, h) {
|
function buffer_get_color(buffer, _x, _y, w, h) {
|
||||||
buffer_seek(buffer, buffer_seek_start, (w * _y + _x) * 4);
|
buffer_seek(buffer, buffer_seek_start, (w * _y + _x) * 4);
|
||||||
var c = buffer_read(buffer, buffer_u32);
|
var c = buffer_read(buffer, buffer_u32);
|
||||||
|
@ -45,13 +55,13 @@ function buffer_from_string(str) {
|
||||||
return _b;
|
return _b;
|
||||||
}
|
}
|
||||||
|
|
||||||
function buffer_from_surface(surface, header = true) {
|
function buffer_from_surface(surface, header = true, buffer_kind = buffer_fixed) {
|
||||||
static header_length = 24;
|
static header_length = 24;
|
||||||
if(!is_surface(surface)) return noone;
|
if(!is_surface(surface)) return noone;
|
||||||
|
|
||||||
var bitSize = surface_format_get_bytes(surface_get_format(surface));
|
var bitSize = surface_format_get_bytes(surface_get_format(surface));
|
||||||
|
|
||||||
var _b = buffer_create((header_length * header) + surface_get_width_safe(surface) * surface_get_height_safe(surface) * bitSize, buffer_fixed, 1);
|
var _b = buffer_create((header_length * header) + surface_get_width_safe(surface) * surface_get_height_safe(surface) * bitSize, buffer_kind, 1);
|
||||||
if(header) {
|
if(header) {
|
||||||
buffer_write(_b, buffer_text, "PXCS");
|
buffer_write(_b, buffer_text, "PXCS");
|
||||||
buffer_write(_b, buffer_u16, surface_get_width_safe(surface));
|
buffer_write(_b, buffer_u16, surface_get_width_safe(surface));
|
||||||
|
|
|
@ -102,16 +102,22 @@ function buttonClass(_onClick, _icon = noone) : widget() constructor {
|
||||||
}
|
}
|
||||||
|
|
||||||
var aa = interactable * 0.25 + 0.75;
|
var aa = interactable * 0.25 + 0.75;
|
||||||
if(icon) {
|
var bx = _x + _w / 2;
|
||||||
var ind = is_array(icon_index)? icon_index[0]() : icon_index;
|
|
||||||
draw_sprite_ui_uniform(icon, ind, _x + _w / 2, _y + _h / 2, icon_size, icon_blend, aa);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(text != "") {
|
if(text != "") {
|
||||||
draw_set_alpha(aa);
|
var tx = _x + _w / 2;
|
||||||
draw_set_text(font, fa_center, fa_center, COLORS._main_text);
|
if(icon) tx += ui(8);
|
||||||
draw_text_add(_x + _w / 2, _y + _h / 2, text);
|
|
||||||
|
draw_set_text(font, fa_center, fa_center, COLORS._main_text, aa);
|
||||||
|
draw_text_add(tx, _y + _h / 2, text);
|
||||||
draw_set_alpha(1);
|
draw_set_alpha(1);
|
||||||
|
|
||||||
|
bx = tx - string_width(text) / 2 - ui(12);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(icon) {
|
||||||
|
var ind = is_array(icon_index)? icon_index[0]() : icon_index;
|
||||||
|
draw_sprite_ui_uniform(icon, ind, bx, _y + _h / 2, icon_size, icon_blend, aa);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(WIDGET_CURRENT == self) draw_sprite_stretched_ext(THEME.widget_selecting, 0, _x - ui(3), _y - ui(3), _w + ui(6), _h + ui(6), COLORS._main_accent, 1);
|
if(WIDGET_CURRENT == self) draw_sprite_stretched_ext(THEME.widget_selecting, 0, _x - ui(3), _y - ui(3), _w + ui(6), _h + ui(6), COLORS._main_accent, 1);
|
||||||
|
|
|
@ -42,7 +42,7 @@
|
||||||
LATEST_VERSION = 1_18_00_0;
|
LATEST_VERSION = 1_18_00_0;
|
||||||
VERSION = 1_18_01_0;
|
VERSION = 1_18_01_0;
|
||||||
SAVE_VERSION = 1_18_02_0;
|
SAVE_VERSION = 1_18_02_0;
|
||||||
VERSION_STRING = MAC? "1.18.003m" : "1.18.3.004";
|
VERSION_STRING = MAC? "1.18.003m" : "1.18.3.005";
|
||||||
BUILD_NUMBER = 1_18_01_0;
|
BUILD_NUMBER = 1_18_01_0;
|
||||||
|
|
||||||
HOTKEYS = ds_map_create();
|
HOTKEYS = ds_map_create();
|
||||||
|
|
|
@ -43,6 +43,18 @@ function Node_Blur_Path(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
||||||
__step_mask_modifier();
|
__step_mask_modifier();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static drawOverlay = function(hover, active, _x, _y, _s, _mx, _my, _snx, _sny) {
|
||||||
|
var _hov = false;
|
||||||
|
var hv = inputs[1].drawOverlay(hover, active, _x, _y, _s, _mx, _my, _snx, _sny); _hov |= bool(hv);
|
||||||
|
|
||||||
|
return _hov;
|
||||||
|
}
|
||||||
|
|
||||||
|
static getTool = function() {
|
||||||
|
var _path = getInputData(1);
|
||||||
|
return is_instanceof(_path, Node)? _path : self;
|
||||||
|
}
|
||||||
|
|
||||||
static processData = function(_outSurf, _data, _output_index, _array_index) {
|
static processData = function(_outSurf, _data, _output_index, _array_index) {
|
||||||
if(!is_surface(_data[0])) return _outSurf;
|
if(!is_surface(_data[0])) return _outSurf;
|
||||||
|
|
||||||
|
|
|
@ -2387,7 +2387,7 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor {
|
||||||
static attributeDeserialize = function(attr) {
|
static attributeDeserialize = function(attr) {
|
||||||
struct_append(attributes, attr);
|
struct_append(attributes, attr);
|
||||||
|
|
||||||
if(LOADING_VERSION < 1_18_02_0) {
|
if(!CLONING && LOADING_VERSION < 1_18_02_0) {
|
||||||
if(struct_has(attr, "color_depth")) attributes.color_depth += (!array_empty(inputs) && inputs[0].type == VALUE_TYPE.surface)? 1 : 2;
|
if(struct_has(attr, "color_depth")) attributes.color_depth += (!array_empty(inputs) && inputs[0].type == VALUE_TYPE.surface)? 1 : 2;
|
||||||
if(struct_has(attr, "interpolate")) attributes.interpolate++;
|
if(struct_has(attr, "interpolate")) attributes.interpolate++;
|
||||||
if(struct_has(attr, "oversample")) attributes.oversample++;
|
if(struct_has(attr, "oversample")) attributes.oversample++;
|
||||||
|
|
|
@ -120,16 +120,24 @@ function Node_Line(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons
|
||||||
}
|
}
|
||||||
|
|
||||||
var _dtype = getInputData(27);
|
var _dtype = getInputData(27);
|
||||||
var _hov = false;
|
var hv, _hov = false;
|
||||||
|
|
||||||
if(_dtype == 3) {
|
if(_dtype == 1) {
|
||||||
var hv = inputs[32].drawOverlay(hover, active, _x, _y, _s, _mx, _my, _snx, _sny); _hov |= bool(hv);
|
hv = inputs[7].drawOverlay(hover, active, _x, _y, _s, _mx, _my, _snx, _sny); _hov |= bool(hv);
|
||||||
var hv = inputs[33].drawOverlay(hover, active, _x, _y, _s, _mx, _my, _snx, _sny); _hov |= bool(hv);
|
|
||||||
|
} else if(_dtype == 3) {
|
||||||
|
hv = inputs[32].drawOverlay(hover, active, _x, _y, _s, _mx, _my, _snx, _sny); _hov |= bool(hv);
|
||||||
|
hv = inputs[33].drawOverlay(hover, active, _x, _y, _s, _mx, _my, _snx, _sny); _hov |= bool(hv);
|
||||||
}
|
}
|
||||||
|
|
||||||
return _hov;
|
return _hov;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static getTool = function() {
|
||||||
|
var _path = getInputData(7);
|
||||||
|
return is_instanceof(_path, Node)? _path : self;
|
||||||
|
}
|
||||||
|
|
||||||
static step = function() {
|
static step = function() {
|
||||||
var px = !getInputData(17);
|
var px = !getInputData(17);
|
||||||
var _tex = inputs[18].value_from != noone;
|
var _tex = inputs[18].value_from != noone;
|
||||||
|
|
|
@ -1,87 +1,62 @@
|
||||||
enum MATH_OPERATOR {
|
enum MATH_OPERATOR {
|
||||||
add,
|
add, // 0
|
||||||
subtract,
|
subtract, // 1
|
||||||
multiply,
|
multiply, // 2
|
||||||
divide,
|
divide, // 3
|
||||||
power,
|
power, // 4
|
||||||
root,
|
root, // 5
|
||||||
|
|
||||||
sin,
|
sin, // 6
|
||||||
cos,
|
cos, // 7
|
||||||
tan,
|
tan, // 8
|
||||||
|
|
||||||
modulo,
|
modulo, // 9
|
||||||
|
|
||||||
floor,
|
floor, // 10
|
||||||
ceiling,
|
ceiling, // 11
|
||||||
round,
|
round, // 12
|
||||||
|
|
||||||
lerp,
|
lerp, // 13
|
||||||
abs,
|
abs, // 14
|
||||||
|
|
||||||
clamp,
|
clamp, // 15
|
||||||
snap,
|
snap, // 16
|
||||||
|
fract, // 17
|
||||||
}
|
}
|
||||||
|
|
||||||
#region create
|
global.node_math_keys = [ "add", "subtract", "multiply", "divide", "power", "root",
|
||||||
global.node_math_keys = [ "add", "subtract", "multiply", "divide", "power", "root", "+", "-", "*", "/", "^",
|
"+", "-", "*", "/", "^",
|
||||||
"sin", "cos", "tan",
|
"sin", "cos", "tan", "modulo", "round",
|
||||||
"modulo",
|
"ceiling", "floor", "lerp", "abs", "fract",
|
||||||
"round", "ceiling", "floor",
|
"clamp", "snap" ];
|
||||||
"lerp", "abs",
|
|
||||||
"clamp", "snap" ];
|
|
||||||
|
|
||||||
function Node_create_Math(_x, _y, _group = noone, _param = {}) {
|
global.node_math_keys_map = [ MATH_OPERATOR.add, MATH_OPERATOR.subtract, MATH_OPERATOR.multiply, MATH_OPERATOR.divide, MATH_OPERATOR.power, MATH_OPERATOR.root,
|
||||||
var query = struct_try_get(_param, "query", "");
|
MATH_OPERATOR.add, MATH_OPERATOR.subtract, MATH_OPERATOR.multiply, MATH_OPERATOR.divide, MATH_OPERATOR.power,
|
||||||
var node = new Node_Math(_x, _y, _group).skipDefault();
|
MATH_OPERATOR.sin, MATH_OPERATOR.cos, MATH_OPERATOR.tan, MATH_OPERATOR.modulo, MATH_OPERATOR.round,
|
||||||
|
MATH_OPERATOR.ceiling, MATH_OPERATOR.floor, MATH_OPERATOR.lerp, MATH_OPERATOR.abs, MATH_OPERATOR.fract,
|
||||||
|
MATH_OPERATOR.clamp, MATH_OPERATOR.snap ];
|
||||||
|
|
||||||
switch(query) { #region
|
global.node_math_names = [ /* 0 - 9*/ "Add", "Subtract", "Multiply", "Divide", "Power", "Root", "Sin", "Cos", "Tan", "Modulo",
|
||||||
case "add" :
|
/*10 - 20*/ "Floor", "Ceil", "Round", "Lerp", "Abs", "Clamp", "Snap", "Fract" ];
|
||||||
case "+" :
|
|
||||||
node.inputs[0].setValue(MATH_OPERATOR.add); break;
|
|
||||||
case "subtract" :
|
|
||||||
case "-" :
|
|
||||||
node.inputs[0].setValue(MATH_OPERATOR.subtract); break;
|
|
||||||
case "multiply" :
|
|
||||||
case "*" :
|
|
||||||
node.inputs[0].setValue(MATH_OPERATOR.multiply); break;
|
|
||||||
case "divide" :
|
|
||||||
case "/" :
|
|
||||||
node.inputs[0].setValue(MATH_OPERATOR.divide); break;
|
|
||||||
case "power" :
|
|
||||||
case "^" :
|
|
||||||
node.inputs[0].setValue(MATH_OPERATOR.power); break;
|
|
||||||
case "root" : node.inputs[0].setValue(MATH_OPERATOR.root); break;
|
|
||||||
|
|
||||||
case "sin" : node.inputs[0].setValue(MATH_OPERATOR.sin); break;
|
global.node_math_scroll = array_create_ext(array_length(global.node_math_names), function(i) /*=>*/ {return new scrollItem(global.node_math_names[i], s_node_math_operators, i)});
|
||||||
case "cos" : node.inputs[0].setValue(MATH_OPERATOR.cos); break;
|
|
||||||
case "tan" : node.inputs[0].setValue(MATH_OPERATOR.tan); break;
|
|
||||||
|
|
||||||
case "modulo" : node.inputs[0].setValue(MATH_OPERATOR.modulo); break;
|
function Node_create_Math(_x, _y, _group = noone, _param = {}) {
|
||||||
|
var query = struct_try_get(_param, "query", "");
|
||||||
|
var node = new Node_Math(_x, _y, _group).skipDefault();
|
||||||
|
|
||||||
case "floor" : node.inputs[0].setValue(MATH_OPERATOR.floor); break;
|
var ind = array_find(global.node_math_keys, query);
|
||||||
case "ceiling" : node.inputs[0].setValue(MATH_OPERATOR.ceiling); break;
|
if(ind != -1) node.inputs[0].setValue(global.node_math_keys_map[ind]);
|
||||||
case "round" : node.inputs[0].setValue(MATH_OPERATOR.round); break;
|
|
||||||
|
|
||||||
case "lerp" : node.inputs[0].setValue(MATH_OPERATOR.lerp); break;
|
return node;
|
||||||
case "abs" : node.inputs[0].setValue(MATH_OPERATOR.abs); break;
|
}
|
||||||
|
|
||||||
case "clamp" : node.inputs[0].setValue(MATH_OPERATOR.clamp); break;
|
|
||||||
case "snap" : node.inputs[0].setValue(MATH_OPERATOR.snap); break;
|
|
||||||
} #endregion
|
|
||||||
|
|
||||||
return node;
|
|
||||||
}
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
function Node_Math(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
function Node_Math(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
||||||
name = "Math";
|
name = "Math";
|
||||||
color = COLORS.node_blend_number;
|
color = COLORS.node_blend_number;
|
||||||
setDimension(96, 48);
|
setDimension(96, 48);
|
||||||
|
|
||||||
newInput(0, nodeValue_Enum_Scroll("Type", self, 0, [
|
newInput(0, nodeValue_Enum_Scroll("Type", self, 0, global.node_math_scroll))
|
||||||
/* 0 - 9*/ "Add", "Subtract", "Multiply", "Divide", "Power", "Root", "Sin", "Cos", "Tan", "Modulo",
|
|
||||||
/*10 - 20*/ "Floor", "Ceil", "Round", "Lerp", "Abs", "Clamp", "Snap" ]))
|
|
||||||
.rejectArray();
|
.rejectArray();
|
||||||
|
|
||||||
newInput(1, nodeValue_Float("a", self, 0))
|
newInput(1, nodeValue_Float("a", self, 0))
|
||||||
|
@ -109,31 +84,7 @@ function Node_Math(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
||||||
if(index != 0) return;
|
if(index != 0) return;
|
||||||
|
|
||||||
var _type = inputs[0].getValue();
|
var _type = inputs[0].getValue();
|
||||||
|
setDisplayName(global.node_math_names[_type]);
|
||||||
switch(_type) {
|
|
||||||
case MATH_OPERATOR.add : setDisplayName("Add") break;
|
|
||||||
case MATH_OPERATOR.subtract : setDisplayName("Subtract"); break;
|
|
||||||
case MATH_OPERATOR.multiply : setDisplayName("Multiply"); break;
|
|
||||||
case MATH_OPERATOR.divide : setDisplayName("Divide"); break;
|
|
||||||
|
|
||||||
case MATH_OPERATOR.power : setDisplayName("Power"); break;
|
|
||||||
case MATH_OPERATOR.root : setDisplayName("Root"); break;
|
|
||||||
|
|
||||||
case MATH_OPERATOR.sin : setDisplayName("Sin"); break;
|
|
||||||
case MATH_OPERATOR.cos : setDisplayName("Cos"); break;
|
|
||||||
case MATH_OPERATOR.tan : setDisplayName("Tan"); break;
|
|
||||||
case MATH_OPERATOR.modulo : setDisplayName("Modulo"); break;
|
|
||||||
|
|
||||||
case MATH_OPERATOR.floor : setDisplayName("Floor"); break;
|
|
||||||
case MATH_OPERATOR.ceiling : setDisplayName("Ceiling"); break;
|
|
||||||
case MATH_OPERATOR.round : setDisplayName("Round"); break;
|
|
||||||
|
|
||||||
case MATH_OPERATOR.lerp : setDisplayName("Lerp"); break;
|
|
||||||
case MATH_OPERATOR.abs : setDisplayName("Abs"); break;
|
|
||||||
|
|
||||||
case MATH_OPERATOR.clamp : setDisplayName("Clamp"); break;
|
|
||||||
case MATH_OPERATOR.snap : setDisplayName("Snap"); break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static _eval = function(a, b, c = 0) {
|
static _eval = function(a, b, c = 0) {
|
||||||
|
@ -160,6 +111,7 @@ function Node_Math(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
||||||
|
|
||||||
case MATH_OPERATOR.clamp : return clamp(a, b, c);
|
case MATH_OPERATOR.clamp : return clamp(a, b, c);
|
||||||
case MATH_OPERATOR.snap : return value_snap(a, b);
|
case MATH_OPERATOR.snap : return value_snap(a, b);
|
||||||
|
case MATH_OPERATOR.fract : return frac(a);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -167,15 +119,16 @@ function Node_Math(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
||||||
static step = function() {
|
static step = function() {
|
||||||
var mode = getInputData(0);
|
var mode = getInputData(0);
|
||||||
|
|
||||||
|
inputs[2].setVisible(false, false);
|
||||||
|
inputs[3].setVisible(false, false);
|
||||||
|
inputs[5].setVisible(false, false);
|
||||||
|
|
||||||
switch(mode) {
|
switch(mode) {
|
||||||
case MATH_OPERATOR.sin :
|
case MATH_OPERATOR.sin :
|
||||||
case MATH_OPERATOR.cos :
|
case MATH_OPERATOR.cos :
|
||||||
case MATH_OPERATOR.tan :
|
case MATH_OPERATOR.tan :
|
||||||
inputs[3].setVisible(true);
|
inputs[3].setVisible(true);
|
||||||
break;
|
break;
|
||||||
default:
|
|
||||||
inputs[3].setVisible(false);
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
switch(mode) {
|
switch(mode) {
|
||||||
|
@ -195,8 +148,6 @@ function Node_Math(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
inputs[5].setVisible(false);
|
|
||||||
|
|
||||||
switch(mode) {
|
switch(mode) {
|
||||||
case MATH_OPERATOR.add :
|
case MATH_OPERATOR.add :
|
||||||
case MATH_OPERATOR.subtract :
|
case MATH_OPERATOR.subtract :
|
||||||
|
@ -218,13 +169,6 @@ function Node_Math(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
||||||
inputs[2].setVisible(true, true);
|
inputs[2].setVisible(true, true);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MATH_OPERATOR.floor :
|
|
||||||
case MATH_OPERATOR.ceiling :
|
|
||||||
case MATH_OPERATOR.round :
|
|
||||||
case MATH_OPERATOR.abs :
|
|
||||||
inputs[2].setVisible(false);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case MATH_OPERATOR.lerp :
|
case MATH_OPERATOR.lerp :
|
||||||
inputs[2].name = "To";
|
inputs[2].name = "To";
|
||||||
inputs[5].name = "Amount";
|
inputs[5].name = "Amount";
|
||||||
|
@ -295,29 +239,14 @@ function Node_Math(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
||||||
static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) {
|
static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) {
|
||||||
draw_set_text(f_sdf, fa_center, fa_center, COLORS._main_text);
|
draw_set_text(f_sdf, fa_center, fa_center, COLORS._main_text);
|
||||||
var str = "";
|
var str = "";
|
||||||
switch(getInputData(0)) {
|
var typ = getInputData(0);
|
||||||
case MATH_OPERATOR.add : str = "+"; break;
|
|
||||||
case MATH_OPERATOR.subtract : str = "-"; break;
|
|
||||||
case MATH_OPERATOR.multiply : str = "*"; break;
|
|
||||||
case MATH_OPERATOR.divide : str = "/"; break;
|
|
||||||
case MATH_OPERATOR.power : str = "pow"; break;
|
|
||||||
case MATH_OPERATOR.root : str = "root"; break;
|
|
||||||
|
|
||||||
case MATH_OPERATOR.sin : str = "sin"; break;
|
switch(typ) {
|
||||||
case MATH_OPERATOR.cos : str = "cos"; break;
|
case MATH_OPERATOR.add : str = "+"; break;
|
||||||
case MATH_OPERATOR.tan : str = "tan"; break;
|
case MATH_OPERATOR.subtract : str = "-"; break;
|
||||||
case MATH_OPERATOR.modulo : str = "mod"; break;
|
case MATH_OPERATOR.multiply : str = "*"; break;
|
||||||
|
case MATH_OPERATOR.divide : str = "/"; break;
|
||||||
case MATH_OPERATOR.floor : str = "floor"; break;
|
default: str = string_lower(global.node_math_names[typ]);
|
||||||
case MATH_OPERATOR.ceiling : str = "ceil"; break;
|
|
||||||
case MATH_OPERATOR.round : str = "round"; break;
|
|
||||||
|
|
||||||
case MATH_OPERATOR.lerp : str = "lerp"; break;
|
|
||||||
case MATH_OPERATOR.abs : str = "abs"; break;
|
|
||||||
|
|
||||||
case MATH_OPERATOR.clamp : str = "clamp"; break;
|
|
||||||
case MATH_OPERATOR.snap : str = "snap"; break;
|
|
||||||
default: return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var bbox = drawGetBbox(xx, yy, _s);
|
var bbox = drawGetBbox(xx, yy, _s);
|
||||||
|
|
|
@ -13,6 +13,9 @@ function Node_Mesh_Create_Path(_x, _y, _group = noone) : Node(_x, _y, _group) co
|
||||||
newOutput(0, nodeValue_Output("Mesh", self, VALUE_TYPE.mesh, noone));
|
newOutput(0, nodeValue_Output("Mesh", self, VALUE_TYPE.mesh, noone));
|
||||||
|
|
||||||
static drawOverlay = function(hover, active, _x, _y, _s, _mx, _my, _snx, _sny) {
|
static drawOverlay = function(hover, active, _x, _y, _s, _mx, _my, _snx, _sny) {
|
||||||
|
var _hov = false;
|
||||||
|
var hv = inputs[0].drawOverlay(hover, active, _x, _y, _s, _mx, _my, _snx, _sny); _hov |= bool(hv);
|
||||||
|
|
||||||
var mesh = outputs[0].getValue();
|
var mesh = outputs[0].getValue();
|
||||||
if(mesh == noone) return;
|
if(mesh == noone) return;
|
||||||
|
|
||||||
|
|
|
@ -663,7 +663,7 @@ function Node_Path(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
||||||
if(hover == -1) return;
|
if(hover == -1) return false;
|
||||||
line_hover = _line_hover;
|
line_hover = _line_hover;
|
||||||
|
|
||||||
/////////////////////////////////////////////////////// TOOLS ///////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////// TOOLS ///////////////////////////////////////////////////////
|
||||||
|
@ -826,6 +826,8 @@ function Node_Path(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
||||||
RENDER_ALL
|
RENDER_ALL
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static updateLength = function() {
|
static updateLength = function() {
|
||||||
|
@ -956,12 +958,13 @@ function Node_Path(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
||||||
_a0 = anchors[(i + 0) % ansize];
|
_a0 = anchors[(i + 0) % ansize];
|
||||||
_a1 = anchors[(i + 1) % ansize];
|
_a1 = anchors[(i + 1) % ansize];
|
||||||
|
|
||||||
if(_dist > lengths[i]) {
|
var _l = array_safe_get(lengths, i, 0, ARRAY_OVERFLOW.clamp);
|
||||||
_dist -= lengths[i];
|
if(_dist > _l) {
|
||||||
|
_dist -= _l;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
var _t = lengths[i] == 0? 0 : _dist / lengths[i];
|
var _t = _l == 0? 0 : _dist / _l;
|
||||||
|
|
||||||
if(_a0[4] == 0 && _a0[5] == 0 && _a1[2] == 0 && _a1[3] == 0) {
|
if(_a0[4] == 0 && _a0[5] == 0 && _a1[2] == 0 && _a1[3] == 0) {
|
||||||
out.x = lerp(_a0[0], _a1[0], _t);
|
out.x = lerp(_a0[0], _a1[0], _t);
|
||||||
|
|
|
@ -1,3 +1,14 @@
|
||||||
|
function Node_create_Pixel_Math(_x, _y, _group = noone, _param = {}) {
|
||||||
|
var query = struct_try_get(_param, "query", "");
|
||||||
|
var node = new Node_Pixel_Math(_x, _y, _group).skipDefault();
|
||||||
|
|
||||||
|
var ind = array_find(global.node_math_keys, query);
|
||||||
|
if(ind != -1) node.inputs[7].setValue(global.node_math_keys_map[ind]);
|
||||||
|
|
||||||
|
return node;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function Node_Pixel_Math(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
function Node_Pixel_Math(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||||
name = "Pixel Math";
|
name = "Pixel Math";
|
||||||
|
|
||||||
|
@ -15,9 +26,7 @@ function Node_Pixel_Math(_x, _y, _group = noone) : Node_Processor(_x, _y, _group
|
||||||
|
|
||||||
__init_mask_modifier(2); // inputs 5, 6,
|
__init_mask_modifier(2); // inputs 5, 6,
|
||||||
|
|
||||||
oprList = [ "Add", "Subtract", "Multiply", "Divide", "Power", "Root", "Sin", "Cos", "Tan", "Modulo",
|
newInput(7, nodeValue_Enum_Scroll("Operator", self, 0, global.node_math_scroll));
|
||||||
"Floor", "Ceil", "Round", "Abs", "Clamp" ];
|
|
||||||
newInput(7, nodeValue_Enum_Scroll("Operator", self, 0, oprList));
|
|
||||||
|
|
||||||
newInput(8, nodeValue_Vec4("Operand", self, [ 0, 0, 0, 0 ]));
|
newInput(8, nodeValue_Vec4("Operand", self, [ 0, 0, 0, 0 ]));
|
||||||
|
|
||||||
|
@ -27,11 +36,14 @@ function Node_Pixel_Math(_x, _y, _group = noone) : Node_Processor(_x, _y, _group
|
||||||
|
|
||||||
newInput(11, nodeValue_Surface("Operand surface", self));
|
newInput(11, nodeValue_Surface("Operand surface", self));
|
||||||
|
|
||||||
|
newInput(12, nodeValue_Float("Mix", self, .5))
|
||||||
|
.setDisplay(VALUE_DISPLAY.slider);
|
||||||
|
|
||||||
newOutput(0, nodeValue_Output("Surface out", self, VALUE_TYPE.surface, noone));
|
newOutput(0, nodeValue_Output("Surface out", self, VALUE_TYPE.surface, noone));
|
||||||
|
|
||||||
input_display_list = [ 1, 4,
|
input_display_list = [ 1, 4,
|
||||||
["Surfaces", false], 0, 2, 3, 5, 6,
|
["Surfaces", false], 0, 2, 3, 5, 6,
|
||||||
["Operation", false], 7, 10, 8, 9, 11,
|
["Operation", false], 7, 10, 8, 9, 12, 11,
|
||||||
]
|
]
|
||||||
|
|
||||||
attribute_surface_depth();
|
attribute_surface_depth();
|
||||||
|
@ -46,54 +58,41 @@ function Node_Pixel_Math(_x, _y, _group = noone) : Node_Processor(_x, _y, _group
|
||||||
var op2 = _data[9];
|
var op2 = _data[9];
|
||||||
var opType = _data[10];
|
var opType = _data[10];
|
||||||
var opS = _data[11];
|
var opS = _data[11];
|
||||||
|
var mixAmo = _data[12];
|
||||||
|
|
||||||
var _oprand = oprList[type];
|
var _oprand = global.node_math_scroll[type];
|
||||||
setDisplayName(_oprand);
|
setDisplayName(_oprand);
|
||||||
|
|
||||||
|
inputs[ 8].setVisible(false);
|
||||||
|
inputs[ 9].setVisible(false);
|
||||||
|
inputs[11].setVisible(opType, opType);
|
||||||
|
inputs[12].setVisible(type == MATH_OPERATOR.lerp);
|
||||||
|
|
||||||
if(opType == 0) {
|
if(opType == 0) {
|
||||||
switch(_oprand) {
|
switch(type) {
|
||||||
case "Add" :
|
case MATH_OPERATOR.add :
|
||||||
case "Subtract" :
|
case MATH_OPERATOR.subtract :
|
||||||
case "Multiply" :
|
case MATH_OPERATOR.multiply :
|
||||||
case "Divide" :
|
case MATH_OPERATOR.divide :
|
||||||
case "Power" :
|
case MATH_OPERATOR.power :
|
||||||
case "Root" :
|
case MATH_OPERATOR.root :
|
||||||
case "Modulo" :
|
case MATH_OPERATOR.modulo :
|
||||||
|
case MATH_OPERATOR.snap :
|
||||||
inputs[8].setVisible( true);
|
inputs[8].setVisible( true);
|
||||||
inputs[9].setVisible(false);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "Sin" :
|
case MATH_OPERATOR.clamp :
|
||||||
case "Cos" :
|
|
||||||
case "Tan" :
|
|
||||||
|
|
||||||
case "Floor" :
|
|
||||||
case "Ceil" :
|
|
||||||
case "Round" :
|
|
||||||
case "Abs" :
|
|
||||||
inputs[8].setVisible(false);
|
|
||||||
inputs[9].setVisible(false);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case "Clamp" :
|
|
||||||
inputs[8].setVisible(false);
|
|
||||||
inputs[9].setVisible( true);
|
inputs[9].setVisible( true);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
inputs[11].setVisible(false, false);
|
|
||||||
|
|
||||||
} else {
|
|
||||||
inputs[ 8].setVisible(false);
|
|
||||||
inputs[ 9].setVisible(false);
|
|
||||||
inputs[11].setVisible(true, true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
surface_set_shader(_outSurf, sh_pixel_math);
|
surface_set_shader(_outSurf, sh_pixel_math);
|
||||||
shader_set_i("operator", type);
|
shader_set_i("operator", type);
|
||||||
|
|
||||||
shader_set_i("operandType", opType );
|
shader_set_i("operandType", opType );
|
||||||
|
shader_set_f("mixAmount", mixAmo );
|
||||||
shader_set_surface("operandSurf", opS );
|
shader_set_surface("operandSurf", opS );
|
||||||
shader_set_4("operand", _oprand == "Clamp"? [ op2[0], op2[1], 0, 0] : op4 );
|
shader_set_4("operand", _oprand == "Clamp"? [ op2[0], op2[1], 0, 0] : op4 );
|
||||||
|
|
||||||
|
|
|
@ -138,10 +138,16 @@ function Node_Plot_Linear(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou
|
||||||
active &= !a;
|
active &= !a;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var a = inputs[20].drawOverlay(hover, active, _x, _y, _s, _mx, _my, _snx, _sny); active &= !a;
|
||||||
var a = inputs[28].drawOverlay(hover, active, _x, _y, _s, _mx, _my, _snx, _sny, current_data[0]); active &= !a;
|
var a = inputs[28].drawOverlay(hover, active, _x, _y, _s, _mx, _my, _snx, _sny, current_data[0]); active &= !a;
|
||||||
var a = inputs[30].drawOverlay(hover, active, _x, _y, _s, _mx, _my, _snx, _sny, current_data[0]); active &= !a;
|
var a = inputs[30].drawOverlay(hover, active, _x, _y, _s, _mx, _my, _snx, _sny, current_data[0]); active &= !a;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static getTool = function() {
|
||||||
|
var _path = getInputData(20);
|
||||||
|
return is_instanceof(_path, Node)? _path : self;
|
||||||
|
}
|
||||||
|
|
||||||
static processData = function(_outSurf, _data, _output_index, _array_index) {
|
static processData = function(_outSurf, _data, _output_index, _array_index) {
|
||||||
var _dim = _data[ 0];
|
var _dim = _data[ 0];
|
||||||
var _dat = _data[ 1];
|
var _dat = _data[ 1];
|
||||||
|
|
|
@ -649,7 +649,7 @@ function __initNodes() {
|
||||||
addNodeObject(filter, "JPEG", s_node_JPEG, "Node_JPEG", [1, Node_JPEG],, "Apply JPEG compression to the image.").setVersion(11730);
|
addNodeObject(filter, "JPEG", s_node_JPEG, "Node_JPEG", [1, Node_JPEG],, "Apply JPEG compression to the image.").setVersion(11730);
|
||||||
addNodeObject(filter, "Interlace", s_node_interlace, "Node_Interlaced", [1, Node_Interlaced],, "Apply interlace effect to an image.").setVersion(11760);
|
addNodeObject(filter, "Interlace", s_node_interlace, "Node_Interlaced", [1, Node_Interlaced],, "Apply interlace effect to an image.").setVersion(11760);
|
||||||
addNodeObject(filter, "Blend Edge", s_node_blend_edge, "Node_Blend_Edge", [1, Node_Blend_Edge],, "Blend the edges of an image to create tilable patterns.").setVersion(11740);
|
addNodeObject(filter, "Blend Edge", s_node_blend_edge, "Node_Blend_Edge", [1, Node_Blend_Edge],, "Blend the edges of an image to create tilable patterns.").setVersion(11740);
|
||||||
addNodeObject(filter, "Pixel Math", s_node_pixel_math, "Node_Pixel_Math", [1, Node_Pixel_Math],, "Apply mathematical operation directly on RGBA value.").setVersion(1_18_02_0);
|
addNodeObject(filter, "Pixel Math", s_node_pixel_math, "Node_Pixel_Math", [0, Node_create_Pixel_Math], global.node_math_keys, "Apply mathematical operation directly on RGBA value.").setVersion(1_18_02_0);
|
||||||
|
|
||||||
ds_list_add(filter, "Colors");
|
ds_list_add(filter, "Colors");
|
||||||
addNodeObject(filter, "Replace Palette", s_node_replace_palette, "Node_Color_replace", [1, Node_Color_replace], ["isolate color", "select color", "palette swap", "color replace"], "Match image to a palette then remap it to another palette.");
|
addNodeObject(filter, "Replace Palette", s_node_replace_palette, "Node_Color_replace", [1, Node_Color_replace], ["isolate color", "select color", "palette swap", "color replace"], "Match image to a palette then remap it to another palette.");
|
||||||
|
|
|
@ -269,6 +269,7 @@ function Node_Repeat(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) co
|
||||||
else if(_pat == 2) { var hv = inputs[8].drawOverlay(hover, active, px, py, _s, _mx, _my, _snx, _sny); active &= !hv; _hov |= hv; }
|
else if(_pat == 2) { var hv = inputs[8].drawOverlay(hover, active, px, py, _s, _mx, _my, _snx, _sny); active &= !hv; _hov |= hv; }
|
||||||
|
|
||||||
var hv = inputs[31].drawOverlay(hover, active, _x, _y, _s, _mx, _my, _snx, _sny, current_data[1]); active &= !hv; _hov |= hv;
|
var hv = inputs[31].drawOverlay(hover, active, _x, _y, _s, _mx, _my, _snx, _sny, current_data[1]); active &= !hv; _hov |= hv;
|
||||||
|
var hv = inputs[11].drawOverlay(hover, active, _x, _y, _s, _mx, _my, _snx, _sny); active &= !hv; _hov |= hv;
|
||||||
|
|
||||||
var _ani_amo = getInputAmount();
|
var _ani_amo = getInputAmount();
|
||||||
if(_ani_amo == 0) return _hov;
|
if(_ani_amo == 0) return _hov;
|
||||||
|
@ -279,17 +280,18 @@ function Node_Repeat(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) co
|
||||||
var _prop = current_data[_ind + 0];
|
var _prop = current_data[_ind + 0];
|
||||||
var _selc = current_data[_ind + 1];
|
var _selc = current_data[_ind + 1];
|
||||||
|
|
||||||
if(_selc == 0) {
|
if(_selc == 1) {
|
||||||
|
|
||||||
|
|
||||||
} else if(_selc == 1) {
|
|
||||||
var hv = inputs[_ind + 9].drawOverlay(hover, active, _x, _y, _s, _mx, _my, _snx, _sny); active &= !hv; _hov |= hv;
|
var hv = inputs[_ind + 9].drawOverlay(hover, active, _x, _y, _s, _mx, _my, _snx, _sny); active &= !hv; _hov |= hv;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return _hov;
|
return _hov;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static getTool = function() {
|
||||||
|
var _path = getInputData(11);
|
||||||
|
return is_instanceof(_path, Node)? _path : self;
|
||||||
|
}
|
||||||
|
|
||||||
static preGetInputs = function() {
|
static preGetInputs = function() {
|
||||||
var _arr = getSingleValue(16);
|
var _arr = getSingleValue(16);
|
||||||
var _pat = getSingleValue(3);
|
var _pat = getSingleValue(3);
|
||||||
|
|
|
@ -162,12 +162,19 @@ function Node_Scatter(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c
|
||||||
var _distType = current_data[6];
|
var _distType = current_data[6];
|
||||||
var _hov = false;
|
var _hov = false;
|
||||||
|
|
||||||
if(_distType < 3) { var hv = inputs[5].drawOverlay(hover, active, _x, _y, _s, _mx, _my, _snx, _sny); active &= !hv; _hov |= hv; }
|
if(_distType < 3) { var hv = inputs[ 5].drawOverlay(hover, active, _x, _y, _s, _mx, _my, _snx, _sny); active &= !hv; _hov |= hv; }
|
||||||
|
if(_distType == 4) { var hv = inputs[19].drawOverlay(hover, active, _x, _y, _s, _mx, _my, _snx, _sny); active &= !hv; _hov |= hv; }
|
||||||
|
|
||||||
var hv = inputs[29].drawOverlay(hover, active, _x, _y, _s, _mx, _my, _snx, _sny, current_data[1]); active &= !hv; _hov |= hv;
|
var hv = inputs[29].drawOverlay(hover, active, _x, _y, _s, _mx, _my, _snx, _sny, current_data[1]); active &= !hv; _hov |= hv;
|
||||||
|
|
||||||
return _hov;
|
return _hov;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static getTool = function() {
|
||||||
|
var _path = getInputData(19);
|
||||||
|
return is_instanceof(_path, Node)? _path : self;
|
||||||
|
}
|
||||||
|
|
||||||
static onValueUpdate = function(index) {
|
static onValueUpdate = function(index) {
|
||||||
if(index == 15) {
|
if(index == 15) {
|
||||||
var _arr = getInputData(15);
|
var _arr = getInputData(15);
|
||||||
|
|
|
@ -176,6 +176,9 @@ function Node_Shape(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con
|
||||||
ox = nx;
|
ox = nx;
|
||||||
oy = ny;
|
oy = ny;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var hv = inputs[14].drawOverlay(hover, active, _x, _y, _s, _mx, _my, _snx, _sny); _hov |= bool(hv);
|
||||||
|
|
||||||
return _hov;
|
return _hov;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -258,6 +261,11 @@ function Node_Shape(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con
|
||||||
return _hov;
|
return _hov;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static getTool = function() {
|
||||||
|
var _path = getInputData(14);
|
||||||
|
return is_instanceof(_path, Node)? _path : self;
|
||||||
|
}
|
||||||
|
|
||||||
static processData = function(_outSurf, _data, _output_index, _array_index) {
|
static processData = function(_outSurf, _data, _output_index, _array_index) {
|
||||||
var _dim = _data[0];
|
var _dim = _data[0];
|
||||||
var _bg = _data[1];
|
var _bg = _data[1];
|
||||||
|
|
|
@ -115,7 +115,7 @@ function Node_Strand_Create(_x, _y, _group = noone) : Node(_x, _y, _group) const
|
||||||
tool_grabbing = [];
|
tool_grabbing = [];
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
static drawOverlay = function(hover, active, _x, _y, _s, _mx, _my, _snx, _sny) { #region
|
static drawOverlay = function(hover, active, _x, _y, _s, _mx, _my, _snx, _sny) {
|
||||||
var _typ = getInputData(0);
|
var _typ = getInputData(0);
|
||||||
var _pre = getInputData(16);
|
var _pre = getInputData(16);
|
||||||
if(!attributes.use_groom)
|
if(!attributes.use_groom)
|
||||||
|
@ -418,9 +418,9 @@ function Node_Strand_Create(_x, _y, _group = noone) : Node(_x, _y, _group) const
|
||||||
|
|
||||||
tool_dmx = __mx;
|
tool_dmx = __mx;
|
||||||
tool_dmy = __my;
|
tool_dmy = __my;
|
||||||
} #endregion
|
}
|
||||||
|
|
||||||
static step = function() { #region
|
static step = function() {
|
||||||
var _typ = getInputData(0);
|
var _typ = getInputData(0);
|
||||||
|
|
||||||
inputs[ 5].setVisible(_typ == 1, _typ == 1);
|
inputs[ 5].setVisible(_typ == 1, _typ == 1);
|
||||||
|
@ -430,9 +430,9 @@ function Node_Strand_Create(_x, _y, _group = noone) : Node(_x, _y, _group) const
|
||||||
|
|
||||||
inputs[15].editWidget.text = attributes.use_groom? "Unbake" : "Bake";
|
inputs[15].editWidget.text = attributes.use_groom? "Unbake" : "Bake";
|
||||||
inputs[15].editWidget.blend = attributes.use_groom? COLORS._main_value_negative : COLORS._main_value_positive;
|
inputs[15].editWidget.blend = attributes.use_groom? COLORS._main_value_negative : COLORS._main_value_positive;
|
||||||
} #endregion
|
}
|
||||||
|
|
||||||
static strandUpdate = function(willReset = false) { #region
|
static strandUpdate = function(willReset = false) {
|
||||||
var _typ = getInputData(0);
|
var _typ = getInputData(0);
|
||||||
var _den = getInputData(1);
|
var _den = getInputData(1);
|
||||||
var _len = getInputData(2);
|
var _len = getInputData(2);
|
||||||
|
@ -531,30 +531,30 @@ function Node_Strand_Create(_x, _y, _group = noone) : Node(_x, _y, _group) const
|
||||||
|
|
||||||
ind++;
|
ind++;
|
||||||
}
|
}
|
||||||
} #endregion
|
}
|
||||||
|
|
||||||
static update = function(frame = CURRENT_FRAME) { #region
|
static update = function(frame = CURRENT_FRAME) {
|
||||||
strandUpdate(IS_FIRST_FRAME);
|
strandUpdate(IS_FIRST_FRAME);
|
||||||
} #endregion
|
}
|
||||||
|
|
||||||
static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) { #region
|
static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) {
|
||||||
var bbox = drawGetBbox(xx, yy, _s);
|
var bbox = drawGetBbox(xx, yy, _s);
|
||||||
draw_sprite_fit(s_node_strandSim_create, 0, bbox.xc, bbox.yc, bbox.w, bbox.h);
|
draw_sprite_fit(s_node_strandSim_create, 0, bbox.xc, bbox.yc, bbox.w, bbox.h);
|
||||||
} #endregion
|
}
|
||||||
|
|
||||||
static attributeSerialize = function() { #region
|
static attributeSerialize = function() {
|
||||||
var att = {};
|
var att = {};
|
||||||
att.use_groom = attributes.use_groom;
|
att.use_groom = attributes.use_groom;
|
||||||
att.fixStrand = groomed.serialize();
|
att.fixStrand = groomed.serialize();
|
||||||
return att;
|
return att;
|
||||||
} #endregion
|
}
|
||||||
|
|
||||||
static attributeDeserialize = function(attr) { #region
|
static attributeDeserialize = function(attr) {
|
||||||
struct_append(attributes, attr);
|
struct_append(attributes, attr);
|
||||||
|
|
||||||
if(struct_has(attr, "fixStrand"))
|
if(struct_has(attr, "fixStrand"))
|
||||||
groomed.deserialize(attr.fixStrand);
|
groomed.deserialize(attr.fixStrand);
|
||||||
|
|
||||||
attributes.use_groom = struct_try_get(attr, "use_groom", false);
|
attributes.use_groom = struct_try_get(attr, "use_groom", false);
|
||||||
} #endregion
|
}
|
||||||
}
|
}
|
|
@ -139,6 +139,18 @@ function Node_Text(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons
|
||||||
return random_range_seed(-1, 1, _x + seed) * __wave_ampli;
|
return random_range_seed(-1, 1, _x + seed) * __wave_ampli;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static drawOverlay = function(hover, active, _x, _y, _s, _mx, _my, _snx, _sny) {
|
||||||
|
var _hov = false;
|
||||||
|
var hv = inputs[13].drawOverlay(hover, active, _x, _y, _s, _mx, _my, _snx, _sny); _hov |= bool(hv);
|
||||||
|
|
||||||
|
return _hov;
|
||||||
|
}
|
||||||
|
|
||||||
|
static getTool = function() {
|
||||||
|
var _path = getInputData(13);
|
||||||
|
return is_instanceof(_path, Node)? _path : self;
|
||||||
|
}
|
||||||
|
|
||||||
static processData = function(_outSurf, _data, _output_index, _array_index) {
|
static processData = function(_outSurf, _data, _output_index, _array_index) {
|
||||||
var str = _data[0], strRaw = str;
|
var str = _data[0], strRaw = str;
|
||||||
var _font = _data[1];
|
var _font = _data[1];
|
||||||
|
|
|
@ -12,10 +12,11 @@ function Node_Tile_Drawer(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou
|
||||||
newInput( 2, nodeValue_Bool("Animated", self, false));
|
newInput( 2, nodeValue_Bool("Animated", self, false));
|
||||||
|
|
||||||
input_display_list = [ 1, 0 ];
|
input_display_list = [ 1, 0 ];
|
||||||
input_display_list_tileset = ["Tileset", false, noone, noone];
|
input_display_list_tileset = ["Tileset", false, noone, noone];
|
||||||
input_display_list_autotiles = ["Autotiles", true, noone, noone];
|
input_display_list_autoterrains = ["Autoterrain", true, noone, noone];
|
||||||
input_display_list_palette = ["Palette", true, noone, noone];
|
input_display_list_palette = ["Palette", true, noone, noone];
|
||||||
input_display_list_animated = ["Animated", true, 2, noone];
|
input_display_list_animated = ["Animated", true, 2, noone];
|
||||||
|
input_display_list_rule = ["Rule", true, noone, noone];
|
||||||
|
|
||||||
newOutput(0, nodeValue_Output("Tile output", self, VALUE_TYPE.surface, noone));
|
newOutput(0, nodeValue_Output("Tile output", self, VALUE_TYPE.surface, noone));
|
||||||
|
|
||||||
|
@ -24,9 +25,11 @@ function Node_Tile_Drawer(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou
|
||||||
newOutput(2, nodeValue_Output("Index array", self, VALUE_TYPE.integer, []))
|
newOutput(2, nodeValue_Output("Index array", self, VALUE_TYPE.integer, []))
|
||||||
.setArrayDepth(1);
|
.setArrayDepth(1);
|
||||||
|
|
||||||
|
output_display_list = [ 0, 1 ];
|
||||||
|
|
||||||
#region ++++ data ++++
|
#region ++++ data ++++
|
||||||
canvas_surface = surface_create_empty(1, 1, surface_rgba16float);
|
canvas_surface = surface_create_empty(1, 1, surface_rgba16float);
|
||||||
canvas_buffer = buffer_create(1 * 1 * 2, buffer_grow, 2);
|
canvas_buffer = buffer_create(1, buffer_grow, 4);
|
||||||
|
|
||||||
drawing_surface = noone;
|
drawing_surface = noone;
|
||||||
draw_stack = ds_list_create();
|
draw_stack = ds_list_create();
|
||||||
|
@ -163,9 +166,9 @@ function Node_Tile_Drawer(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou
|
||||||
if(_tool) {
|
if(_tool) {
|
||||||
var brush = tileset.brush;
|
var brush = tileset.brush;
|
||||||
|
|
||||||
brush.node = self;
|
brush.node = self;
|
||||||
brush.brush_size = tool_attribute.size;
|
brush.brush_size = tool_attribute.size;
|
||||||
brush.autotiler = array_safe_get(tileset.autotiles, tileset.autotile_selecting, noone);
|
brush.autoterrain = array_safe_get(tileset.autoterrains, tileset.autoterrain_selecting, noone);
|
||||||
|
|
||||||
_tool.brush = brush;
|
_tool.brush = brush;
|
||||||
_tool.subtool = _currTool.selecting;
|
_tool.subtool = _currTool.selecting;
|
||||||
|
@ -242,7 +245,7 @@ function Node_Tile_Drawer(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
//if(!array_empty(autotiles)) draw_surface_ext(autotiles[0].mask_surface, 32, 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);
|
||||||
// draw_surface_ext(canvas_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);
|
// 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);
|
// draw_surface_ext(preview_draw_overlay, 432, 32, 8, 8, 0, c_white, 1);
|
||||||
|
@ -256,16 +259,18 @@ function Node_Tile_Drawer(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou
|
||||||
return _outData;
|
return _outData;
|
||||||
}
|
}
|
||||||
|
|
||||||
input_display_list_tileset[3] = tileset.tile_selector_toggler;
|
input_display_list_tileset[3] = tileset.tile_selector_toggler;
|
||||||
input_display_list_autotiles[3] = tileset.autotile_selector_toggler;
|
input_display_list_autoterrains[3] = tileset.autoterrain_selector_toggler;
|
||||||
input_display_list_palette[3] = tileset.palette_viewer_toggler;
|
input_display_list_palette[3] = tileset.palette_viewer_toggler;
|
||||||
input_display_list_animated[3] = tileset.animated_viewer_toggler;
|
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 = [ 1, 0,
|
||||||
input_display_list_tileset, tileset.tile_selector,
|
input_display_list_tileset, tileset.tile_selector,
|
||||||
input_display_list_autotiles, tileset.autotile_selector,
|
input_display_list_autoterrains, tileset.autoterrain_selector,
|
||||||
input_display_list_palette, tileset.palette_viewer,
|
input_display_list_palette, tileset.palette_viewer,
|
||||||
input_display_list_animated, tileset.animated_viewer,
|
input_display_list_animated, tileset.animated_viewer,
|
||||||
|
input_display_list_rule, tileset.rules_viewer,
|
||||||
]
|
]
|
||||||
|
|
||||||
var _tileSet = tileset.texture;
|
var _tileSet = tileset.texture;
|
||||||
|
@ -290,17 +295,13 @@ function Node_Tile_Drawer(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou
|
||||||
|
|
||||||
if(!is_surface(_tileSet)) return _outData;
|
if(!is_surface(_tileSet)) return _outData;
|
||||||
|
|
||||||
var _tileOut = _outData[0];
|
|
||||||
var _tileMap = _outData[1];
|
|
||||||
var _arrIndx = _outData[2];
|
|
||||||
|
|
||||||
var _outDim = [ _tileSiz[0] * _mapSize[0], _tileSiz[1] * _mapSize[1] ];
|
var _outDim = [ _tileSiz[0] * _mapSize[0], _tileSiz[1] * _mapSize[1] ];
|
||||||
|
|
||||||
_tileOut = surface_verify(_tileOut, _outDim[0], _outDim[1]);
|
var _tileOut = surface_verify(_outData[0], _outDim[0], _outDim[1]);
|
||||||
_tileMap = surface_verify(_tileMap, _mapSize[0], _mapSize[1], surface_rgba16float);
|
var _tileMap = surface_verify(_outData[1], _mapSize[0], _mapSize[1], surface_rgba16float);
|
||||||
_arrIndx = array_verify(_arrIndx, _mapSize[0] * _mapSize[1]);
|
var _arrIndx = array_verify( _outData[2], _mapSize[0] * _mapSize[1]);
|
||||||
|
|
||||||
buffer_resize(canvas_buffer, _mapSize[0] * _mapSize[1] * 2);
|
canvas_buffer = buffer_verify(canvas_buffer, _mapSize[0] * _mapSize[1] * 8);
|
||||||
buffer_get_surface(canvas_buffer, canvas_surface, 0);
|
buffer_get_surface(canvas_buffer, canvas_surface, 0);
|
||||||
|
|
||||||
surface_set_shader(_tileMap, sh_sample, true, BLEND.over);
|
surface_set_shader(_tileMap, sh_sample, true, BLEND.over);
|
||||||
|
@ -329,33 +330,22 @@ function Node_Tile_Drawer(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
static doSerialize = function(_map) {
|
|
||||||
_map.surface = buffer_serialize(canvas_buffer);
|
|
||||||
}
|
|
||||||
|
|
||||||
static doApplyDeserialize = function() {
|
|
||||||
canvas_buffer = buffer_deserialize(load_map.surface);
|
|
||||||
canvas_surface = surface_verify(canvas_surface, attributes.dimension[0], attributes.dimension[1], surface_rgba16float);
|
|
||||||
drawing_surface = surface_verify(drawing_surface, attributes.dimension[0], attributes.dimension[1], surface_rgba16float);
|
|
||||||
|
|
||||||
buffer_set_surface(canvas_buffer, canvas_surface, 0);
|
|
||||||
buffer_set_surface(canvas_buffer, drawing_surface, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
static attributeSerialize = function() {
|
static attributeSerialize = function() {
|
||||||
var _attr = {
|
attributes.canvas = surface_encode(canvas_surface);
|
||||||
canvas: buffer_from_surface(canvas_surface)
|
|
||||||
};
|
|
||||||
|
|
||||||
return _attr;
|
return attributes;
|
||||||
}
|
}
|
||||||
|
|
||||||
static attributeDeserialize = function(attr) {
|
static attributeDeserialize = function(attr) {
|
||||||
var _canv = struct_try_get(attr, "canvas", noone);
|
var _canv = struct_try_get(attr, "canvas", noone);
|
||||||
|
|
||||||
if(_canv) {
|
if(_canv != noone) {
|
||||||
surface_free_safe(canvas_surface);
|
surface_free_safe(canvas_surface);
|
||||||
canvas_surface = surface_from_buffer(_canv);
|
canvas_surface = surface_decode(_canv);
|
||||||
|
|
||||||
|
var _dim = surface_get_dimension(canvas_surface);
|
||||||
|
buffer_delete_safe(canvas_buffer);
|
||||||
|
canvas_buffer = buffer_from_surface(canvas_surface, false, buffer_grow);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,9 +1,11 @@
|
||||||
function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
||||||
name = "Tileset";
|
name = "Tileset";
|
||||||
|
min_h = 128;
|
||||||
|
bypass_grid = true;
|
||||||
|
|
||||||
renaming = noone;
|
renaming = noone;
|
||||||
rename_text = "";
|
rename_text = "";
|
||||||
tb_rename = new textBox(TEXTBOX_INPUT.text, function(_name) {
|
tb_rename = new textBox(TEXTBOX_INPUT.text, function(_name) {
|
||||||
if(renaming == noone) return;
|
if(renaming == noone) return;
|
||||||
renaming.name = _name;
|
renaming.name = _name;
|
||||||
renaming = noone;
|
renaming = noone;
|
||||||
|
@ -39,7 +41,7 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
||||||
selecting_surface = noone;
|
selecting_surface = noone;
|
||||||
selecting_surface_tile = noone;
|
selecting_surface_tile = noone;
|
||||||
|
|
||||||
autotile_selector_mask = 0;
|
autoterrain_selector_mask = 0;
|
||||||
|
|
||||||
grid_draw = true;
|
grid_draw = true;
|
||||||
brush = new tiler_brush(self);
|
brush = new tiler_brush(self);
|
||||||
|
@ -90,7 +92,7 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
||||||
draw_sprite_stretched_ext(THEME.ui_panel_bg, 1, _x, _yy, _w, _tsh, COLORS.node_composite_bg_blend, 1);
|
draw_sprite_stretched_ext(THEME.ui_panel_bg, 1, _x, _yy, _w, _tsh, COLORS.node_composite_bg_blend, 1);
|
||||||
tile_selector_surface = surface_verify(tile_selector_surface, _sw, _sh);
|
tile_selector_surface = surface_verify(tile_selector_surface, _sw, _sh);
|
||||||
tile_selector_mask = surface_verify(tile_selector_mask, _sw, _sh);
|
tile_selector_mask = surface_verify(tile_selector_mask, _sw, _sh);
|
||||||
autotile_selector_mask = surface_verify(autotile_selector_mask, _sw, _sh);
|
autoterrain_selector_mask = surface_verify(autoterrain_selector_mask, _sw, _sh);
|
||||||
|
|
||||||
if(!is_surface(_tileSet)) return _h;
|
if(!is_surface(_tileSet)) return _h;
|
||||||
var _tdim = surface_get_dimension(_tileSet);
|
var _tdim = surface_get_dimension(_tileSet);
|
||||||
|
@ -156,18 +158,18 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
||||||
draw_rectangle_width(_tileHov_x, _tileHov_y, _tileHov_x + _tileSel_w - 1, _tileHov_y + _tileSel_h - 1, 1);
|
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(mouse_press(mb_left, _focus)) {
|
||||||
if(autotile_subtile_selecting == noone) {
|
if(autoterrain_subtile_selecting == noone) {
|
||||||
autotile_selecting = noone;
|
autoterrain_selecting = noone;
|
||||||
animated_selecting = noone;
|
animated_selecting = noone;
|
||||||
|
|
||||||
tile_selecting = true;
|
tile_selecting = true;
|
||||||
tile_select_ss = [ _mtx, _mty ];
|
tile_select_ss = [ _mtx, _mty ];
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
autotiles[autotile_selecting].index[autotile_subtile_selecting] = _mid;
|
autoterrain[autoterrain_selecting].index[autoterrain_subtile_selecting] = _mid;
|
||||||
autotile_subtile_selecting++;
|
autoterrain_subtile_selecting++;
|
||||||
if(autotile_subtile_selecting >= array_length(autotiles[autotile_selecting].index))
|
if(autoterrain_subtile_selecting >= array_length(autoterrain[autoterrain_selecting].index))
|
||||||
autotile_subtile_selecting = noone;
|
autoterrain_subtile_selecting = noone;
|
||||||
}
|
}
|
||||||
|
|
||||||
palette_using = false;
|
palette_using = false;
|
||||||
|
@ -275,10 +277,10 @@ 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);
|
draw_surface_ext(tile_selector_mask, _sx, _sy, 1, 1, 0, _cc, 1);
|
||||||
shader_reset();
|
shader_reset();
|
||||||
|
|
||||||
if(autotile_selecting != noone) { // autotile
|
if(autoterrain_selecting != noone) { // autoterrain
|
||||||
var _att = autotiles[autotile_selecting];
|
var _att = autoterrain[autoterrain_selecting];
|
||||||
|
|
||||||
surface_set_target(autotile_selector_mask);
|
surface_set_target(autoterrain_selector_mask);
|
||||||
DRAW_CLEAR
|
DRAW_CLEAR
|
||||||
|
|
||||||
draw_set_color(c_white);
|
draw_set_color(c_white);
|
||||||
|
@ -294,7 +296,7 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
||||||
|
|
||||||
shader_set(sh_brush_outline);
|
shader_set(sh_brush_outline);
|
||||||
shader_set_f("dimension", _sw, _sh);
|
shader_set_f("dimension", _sw, _sh);
|
||||||
draw_surface_ext(autotile_selector_mask, _sx, _sy, 1, 1, 0, COLORS._main_accent, 1);
|
draw_surface_ext(autoterrain_selector_mask, _sx, _sy, 1, 1, 0, COLORS._main_accent, 1);
|
||||||
shader_reset();
|
shader_reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -368,15 +370,15 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
||||||
});
|
});
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region ++++ auto tile ++++
|
#region ++++ auto terrain ++++
|
||||||
autotiles = [];
|
autoterrain = [];
|
||||||
|
|
||||||
autotile_selecting = noone;
|
autoterrain_selecting = noone;
|
||||||
autotile_selector_h = 0;
|
autoterrain_selector_h = 0;
|
||||||
|
|
||||||
autotile_subtile_selecting = noone;
|
autoterrain_subtile_selecting = noone;
|
||||||
|
|
||||||
autotile_selector = new Inspector_Custom_Renderer(function(_x, _y, _w, _m, _hover, _focus, _panel = noone) {
|
autoterrain_selector = new Inspector_Custom_Renderer(function(_x, _y, _w, _m, _hover, _focus, _panel = noone) {
|
||||||
var _yy = _y;
|
var _yy = _y;
|
||||||
var _h = 0;
|
var _h = 0;
|
||||||
|
|
||||||
|
@ -393,12 +395,7 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
||||||
var _brush_tiles = brush.brush_width * brush.brush_height;
|
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 == 48 || _brush_tiles == 55);
|
||||||
|
|
||||||
if(!_fromSel) {
|
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) {
|
||||||
draw_sprite_uniform(THEME.add_16, 0, bx + bs / 2, by + bs / 2, 1, COLORS._main_icon);
|
|
||||||
if(_hover && point_in_rectangle(_m[0], _m[1], bx, by, bx + bs, by + bs))
|
|
||||||
TOOLTIP = "Select region with valid size for autotiling (3x3, 5x3, 12x4, 11x5).";
|
|
||||||
|
|
||||||
} else if(buttonInstant(THEME.button_hide, bx, by, bs, bs, _m, _focus, _hover, "New autotile from selection", THEME.add_16, 0, COLORS._main_value_positive) == 2) {
|
|
||||||
var _new_at = noone;
|
var _new_at = noone;
|
||||||
var _indx = array_create(brush.brush_width * brush.brush_height);
|
var _indx = array_create(brush.brush_width * brush.brush_height);
|
||||||
|
|
||||||
|
@ -406,16 +403,17 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
||||||
for( var j = 0, m = brush.brush_width; j < m; j++ )
|
for( var j = 0, m = brush.brush_width; j < m; j++ )
|
||||||
_indx[i * brush.brush_width + j] = brush.brush_indices[i][j][0];
|
_indx[i * brush.brush_width + j] = brush.brush_indices[i][j][0];
|
||||||
|
|
||||||
if(_brush_tiles == 9) _new_at = new tiler_brush_autotile(AUTOTILE_TYPE.box9, _indx);
|
if(_brush_tiles == 9) _new_at = new tiler_brush_autoterrain(AUTOTERRAIN_TYPE.box9, _indx);
|
||||||
else if(_brush_tiles == 15) _new_at = new tiler_brush_autotile(AUTOTILE_TYPE.side15, _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_autotile(AUTOTILE_TYPE.top48, _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_autotile(AUTOTILE_TYPE.top55, _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);
|
||||||
|
|
||||||
if(_new_at != noone) {
|
autoterrain_selecting = array_length(autoterrain);
|
||||||
autotile_selecting = array_length(autotiles);
|
animated_selecting = noone;
|
||||||
animated_selecting = noone;
|
array_push(autoterrain, _new_at);
|
||||||
array_push(autotiles, _new_at);
|
|
||||||
|
|
||||||
|
if(!array_empty(_indx)) {
|
||||||
brush.brush_indices = [[ [ _new_at.index[0], 0 ] ]];
|
brush.brush_indices = [[ [ _new_at.index[0], 0 ] ]];
|
||||||
brush.brush_width = 1;
|
brush.brush_width = 1;
|
||||||
brush.brush_height = 1;
|
brush.brush_height = 1;
|
||||||
|
@ -429,13 +427,13 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
||||||
var _ah = _pd * 2;
|
var _ah = _pd * 2;
|
||||||
var del = -1;
|
var del = -1;
|
||||||
|
|
||||||
draw_sprite_stretched_ext(THEME.ui_panel_bg, 1, _x, _yy, _w, autotile_selector_h, COLORS.node_composite_bg_blend, 1);
|
draw_sprite_stretched_ext(THEME.ui_panel_bg, 1, _x, _yy, _w, autoterrain_selector_h, COLORS.node_composite_bg_blend, 1);
|
||||||
|
|
||||||
_yy += _pd;
|
_yy += _pd;
|
||||||
|
|
||||||
for( var i = 0, n = array_length(autotiles); i < n; i++ ) {
|
for( var i = 0, n = array_length(autoterrain); i < n; i++ ) {
|
||||||
var _hg = ui(32);
|
var _hg = ui(32);
|
||||||
var _at = autotiles[i];
|
var _at = autoterrain[i];
|
||||||
|
|
||||||
var _pw = ui(24);
|
var _pw = ui(24);
|
||||||
var _ph = ui(24);
|
var _ph = ui(24);
|
||||||
|
@ -447,6 +445,7 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
||||||
if(_prin == noone) {
|
if(_prin == noone) {
|
||||||
draw_set_color(COLORS._main_icon);
|
draw_set_color(COLORS._main_icon);
|
||||||
draw_rectangle(_px, _py, _px + _pw, _py + _ph, true);
|
draw_rectangle(_px, _py, _px + _pw, _py + _ph, true);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
var _prc = safe_mod(_prin, _tileAmo[0]);
|
var _prc = safe_mod(_prin, _tileAmo[0]);
|
||||||
var _prr = floor(_prin / _tileAmo[0]);
|
var _prr = floor(_prin / _tileAmo[0]);
|
||||||
|
@ -462,7 +461,7 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
||||||
|
|
||||||
var _tx = _px + _pw + ui(8);
|
var _tx = _px + _pw + ui(8);
|
||||||
var _hov = _hover && point_in_rectangle(_m[0], _m[1], _x, _yy, _x + _w, _yy + _hg - 1);
|
var _hov = _hover && point_in_rectangle(_m[0], _m[1], _x, _yy, _x + _w, _yy + _hg - 1);
|
||||||
var _cc = i == autotile_selecting? COLORS._main_accent : (_hov? COLORS._main_text : COLORS._main_text_sub);
|
var _cc = i == autoterrain_selecting? COLORS._main_accent : (_hov? COLORS._main_text : COLORS._main_text_sub);
|
||||||
|
|
||||||
if(renaming == _at) {
|
if(renaming == _at) {
|
||||||
tb_rename.setFocusHover(_focus, _hover);
|
tb_rename.setFocusHover(_focus, _hover);
|
||||||
|
@ -473,33 +472,36 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
||||||
draw_text_add(_tx, _yy + _hg / 2, _at.name);
|
draw_text_add(_tx, _yy + _hg / 2, _at.name);
|
||||||
|
|
||||||
var bs = ui(24);
|
var bs = ui(24);
|
||||||
var bx = _w - bs;
|
var bx = _w - bs - ui(4);
|
||||||
var by = _yy + _hg / 2 - bs / 2;
|
var by = _yy + _hg / 2 - bs / 2;
|
||||||
if(buttonInstant(THEME.button_hide, bx, by, bs, bs, _m, _focus, _hover, "", THEME.minus_16, 0, _hov? COLORS._main_value_negative : COLORS._main_icon) == 2)
|
if(buttonInstant(THEME.button_hide, bx, by, bs, bs, _m, _focus, _hover, "", THEME.minus_16, 0, _hov? COLORS._main_value_negative : COLORS._main_icon) == 2)
|
||||||
del = i;
|
del = i;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(_hov && _m[0] < _x + _w - ui(32)) {
|
if(_hov && _m[0] < _x + _w - ui(32)) {
|
||||||
if(DOUBLE_CLICK && _focus) {
|
if(_m[0] > _tx) {
|
||||||
renaming = _at;
|
if(DOUBLE_CLICK && _focus) {
|
||||||
rename_text = _at.name;
|
renaming = _at;
|
||||||
|
rename_text = _at.name;
|
||||||
|
|
||||||
tb_rename._current_text = _at.name;
|
tb_rename._current_text = _at.name;
|
||||||
tb_rename.activate();
|
tb_rename.activate();
|
||||||
|
|
||||||
} else if(mouse_press(mb_left, _focus)) {
|
} else if(mouse_press(mb_left, _focus)) {
|
||||||
if(_m[0] > _tx) {
|
autoterrain_selecting = autoterrain_selecting == i? noone : i;
|
||||||
autotile_selecting = autotile_selecting == i? noone : i;
|
|
||||||
animated_selecting = noone;
|
animated_selecting = noone;
|
||||||
|
|
||||||
brush.brush_indices = [[ [ _prin, 0 ] ]];
|
brush.brush_indices = [[ [ _prin, 0 ] ]];
|
||||||
brush.brush_width = 1;
|
brush.brush_width = 1;
|
||||||
brush.brush_height = 1;
|
brush.brush_height = 1;
|
||||||
palette_using = false;
|
palette_using = false;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
draw_set_color(COLORS._main_accent);
|
||||||
|
draw_rectangle(_px, _py, _px + _pw, _py + _ph, true);
|
||||||
|
|
||||||
} else {
|
if(mouse_press(mb_left, _focus))
|
||||||
_at.open = !_at.open;
|
_at.open = !_at.open;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -510,24 +512,36 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
||||||
_yy += ui(4);
|
_yy += ui(4);
|
||||||
_ah += ui(4);
|
_ah += ui(4);
|
||||||
|
|
||||||
|
var _atWid = _at.sc_type;
|
||||||
|
var _scx = _x + ui(8);
|
||||||
|
var _scy = _yy;
|
||||||
|
var _scw = ui(200);
|
||||||
|
var _sch = ui(24);
|
||||||
|
|
||||||
|
_atWid.setFocusHover(_focus, _hover);
|
||||||
|
_atWid.draw(_scx, _scy, _scw, _sch, _at.type, _m, autoterrain_selector.rx, autoterrain_selector.ry);
|
||||||
|
|
||||||
|
_yy += _sch + ui(8);
|
||||||
|
_ah += _sch + ui(8);
|
||||||
|
|
||||||
var _atIdx = _at.index;
|
var _atIdx = _at.index;
|
||||||
var _coll = floor(_w - ui(16)) / _tileSiz[0];
|
var _coll = floor(_w - ui(16)) / _tileSiz[0];
|
||||||
|
var _over = noone;
|
||||||
|
var _roww;
|
||||||
|
|
||||||
switch(_at.type) {
|
switch(_at.type) {
|
||||||
case AUTOTILE_TYPE.box9 : _coll = 3; break;
|
case AUTOTERRAIN_TYPE.box9 : _coll = 3; _roww = 3; _over = s_autoterrain_3x3; break;
|
||||||
case AUTOTILE_TYPE.side15 : _coll = 5; break;
|
case AUTOTERRAIN_TYPE.side15 : _coll = 5; _roww = 3; _over = s_autoterrain_5x3; break;
|
||||||
case AUTOTILE_TYPE.top48 : _coll = 8; break;
|
case AUTOTERRAIN_TYPE.top48 : _coll = 12; _roww = 4; _over = s_autoterrain_8x6; break;
|
||||||
case AUTOTILE_TYPE.top55 : _coll = 11; break;
|
case AUTOTERRAIN_TYPE.top55 : _coll = 11; _roww = 5; _over = s_autoterrain_11x5; break;
|
||||||
}
|
}
|
||||||
|
|
||||||
var _roww = ceil(array_length(_atIdx) / _coll);
|
|
||||||
|
|
||||||
var _pre_sx = _x + ui(8);
|
var _pre_sx = _x + ui(8);
|
||||||
var _pre_sy = _yy;
|
var _pre_sy = _yy;
|
||||||
var _pre_sw = _coll * _tileSiz[0];
|
var _pre_sw = _coll * _tileSiz[0];
|
||||||
var _pre_sh = _roww * _tileSiz[1];
|
var _pre_sh = _roww * _tileSiz[1];
|
||||||
|
|
||||||
var _ss = (_w - ui(16)) / _pre_sw;
|
var _ss = min((_w - ui(16)) / _pre_sw, ui(64) / _tileSiz[1]);
|
||||||
|
|
||||||
var _bw = power(2, ceil(log2(_coll)));
|
var _bw = power(2, ceil(log2(_coll)));
|
||||||
var _bh = power(2, ceil(log2(_roww)));
|
var _bh = power(2, ceil(log2(_roww)));
|
||||||
|
@ -547,8 +561,6 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
||||||
}
|
}
|
||||||
surface_reset_shader();
|
surface_reset_shader();
|
||||||
|
|
||||||
var _tileSetDim = surface_get_dimension(_tileSet);
|
|
||||||
|
|
||||||
surface_set_shader(_at.preview_surface_tile, sh_draw_tile_map, true, BLEND.over);
|
surface_set_shader(_at.preview_surface_tile, sh_draw_tile_map, true, BLEND.over);
|
||||||
shader_set_2("dimension", surface_get_dimension(_at.preview_surface_tile));
|
shader_set_2("dimension", surface_get_dimension(_at.preview_surface_tile));
|
||||||
|
|
||||||
|
@ -560,8 +572,35 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
||||||
draw_empty();
|
draw_empty();
|
||||||
surface_reset_shader();
|
surface_reset_shader();
|
||||||
|
|
||||||
|
if(_over != noone) draw_sprite_ext(_over, 0, _pre_sx, _pre_sy, _ss * _tileSiz[0] / 4, _ss * _tileSiz[1] / 4, 0, COLORS._main_icon, 0.5);
|
||||||
draw_surface_ext(_at.preview_surface_tile, _pre_sx, _pre_sy, _ss, _ss, 0, c_white, 1);
|
draw_surface_ext(_at.preview_surface_tile, _pre_sx, _pre_sy, _ss, _ss, 0, c_white, 1);
|
||||||
|
|
||||||
|
if(grid_draw) {
|
||||||
|
var _gw = _tileSiz[0] * _ss;
|
||||||
|
var _gh = _tileSiz[1] * _ss;
|
||||||
|
|
||||||
|
var gw = _pre_sw / _tileSiz[0];
|
||||||
|
var gh = _pre_sh / _tileSiz[1];
|
||||||
|
|
||||||
|
var cx = _pre_sx - 1;
|
||||||
|
var cy = _pre_sy - 1;
|
||||||
|
|
||||||
|
draw_set_color(PROJECT.previewGrid.color);
|
||||||
|
draw_set_alpha(PROJECT.previewGrid.opacity);
|
||||||
|
|
||||||
|
for( var j = 1; j < gw; j++ ) {
|
||||||
|
var _lxx = cx + j * _gw;
|
||||||
|
draw_line(_lxx, cy, _lxx, cy + _pre_sh * _ss);
|
||||||
|
}
|
||||||
|
|
||||||
|
for( var j = 1; j < gh; j++ ) {
|
||||||
|
var _lyy = cy + j * _gh;
|
||||||
|
draw_line(cx, _lyy, cx + _pre_sw * _ss, _lyy);
|
||||||
|
}
|
||||||
|
|
||||||
|
draw_set_alpha(1);
|
||||||
|
}
|
||||||
|
|
||||||
draw_set_color(COLORS._main_icon);
|
draw_set_color(COLORS._main_icon);
|
||||||
draw_rectangle(_pre_sx, _pre_sy, _pre_sx + _pre_sw * _ss, _pre_sy + _pre_sh * _ss, true);
|
draw_rectangle(_pre_sx, _pre_sy, _pre_sx + _pre_sw * _ss, _pre_sy + _pre_sh * _ss, true);
|
||||||
|
|
||||||
|
@ -581,9 +620,9 @@ 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);
|
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)) {
|
if(mouse_press(mb_left, _focus)) {
|
||||||
autotile_selecting = i;
|
autoterrain_selecting = i;
|
||||||
animated_selecting = noone;
|
animated_selecting = noone;
|
||||||
autotile_subtile_selecting = autotile_subtile_selecting == _at_id? noone : _at_id;
|
autoterrain_subtile_selecting = autoterrain_subtile_selecting == _at_id? noone : _at_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(mouse_press(mb_right, _focus))
|
if(mouse_press(mb_right, _focus))
|
||||||
|
@ -591,9 +630,9 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(autotile_selecting == i && autotile_subtile_selecting != noone) {
|
if(autoterrain_selecting == i && autoterrain_subtile_selecting != noone) {
|
||||||
var _at_sl_x = autotile_subtile_selecting % _coll;
|
var _at_sl_x = autoterrain_subtile_selecting % _coll;
|
||||||
var _at_sl_y = floor(autotile_subtile_selecting / _coll);
|
var _at_sl_y = floor(autoterrain_subtile_selecting / _coll);
|
||||||
|
|
||||||
var _at_c_sx = _pre_sx + _at_sl_x * _dtile_w;
|
var _at_c_sx = _pre_sx + _at_sl_x * _dtile_w;
|
||||||
var _at_c_sy = _pre_sy + _at_sl_y * _dtile_h;
|
var _at_c_sy = _pre_sy + _at_sl_y * _dtile_h;
|
||||||
|
@ -609,11 +648,11 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
||||||
}
|
}
|
||||||
|
|
||||||
if(del != -1) {
|
if(del != -1) {
|
||||||
array_delete(autotiles, del, 1);
|
array_delete(autoterrain, del, 1);
|
||||||
autotile_selecting = noone;
|
autoterrain_selecting = noone;
|
||||||
}
|
}
|
||||||
|
|
||||||
autotile_selector_h = max(ui(12), _ah);
|
autoterrain_selector_h = max(ui(12), _ah);
|
||||||
return _h + _ah;
|
return _h + _ah;
|
||||||
});
|
});
|
||||||
#endregion
|
#endregion
|
||||||
|
@ -621,7 +660,7 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
||||||
#region ++++ brush palette ++++
|
#region ++++ brush palette ++++
|
||||||
brush_palette_h = ui(320);
|
brush_palette_h = ui(320);
|
||||||
|
|
||||||
brush_palette = surface_create(16, 16, surface_rgba16float);
|
brush_palette = surface_create(64, 64, surface_rgba16float);
|
||||||
brush_palette_buffer = noone;
|
brush_palette_buffer = noone;
|
||||||
brush_palette_tile = noone;
|
brush_palette_tile = noone;
|
||||||
brush_palette_prev = noone;
|
brush_palette_prev = noone;
|
||||||
|
@ -707,7 +746,7 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
||||||
if(brush_palette_buffer && buffer_exists(brush_palette_buffer))
|
if(brush_palette_buffer && buffer_exists(brush_palette_buffer))
|
||||||
brush_palette = surface_from_buffer(brush_palette_buffer);
|
brush_palette = surface_from_buffer(brush_palette_buffer);
|
||||||
else
|
else
|
||||||
brush_palette = surface_create(16, 16, surface_rgba16float);
|
brush_palette = surface_create(64, 64, surface_rgba16float);
|
||||||
}
|
}
|
||||||
|
|
||||||
var _bpdim = surface_get_dimension(brush_palette);
|
var _bpdim = surface_get_dimension(brush_palette);
|
||||||
|
@ -765,8 +804,8 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
||||||
var gw = _tdim[0] / _tileSiz[0];
|
var gw = _tdim[0] / _tileSiz[0];
|
||||||
var gh = _tdim[1] / _tileSiz[1];
|
var gh = _tdim[1] / _tileSiz[1];
|
||||||
|
|
||||||
var cx = palette_selector_x;
|
var cx = palette_selector_x - 1;
|
||||||
var cy = palette_selector_y;
|
var cy = palette_selector_y - 1;
|
||||||
|
|
||||||
draw_set_color(PROJECT.previewGrid.color);
|
draw_set_color(PROJECT.previewGrid.color);
|
||||||
draw_set_alpha(PROJECT.previewGrid.opacity);
|
draw_set_alpha(PROJECT.previewGrid.opacity);
|
||||||
|
@ -798,7 +837,7 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
||||||
}
|
}
|
||||||
|
|
||||||
if(palette_tool == 0 && mouse_press(mb_left, _focus)) {
|
if(palette_tool == 0 && mouse_press(mb_left, _focus)) {
|
||||||
autotile_selecting = noone;
|
autoterrain_selecting = noone;
|
||||||
animated_selecting = noone;
|
animated_selecting = noone;
|
||||||
palette_selecting = true;
|
palette_selecting = true;
|
||||||
palette_using = true;
|
palette_using = true;
|
||||||
|
@ -1074,7 +1113,7 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
||||||
|
|
||||||
if(_new_at != noone) {
|
if(_new_at != noone) {
|
||||||
animated_selecting = array_length(animatedTiles);
|
animated_selecting = array_length(animatedTiles);
|
||||||
autotile_selecting = noone;
|
autoterrain_selecting = noone;
|
||||||
array_push(animatedTiles, _new_at);
|
array_push(animatedTiles, _new_at);
|
||||||
|
|
||||||
brush.brush_indices = [[ [ -(animated_selecting + 2), 0 ] ]];
|
brush.brush_indices = [[ [ -(animated_selecting + 2), 0 ] ]];
|
||||||
|
@ -1137,7 +1176,7 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
||||||
draw_text_add(_tx, _yy + _hg / 2, _at.name);
|
draw_text_add(_tx, _yy + _hg / 2, _at.name);
|
||||||
|
|
||||||
var bs = ui(24);
|
var bs = ui(24);
|
||||||
var bx = _w - bs;
|
var bx = _w - bs - ui(4);
|
||||||
var by = _yy + _hg / 2 - bs / 2;
|
var by = _yy + _hg / 2 - bs / 2;
|
||||||
if(buttonInstant(THEME.button_hide, bx, by, bs, bs, _m, _focus, _hover, "", THEME.minus_16, 0, _hov? COLORS._main_value_negative : COLORS._main_icon) == 2)
|
if(buttonInstant(THEME.button_hide, bx, by, bs, bs, _m, _focus, _hover, "", THEME.minus_16, 0, _hov? COLORS._main_value_negative : COLORS._main_icon) == 2)
|
||||||
del = i;
|
del = i;
|
||||||
|
@ -1154,7 +1193,7 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
||||||
} else if(mouse_press(mb_left, _focus)) {
|
} else if(mouse_press(mb_left, _focus)) {
|
||||||
if(_m[0] > _tx) {
|
if(_m[0] > _tx) {
|
||||||
animated_selecting = animated_selecting == i? noone : i;
|
animated_selecting = animated_selecting == i? noone : i;
|
||||||
autotile_selecting = noone;
|
autoterrain_selecting = noone;
|
||||||
|
|
||||||
brush.brush_indices = [[ [ - (i + 2), 0 ] ]];
|
brush.brush_indices = [[ [ - (i + 2), 0 ] ]];
|
||||||
brush.brush_width = 1;
|
brush.brush_width = 1;
|
||||||
|
@ -1238,7 +1277,7 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
||||||
|
|
||||||
if(mouse_press(mb_left, _focus)) {
|
if(mouse_press(mb_left, _focus)) {
|
||||||
animated_selecting = i;
|
animated_selecting = i;
|
||||||
autotile_selecting = noone;
|
autoterrain_selecting = noone;
|
||||||
|
|
||||||
animated_subtile_selecting = animated_subtile_selecting == _at_id? noone : _at_id;
|
animated_subtile_selecting = animated_subtile_selecting == _at_id? noone : _at_id;
|
||||||
}
|
}
|
||||||
|
@ -1276,19 +1315,139 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
||||||
});
|
});
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region ++++ rules ++++
|
||||||
|
ruleTiles = [];
|
||||||
|
|
||||||
|
rule_selecting = noone;
|
||||||
|
rule_selector_h = 0;
|
||||||
|
rule_subtile_selecting = noone;
|
||||||
|
|
||||||
|
rules_viewer = new Inspector_Custom_Renderer(function(_x, _y, _w, _m, _hover, _focus, _panel = noone) {
|
||||||
|
var _yy = _y;
|
||||||
|
var _h = 0;
|
||||||
|
|
||||||
|
var _tileSet = getInputData(0);
|
||||||
|
var _tileSiz = getInputData(1);
|
||||||
|
|
||||||
|
if(!is_surface(_tileSet)) return _h;
|
||||||
|
var _tdim = surface_get_dimension(_tileSet);
|
||||||
|
var _tileAmo = [ floor(_tdim[0] / _tileSiz[0]), floor(_tdim[1] / _tileSiz[1]) ];
|
||||||
|
|
||||||
|
var bx = _x;
|
||||||
|
var by = _yy;
|
||||||
|
var bs = ui(24);
|
||||||
|
|
||||||
|
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();
|
||||||
|
array_push(ruleTiles, _new_rl);
|
||||||
|
}
|
||||||
|
|
||||||
|
_h += bs + ui(4);
|
||||||
|
_yy += bs + ui(4);
|
||||||
|
|
||||||
|
var _pd = ui(4);
|
||||||
|
var _ah = _pd * 2;
|
||||||
|
var del = -1;
|
||||||
|
|
||||||
|
draw_sprite_stretched_ext(THEME.ui_panel_bg, 1, _x, _yy, _w, rule_selector_h, COLORS.node_composite_bg_blend, 1);
|
||||||
|
|
||||||
|
_yy += _pd;
|
||||||
|
|
||||||
|
for( var i = 0, n = array_length(ruleTiles); i < n; i++ ) {
|
||||||
|
var _hg = ui(32);
|
||||||
|
var _rl = ruleTiles[i];
|
||||||
|
|
||||||
|
var _pw = ui(24);
|
||||||
|
var _ph = ui(24);
|
||||||
|
var _px = _x + ui(8);
|
||||||
|
var _py = _yy + ui(4);
|
||||||
|
|
||||||
|
var _prin = 0;
|
||||||
|
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
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 {
|
||||||
|
draw_set_text(f_p2, fa_left, fa_center, _cc);
|
||||||
|
draw_text_add(_tx, _yy + _hg / 2, _rl.name);
|
||||||
|
|
||||||
|
var bs = ui(24);
|
||||||
|
var bx = _w - bs - ui(4);
|
||||||
|
var by = _yy + _hg / 2 - bs / 2;
|
||||||
|
if(buttonInstant(THEME.button_hide, bx, by, bs, bs, _m, _focus, _hover, "", THEME.minus_16, 0, _hov? COLORS._main_value_negative : COLORS._main_icon) == 2)
|
||||||
|
del = i;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(_hov && _m[0] < _x + _w - ui(32)) {
|
||||||
|
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 {
|
||||||
|
_rl.open = !_rl.open;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_yy += _hg;
|
||||||
|
_ah += _hg;
|
||||||
|
|
||||||
|
if(_at.open) {
|
||||||
|
_yy += ui(4);
|
||||||
|
_ah += ui(4);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(del != -1) array_delete(ruleTiles, del, 1);
|
||||||
|
|
||||||
|
rule_selector_h = max(ui(12), _ah);
|
||||||
|
return _h + _ah;
|
||||||
|
});
|
||||||
|
#endregion
|
||||||
|
|
||||||
texture = noone;
|
texture = noone;
|
||||||
tileSize = [ 1, 1 ];
|
tileSize = [ 1, 1 ];
|
||||||
|
|
||||||
tile_selector_toggler = button(function() /*=>*/ { tile_selector.togglePopup("Tileset"); }).setIcon(THEME.node_goto, 0, COLORS._main_icon, .75);
|
tile_selector_toggler = button(function() /*=>*/ { tile_selector.togglePopup("Tileset"); }).setIcon(THEME.node_goto, 0, COLORS._main_icon, .75);
|
||||||
autotile_selector_toggler = button(function() /*=>*/ { autotile_selector.togglePopup("Autotile"); }).setIcon(THEME.node_goto, 0, COLORS._main_icon, .75);
|
autoterrain_selector_toggler = button(function() /*=>*/ { autoterrain_selector.togglePopup("Autoterrain"); }).setIcon(THEME.node_goto, 0, COLORS._main_icon, .75);
|
||||||
palette_viewer_toggler = button(function() /*=>*/ { palette_viewer.togglePopup("Tile Palette"); }).setIcon(THEME.node_goto, 0, COLORS._main_icon, .75);
|
palette_viewer_toggler = button(function() /*=>*/ { palette_viewer.togglePopup("Tile Palette"); }).setIcon(THEME.node_goto, 0, COLORS._main_icon, .75);
|
||||||
animated_viewer_toggler = button(function() /*=>*/ { animated_viewer.togglePopup("Animated Tile"); }).setIcon(THEME.node_goto, 0, COLORS._main_icon, .75);
|
animated_viewer_toggler = button(function() /*=>*/ { animated_viewer.togglePopup("Animated Tile"); }).setIcon(THEME.node_goto, 0, COLORS._main_icon, .75);
|
||||||
|
rules_viewer_toggler = button(function() /*=>*/ { rules_viewer.togglePopup("Tile Riles"); }).setIcon(THEME.node_goto, 0, COLORS._main_icon, .75);
|
||||||
|
|
||||||
input_display_list = [ 1, 0,
|
input_display_list = [ 1, 0,
|
||||||
["Tileset", false, noone, tile_selector_toggler ], tile_selector,
|
["Tileset", false, noone, tile_selector_toggler ], tile_selector,
|
||||||
["Autotiles", true, noone, autotile_selector_toggler ], autotile_selector,
|
["Autoterrain", true, noone, autoterrain_selector_toggler ], autoterrain_selector,
|
||||||
["Palette", true, noone, palette_viewer_toggler ], palette_viewer,
|
["Palette", true, noone, palette_viewer_toggler ], palette_viewer,
|
||||||
["Animated", true, 2, animated_viewer_toggler ], animated_viewer,
|
["Animated", true, 2, animated_viewer_toggler ], animated_viewer,
|
||||||
|
["Rules", true, noone, rules_viewer_toggler ], rules_viewer,
|
||||||
];
|
];
|
||||||
|
|
||||||
static shader_submit = function() {
|
static shader_submit = function() {
|
||||||
|
@ -1303,10 +1462,11 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
||||||
}
|
}
|
||||||
|
|
||||||
static step = function() {
|
static step = function() {
|
||||||
tile_selector_toggler.icon_blend = tile_selector.popupPanel == noone? COLORS._main_icon : COLORS._main_accent;
|
tile_selector_toggler.icon_blend = tile_selector.popupPanel == noone? COLORS._main_icon : COLORS._main_accent;
|
||||||
autotile_selector_toggler.icon_blend = autotile_selector.popupPanel == noone? COLORS._main_icon : COLORS._main_accent;
|
autoterrain_selector_toggler.icon_blend = autoterrain_selector.popupPanel == noone? COLORS._main_icon : COLORS._main_accent;
|
||||||
palette_viewer_toggler.icon_blend = palette_viewer.popupPanel == noone? COLORS._main_icon : COLORS._main_accent;
|
palette_viewer_toggler.icon_blend = palette_viewer.popupPanel == noone? COLORS._main_icon : COLORS._main_accent;
|
||||||
animated_viewer_toggler.icon_blend = animated_viewer.popupPanel == noone? COLORS._main_icon : COLORS._main_accent;
|
animated_viewer_toggler.icon_blend = animated_viewer.popupPanel == noone? COLORS._main_icon : COLORS._main_accent;
|
||||||
|
rules_viewer_toggler.icon_blend = rules_viewer.popupPanel == noone? COLORS._main_icon : COLORS._main_accent;
|
||||||
}
|
}
|
||||||
|
|
||||||
static update = function(frame = CURRENT_FRAME) {
|
static update = function(frame = CURRENT_FRAME) {
|
||||||
|
@ -1321,21 +1481,24 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
||||||
|
|
||||||
static attributeSerialize = function() {
|
static attributeSerialize = function() {
|
||||||
var _attr = {
|
var _attr = {
|
||||||
autotiles, animatedTiles,
|
autoterrain,
|
||||||
palette: buffer_from_surface(brush_palette),
|
animatedTiles,
|
||||||
|
ruleTiles,
|
||||||
|
palette: surface_encode(brush_palette),
|
||||||
};
|
};
|
||||||
|
|
||||||
return _attr;
|
return _attr;
|
||||||
}
|
}
|
||||||
|
|
||||||
static attributeDeserialize = function(attr) {
|
static attributeDeserialize = function(attr) {
|
||||||
var _auto = struct_try_get(attr, "autotiles", []);
|
var _auto = struct_try_get(attr, "autoterrain", []);
|
||||||
var _anim = struct_try_get(attr, "animatedTiles", []);
|
var _anim = struct_try_get(attr, "animatedTiles", []);
|
||||||
var _palt = struct_try_get(attr, "palette", noone);
|
var _rule = struct_try_get(attr, "ruleTiles", []);
|
||||||
|
var _palt = struct_try_get(attr, "palette", noone);
|
||||||
|
|
||||||
for( var i = 0, n = array_length(_auto); i < n; i++ ) {
|
for( var i = 0, n = array_length(_auto); i < n; i++ ) {
|
||||||
autotiles[i] = new tiler_brush_autotile(_auto[i].type, _auto[i].index);
|
autoterrain[i] = new tiler_brush_autoterrain(_auto[i].type, _auto[i].index);
|
||||||
autotiles[i].name = _auto[i].name;
|
autoterrain[i].name = _auto[i].name;
|
||||||
}
|
}
|
||||||
|
|
||||||
for( var i = 0, n = array_length(_anim); i < n; i++ ) {
|
for( var i = 0, n = array_length(_anim); i < n; i++ ) {
|
||||||
|
@ -1343,12 +1506,19 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
||||||
animatedTiles[i].name = _anim[i].name;
|
animatedTiles[i].name = _anim[i].name;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(_palt) {
|
for( var i = 0, n = array_length(_rule); i < n; i++ )
|
||||||
|
ruleTiles[i] = new tiler_rule().deserialize(_rule[i]);
|
||||||
|
|
||||||
|
if(_palt != noone) {
|
||||||
surface_free_safe(brush_palette);
|
surface_free_safe(brush_palette);
|
||||||
brush_palette_buffer = _palt;
|
brush_palette = surface_decode(_palt);
|
||||||
brush_palette = surface_from_buffer(_palt);
|
|
||||||
|
var _dim = surface_get_dimension(brush_palette);
|
||||||
|
buffer_delete_safe(brush_palette_buffer);
|
||||||
|
brush_palette_buffer = buffer_from_surface(brush_palette, false, buffer_grow);
|
||||||
}
|
}
|
||||||
|
|
||||||
refreshAnimatedData();
|
refreshAnimatedData();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -982,6 +982,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case VALUE_TYPE.pathnode :
|
case VALUE_TYPE.pathnode :
|
||||||
|
editWidget = new pathnodeBox(self);
|
||||||
extract_node = "Node_Path";
|
extract_node = "Node_Path";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -991,6 +992,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
|
||||||
|
|
||||||
case VALUE_TYPE.tileset :
|
case VALUE_TYPE.tileset :
|
||||||
editWidget = new tilesetBox(self);
|
editWidget = new tilesetBox(self);
|
||||||
|
extract_node = "Node_Tile_Tileset";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case VALUE_TYPE.particle :
|
case VALUE_TYPE.particle :
|
||||||
|
@ -1827,42 +1829,52 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
|
||||||
} updateColor();
|
} updateColor();
|
||||||
|
|
||||||
static drawOverlay = function(hover, active, _x, _y, _s, _mx, _my, _snx, _sny) {
|
static drawOverlay = function(hover, active, _x, _y, _s, _mx, _my, _snx, _sny) {
|
||||||
if(type != VALUE_TYPE.integer && type != VALUE_TYPE.float) return -1;
|
|
||||||
if(value_from != noone) return -1;
|
|
||||||
if(expUse) return -1;
|
if(expUse) return -1;
|
||||||
|
|
||||||
var arc = 9;
|
var arc = 9;
|
||||||
|
|
||||||
switch(display_type) {
|
switch(type) {
|
||||||
case VALUE_DISPLAY._default :
|
case VALUE_TYPE.integer :
|
||||||
case VALUE_DISPLAY.slider :
|
case VALUE_TYPE.float :
|
||||||
var _angle = argument_count > arc + 0? argument[arc + 0] : 0;
|
if(value_from != noone) return -1;
|
||||||
var _scale = argument_count > arc + 1? argument[arc + 1] : 1;
|
switch(display_type) {
|
||||||
var _spr = argument_count > arc + 2? argument[arc + 2] : 0;
|
case VALUE_DISPLAY._default :
|
||||||
return preview_overlay_scalar(hover, active, _x, _y, _s, _mx, _my, _snx, _sny, _angle, _scale, _spr);
|
case VALUE_DISPLAY.slider :
|
||||||
|
var _angle = argument_count > arc + 0? argument[arc + 0] : 0;
|
||||||
|
var _scale = argument_count > arc + 1? argument[arc + 1] : 1;
|
||||||
|
var _spr = argument_count > arc + 2? argument[arc + 2] : 0;
|
||||||
|
return preview_overlay_scalar(hover, active, _x, _y, _s, _mx, _my, _snx, _sny, _angle, _scale, _spr);
|
||||||
|
|
||||||
case VALUE_DISPLAY.rotation :
|
case VALUE_DISPLAY.rotation :
|
||||||
var _rad = argument_count > arc + 0? argument[ arc + 0] : 64;
|
var _rad = argument_count > arc + 0? argument[ arc + 0] : 64;
|
||||||
return preview_overlay_rotation(hover, active, _x, _y, _s, _mx, _my, _snx, _sny, _rad);
|
return preview_overlay_rotation(hover, active, _x, _y, _s, _mx, _my, _snx, _sny, _rad);
|
||||||
|
|
||||||
case VALUE_DISPLAY.vector :
|
case VALUE_DISPLAY.vector :
|
||||||
var _typ = argument_count > arc + 0? argument[arc + 0] : 0;
|
var _typ = argument_count > arc + 0? argument[arc + 0] : 0;
|
||||||
var _sca = argument_count > arc + 1? argument[arc + 1] : 1;
|
var _sca = argument_count > arc + 1? argument[arc + 1] : 1;
|
||||||
return preview_overlay_vector(hover, active, _x, _y, _s, _mx, _my, _snx, _sny, _typ);
|
return preview_overlay_vector(hover, active, _x, _y, _s, _mx, _my, _snx, _sny, _typ);
|
||||||
|
|
||||||
case VALUE_DISPLAY.gradient_range :
|
case VALUE_DISPLAY.gradient_range :
|
||||||
var _dim = argument[arc];
|
var _dim = argument[arc];
|
||||||
|
|
||||||
if(mappedJunc.attributes.mapped)
|
if(mappedJunc.attributes.mapped)
|
||||||
return preview_overlay_gradient_range(hover, active, _x, _y, _s, _mx, _my, _snx, _sny, _dim);
|
return preview_overlay_gradient_range(hover, active, _x, _y, _s, _mx, _my, _snx, _sny, _dim);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case VALUE_DISPLAY.area :
|
||||||
|
var _flag = argument_count > arc + 0? argument[arc + 0] : 0b0011;
|
||||||
|
return preview_overlay_area(hover, active, _x, _y, _s, _mx, _my, _snx, _sny, _flag, struct_try_get(display_data, "onSurfaceSize"));
|
||||||
|
|
||||||
|
case VALUE_DISPLAY.puppet_control :
|
||||||
|
return preview_overlay_puppet(hover, active, _x, _y, _s, _mx, _my, _snx, _sny);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case VALUE_DISPLAY.area :
|
case VALUE_TYPE.pathnode :
|
||||||
var _flag = argument_count > arc + 0? argument[arc + 0] : 0b0011;
|
var _path = getValue();
|
||||||
return preview_overlay_area(hover, active, _x, _y, _s, _mx, _my, _snx, _sny, _flag, struct_try_get(display_data, "onSurfaceSize"));
|
if(struct_has(_path, "drawOverlay"))
|
||||||
|
return _path.drawOverlay(hover, active, _x, _y, _s, _mx, _my, _snx, _sny);
|
||||||
case VALUE_DISPLAY.puppet_control :
|
break;
|
||||||
return preview_overlay_puppet(hover, active, _x, _y, _s, _mx, _my, _snx, _sny);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
|
@ -7,7 +7,7 @@ function __NodeValue_Int(_name, _node, _value, _tooltip = "") : NodeValue(_name,
|
||||||
static valueProcess = function(value, nodeFrom = undefined, applyUnit = true, arrIndex = 0) {
|
static valueProcess = function(value, nodeFrom = undefined, applyUnit = true, arrIndex = 0) {
|
||||||
if(validator != noone) value = validator.validate(value);
|
if(validator != noone) value = validator.validate(value);
|
||||||
value = applyUnit? unit.apply(value, arrIndex) : value;
|
value = applyUnit? unit.apply(value, arrIndex) : value;
|
||||||
return round(value);
|
return is_real(value)? round(value) : value;
|
||||||
}
|
}
|
||||||
|
|
||||||
static getValue = function(_time = CURRENT_FRAME, applyUnit = true, arrIndex = 0, useCache = false, log = false) { //// Get value
|
static getValue = function(_time = CURRENT_FRAME, applyUnit = true, arrIndex = 0, useCache = false, log = false) { //// Get value
|
||||||
|
|
|
@ -276,6 +276,7 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor {
|
||||||
highlight : false,
|
highlight : false,
|
||||||
|
|
||||||
show_control : false,
|
show_control : false,
|
||||||
|
show_tooltip : true,
|
||||||
}
|
}
|
||||||
|
|
||||||
connection_param = new connectionParameter();
|
connection_param = new connectionParameter();
|
||||||
|
@ -693,6 +694,8 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor {
|
||||||
_blend.inputs[1].setFrom(_canvas.outputs[0]);
|
_blend.inputs[1].setFrom(_canvas.outputs[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function setFocusingNode(_node) { nodes_selecting = [ _node ]; return self; }
|
||||||
|
|
||||||
function getFocusingNode() { return array_empty(nodes_selecting)? noone : nodes_selecting[0]; }
|
function getFocusingNode() { return array_empty(nodes_selecting)? noone : nodes_selecting[0]; }
|
||||||
|
|
||||||
//// =========== Menus ===========
|
//// =========== Menus ===========
|
||||||
|
@ -2647,43 +2650,45 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor {
|
||||||
|
|
||||||
////////////////////////////////// Tooltip Overlay //////////////////////////////////
|
////////////////////////////////// Tooltip Overlay //////////////////////////////////
|
||||||
|
|
||||||
var _over = variable_struct_get_names(tooltip_overlay);
|
if(display_parameter.show_tooltip) {
|
||||||
if(!array_empty(_over)) {
|
var _over = variable_struct_get_names(tooltip_overlay);
|
||||||
var _tx = ui(16);
|
if(!array_empty(_over)) {
|
||||||
var _ty = h - toolbar_height - ui(10);
|
var _tx = ui(16);
|
||||||
|
var _ty = h - toolbar_height - ui(10);
|
||||||
|
|
||||||
for( var j = 0, m = array_length(_over); j < m; j++ ) {
|
for( var j = 0, m = array_length(_over); j < m; j++ ) {
|
||||||
var _title = _over[j];
|
var _title = _over[j];
|
||||||
var _keys = tooltip_overlay[$ _title];
|
var _keys = tooltip_overlay[$ _title];
|
||||||
|
|
||||||
draw_set_text(f_p2, fa_left, fa_bottom, COLORS._main_text);
|
draw_set_text(f_p2, fa_left, fa_bottom, COLORS._main_text);
|
||||||
|
|
||||||
var _tw = 0;
|
var _tw = 0;
|
||||||
for( var i = 0, n = array_length(_keys); i < n; i++ )
|
for( var i = 0, n = array_length(_keys); i < n; i++ )
|
||||||
_tw = max(_tw, string_width(_keys[i][0]));
|
_tw = max(_tw, string_width(_keys[i][0]));
|
||||||
var _ttx = _tx + _tw + ui(16);
|
var _ttx = _tx + _tw + ui(16);
|
||||||
|
|
||||||
for( var i = array_length(_keys) - 1; i >= 0; i-- ) {
|
for( var i = array_length(_keys) - 1; i >= 0; i-- ) {
|
||||||
draw_set_color(COLORS._main_icon);
|
draw_set_color(COLORS._main_icon);
|
||||||
|
draw_set_alpha(0.5);
|
||||||
|
draw_text_add(_tx, _ty, _keys[i][0]);
|
||||||
|
|
||||||
|
draw_set_color(COLORS._main_text);
|
||||||
|
draw_set_alpha(0.5);
|
||||||
|
draw_text_add(_ttx, _ty, _keys[i][1]);
|
||||||
|
|
||||||
|
_ty -= line_get_height();
|
||||||
|
}
|
||||||
|
|
||||||
|
_ty -= ui(4);
|
||||||
|
draw_set_text(f_p1b, fa_left, fa_bottom, COLORS._main_text);
|
||||||
draw_set_alpha(0.5);
|
draw_set_alpha(0.5);
|
||||||
draw_text_add(_tx, _ty, _keys[i][0]);
|
draw_text_add(_tx, _ty, _title);
|
||||||
|
|
||||||
draw_set_color(COLORS._main_text);
|
_ty -= line_get_height() + ui(8);
|
||||||
draw_set_alpha(0.5);
|
}
|
||||||
draw_text_add(_ttx, _ty, _keys[i][1]);
|
|
||||||
|
|
||||||
_ty -= line_get_height();
|
draw_set_alpha(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
_ty -= ui(4);
|
|
||||||
draw_set_text(f_p1b, fa_left, fa_bottom, COLORS._main_text);
|
|
||||||
draw_set_alpha(0.5);
|
|
||||||
draw_text_add(_tx, _ty, _title);
|
|
||||||
|
|
||||||
_ty -= line_get_height() + ui(8);
|
|
||||||
}
|
|
||||||
|
|
||||||
draw_set_alpha(1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
tooltip_overlay = {};
|
tooltip_overlay = {};
|
||||||
|
|
|
@ -62,6 +62,14 @@ function Panel_Graph_View_Setting(graphPanel, display) : Panel_Linear_Setting()
|
||||||
function(val) /*=>*/ { graphPanel.show_view_control = val; },
|
function(val) /*=>*/ { graphPanel.show_view_control = val; },
|
||||||
1,
|
1,
|
||||||
),
|
),
|
||||||
|
new __Panel_Linear_Setting_Item(
|
||||||
|
__txtx("graph_visibility_tooltip", "Show Tooltip"),
|
||||||
|
new checkBox(function() /*=>*/ { display_parameter.show_tooltip = !display_parameter.show_tooltip; }),
|
||||||
|
function() /*=>*/ {return display_parameter.show_tooltip},
|
||||||
|
function(val) /*=>*/ { display_parameter.show_tooltip = val; },
|
||||||
|
true,
|
||||||
|
[ "Graph", "Toggle Tooltip" ],
|
||||||
|
),
|
||||||
];
|
];
|
||||||
|
|
||||||
setHeight();
|
setHeight();
|
||||||
|
|
|
@ -817,22 +817,12 @@ function Panel_Inspector() : PanelContent() constructor {
|
||||||
}
|
}
|
||||||
|
|
||||||
var righ = array_safe_get_fast(jun, 3, noone);
|
var righ = array_safe_get_fast(jun, 3, noone);
|
||||||
if(righ != noone) {
|
if(righ != noone)
|
||||||
lbw -= ui(40);
|
lbw -= ui(32);
|
||||||
|
|
||||||
var _bx = lbx + lbw + ui(8);
|
|
||||||
var _by = yy;
|
|
||||||
var _bw = ui(32);
|
|
||||||
var _bh = lbh;
|
|
||||||
|
|
||||||
draw_sprite_stretched_ext(THEME.s_box_r5_clr, 0, _bx, _by, _bw, _bh, COLORS.panel_inspector_group_bg, 1);
|
|
||||||
righ.setFocusHover(pFOCUS, pHOVER);
|
|
||||||
righ.draw(_bx + ui(2), _by + ui(2), _bw - ui(4), _bh - ui(4), _m, THEME.button_hide_fill);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(_hover && point_in_rectangle(_m[0], _m[1], lbx, yy, lbx + lbw, yy + lbh)) {
|
if(_hover && point_in_rectangle(_m[0], _m[1], lbx, yy, lbx + lbw, yy + lbh)) {
|
||||||
contentPane.hover_content = true;
|
contentPane.hover_content = true;
|
||||||
draw_sprite_stretched_ext(THEME.s_box_r5_clr, 0, lbx, yy, lbw, lbh, COLORS.panel_inspector_group_hover, 1);
|
draw_sprite_stretched_ext(THEME.s_box_r5_clr, 0, lbx, yy, con_w - lbx, lbh, COLORS.panel_inspector_group_hover, 1);
|
||||||
|
|
||||||
if(mouse_press(mb_left, pFOCUS))
|
if(mouse_press(mb_left, pFOCUS))
|
||||||
jun[@ 1] = !coll;
|
jun[@ 1] = !coll;
|
||||||
|
@ -840,7 +830,18 @@ function Panel_Inspector() : PanelContent() constructor {
|
||||||
if(mouse_press(mb_right, pFOCUS))
|
if(mouse_press(mb_right, pFOCUS))
|
||||||
menuCall("inspector_group_menu", group_menu, 0, 0, fa_left);
|
menuCall("inspector_group_menu", group_menu, 0, 0, fa_left);
|
||||||
} else
|
} else
|
||||||
draw_sprite_stretched_ext(THEME.s_box_r5_clr, 0, lbx, yy, lbw, lbh, COLORS.panel_inspector_group_bg, 1);
|
draw_sprite_stretched_ext(THEME.s_box_r5_clr, 0, lbx, yy, con_w - lbx, lbh, COLORS.panel_inspector_group_bg, 1);
|
||||||
|
|
||||||
|
if(righ != noone) {
|
||||||
|
var _bx = lbx + lbw;
|
||||||
|
var _by = yy;
|
||||||
|
var _bw = ui(32);
|
||||||
|
var _bh = lbh;
|
||||||
|
|
||||||
|
// draw_sprite_stretched_ext(THEME.s_box_r5_clr, 0, _bx, _by, _bw, _bh, COLORS.panel_inspector_group_bg, 1);
|
||||||
|
righ.setFocusHover(pFOCUS, pHOVER);
|
||||||
|
righ.draw(_bx + ui(2), _by + ui(2), _bw - ui(4), _bh - ui(4), _m, THEME.button_hide_fill);
|
||||||
|
}
|
||||||
|
|
||||||
if(filter_text == "")
|
if(filter_text == "")
|
||||||
draw_sprite_ui(THEME.arrow, 0, lbx + ui(16), yy + lbh / 2, 1, 1, -90 + coll * 90, COLORS.panel_inspector_group_bg, 1);
|
draw_sprite_ui(THEME.arrow, 0, lbx + ui(16), yy + lbh / 2, 1, 1, -90 + coll * 90, COLORS.panel_inspector_group_bg, 1);
|
||||||
|
@ -1107,7 +1108,12 @@ function Panel_Inspector() : PanelContent() constructor {
|
||||||
if(inspectGroup == 1) txt = $"[{array_length(PANEL_GRAPH.nodes_selecting)}] {txt}";
|
if(inspectGroup == 1) txt = $"[{array_length(PANEL_GRAPH.nodes_selecting)}] {txt}";
|
||||||
else if(inspectGroup == -1) txt = $"[{array_length(PANEL_GRAPH.nodes_selecting)}] Multiple nodes";
|
else if(inspectGroup == -1) txt = $"[{array_length(PANEL_GRAPH.nodes_selecting)}] Multiple nodes";
|
||||||
|
|
||||||
tb_node_name.draw(ui(64), ui(14), w - ui(128), ui(32), txt, [ mx, my ]);
|
var tb_x = ui(64);
|
||||||
|
var tb_y = ui(14);
|
||||||
|
var tb_w = w - ui(128);
|
||||||
|
var tb_h = ui(32);
|
||||||
|
|
||||||
|
tb_node_name.draw(tb_x, tb_y, tb_w, tb_h, txt, [ mx, my ]);
|
||||||
|
|
||||||
if(inspectGroup >= 0) {
|
if(inspectGroup >= 0) {
|
||||||
draw_set_text(f_p1, fa_center, fa_center, COLORS._main_text_sub);
|
draw_set_text(f_p1, fa_center, fa_center, COLORS._main_text_sub);
|
||||||
|
@ -1129,6 +1135,20 @@ function Panel_Inspector() : PanelContent() constructor {
|
||||||
if(buttonInstant(THEME.button_hide, lx, ly, ui(16), ui(16), [mx, my], pFOCUS, pHOVER, __txt("Lock"), THEME.lock_12, !locked, locked? COLORS._main_icon_light : COLORS._main_icon) == 2)
|
if(buttonInstant(THEME.button_hide, lx, ly, ui(16), ui(16), [mx, my], pFOCUS, pHOVER, __txt("Lock"), THEME.lock_12, !locked, locked? COLORS._main_icon_light : COLORS._main_icon) == 2)
|
||||||
locked = !locked;
|
locked = !locked;
|
||||||
|
|
||||||
|
// draw_set_font(f_p3);
|
||||||
|
// var lw = string_width(inspecting.internalName);
|
||||||
|
// var lx = w / 2 - lw / 2 - ui(4 + 16);
|
||||||
|
// var ly = ui(76 - 8);
|
||||||
|
// if(buttonInstant(noone, lx, ly, ui(16), ui(16), [mx, my], pFOCUS, pHOVER, __txt("Previous"), THEME.arrow_wire_16, 2, COLORS._main_icon, 0.6) == 2) {
|
||||||
|
// }
|
||||||
|
|
||||||
|
// var lx = w / 2 + lw / 2 + ui(4);
|
||||||
|
// var ly = ui(76 - 8);
|
||||||
|
// if(buttonInstant(noone, lx, ly, ui(16), ui(16), [mx, my], pFOCUS, pHOVER, __txt("Next"), THEME.arrow_wire_16, 0, COLORS._main_icon, 0.6) == 2) {
|
||||||
|
// }
|
||||||
|
|
||||||
|
// --------------------------------------- //
|
||||||
|
|
||||||
if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(32), [mx, my], pFOCUS, pHOVER, __txt("Presets"), THEME.preset, 1) == 2)
|
if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(32), [mx, my], pFOCUS, pHOVER, __txt("Presets"), THEME.preset, 1) == 2)
|
||||||
dialogPanelCall(new Panel_Presets(inspecting), x + bx, y + by + ui(36));
|
dialogPanelCall(new Panel_Presets(inspecting), x + bx, y + by + ui(36));
|
||||||
} else {
|
} else {
|
||||||
|
|
72
scripts/pathnodeBox/pathnodeBox.gml
Normal file
|
@ -0,0 +1,72 @@
|
||||||
|
function pathnodeBox(_junction) : widget() constructor {
|
||||||
|
self.junction = _junction;
|
||||||
|
|
||||||
|
b_newTileset = button(function() /*=>*/ {
|
||||||
|
var b = nodeBuild("Node_Path", junction.node.x - 128, junction.ry - 32);
|
||||||
|
junction.setFrom(b.outputs[1]);
|
||||||
|
});
|
||||||
|
|
||||||
|
b_newTileset.text = __txt("New path");
|
||||||
|
b_newTileset.icon = THEME.add_16;
|
||||||
|
b_newTileset.icon_size = .75;
|
||||||
|
b_newTileset.icon_blend = COLORS._main_value_positive;
|
||||||
|
|
||||||
|
static trigger = function() { }
|
||||||
|
|
||||||
|
static drawParam = function(params) {
|
||||||
|
setParam(params);
|
||||||
|
return draw(params.x, params.y, params.w, params.data, params.m);
|
||||||
|
}
|
||||||
|
|
||||||
|
static draw = function(_x, _y, _w, _path, _m) {
|
||||||
|
x = _x;
|
||||||
|
y = _y;
|
||||||
|
w = _w;
|
||||||
|
h = TEXTBOX_HEIGHT;
|
||||||
|
|
||||||
|
// if(junction.connect_type == CONNECT_TYPE.output) {
|
||||||
|
|
||||||
|
// return h;
|
||||||
|
// }
|
||||||
|
|
||||||
|
if(_path == noone) {
|
||||||
|
b_newTileset.setFocusHover(active, hover);
|
||||||
|
var param = new widgetParam(x, y, w, h, noone, {}, _m, rx, ry);
|
||||||
|
b_newTileset.drawParam(param);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
var ic = s_node_path;
|
||||||
|
|
||||||
|
switch(instanceof(_path)) {
|
||||||
|
case "Node_Path" : ic = s_node_path; break;
|
||||||
|
}
|
||||||
|
|
||||||
|
var iw = ui(24);
|
||||||
|
var _s = (iw - ui(8)) / max(sprite_get_width(ic), sprite_get_height(ic));
|
||||||
|
var bi = 0;
|
||||||
|
|
||||||
|
if(ihover && point_in_rectangle(_m[0], _m[1], x, y, x + iw, y + h)) {
|
||||||
|
TOOLTIP = __txt("Go to node");
|
||||||
|
bi = 1;
|
||||||
|
|
||||||
|
if(mouse_click(mb_left, iactive))
|
||||||
|
bi = 2;
|
||||||
|
|
||||||
|
if(mouse_press(mb_left, iactive))
|
||||||
|
PANEL_GRAPH.setFocusingNode(_path);
|
||||||
|
}
|
||||||
|
|
||||||
|
draw_sprite_stretched_ext(THEME.button_def, bi, x, y, iw, h);
|
||||||
|
|
||||||
|
draw_sprite_stretched_ext(THEME.ui_panel_bg, 1, x + iw + ui(4), y, w - iw - ui(4), h, COLORS._main_icon_light);
|
||||||
|
draw_sprite_ext(ic, 0, x + iw / 2, y + h / 2, _s, _s);
|
||||||
|
|
||||||
|
draw_set_text(f_p2, fa_left, fa_center, COLORS._main_text_sub);
|
||||||
|
draw_text_add(x + iw + ui(4 + 8), y + h / 2, _path.getDisplayName());
|
||||||
|
}
|
||||||
|
|
||||||
|
return h;
|
||||||
|
}
|
||||||
|
|
||||||
|
static clone = function() { return new pathnodeBox(); }
|
||||||
|
}
|
13
scripts/pathnodeBox/pathnodeBox.yy
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
{
|
||||||
|
"$GMScript":"v1",
|
||||||
|
"%Name":"pathnodeBox",
|
||||||
|
"isCompatibility":false,
|
||||||
|
"isDnD":false,
|
||||||
|
"name":"pathnodeBox",
|
||||||
|
"parent":{
|
||||||
|
"name":"widgets",
|
||||||
|
"path":"folders/widgets.yy",
|
||||||
|
},
|
||||||
|
"resourceType":"GMScript",
|
||||||
|
"resourceVersion":"2.0",
|
||||||
|
}
|
|
@ -71,6 +71,7 @@
|
||||||
highlight : false,
|
highlight : false,
|
||||||
|
|
||||||
show_control : false,
|
show_control : false,
|
||||||
|
show_tooltip : true,
|
||||||
}
|
}
|
||||||
|
|
||||||
addons = {};
|
addons = {};
|
||||||
|
|
|
@ -4,7 +4,7 @@ function surface_reset_target_override() { __surface_reset_target(); winwin_draw
|
||||||
|
|
||||||
#region ==================================== DRAW ====================================
|
#region ==================================== DRAW ====================================
|
||||||
|
|
||||||
function draw_surface_safe(surface, _x = 0, _y = 0) { #region
|
function draw_surface_safe(surface, _x = 0, _y = 0) {
|
||||||
INLINE
|
INLINE
|
||||||
|
|
||||||
if(is_struct(surface)) {
|
if(is_struct(surface)) {
|
||||||
|
@ -19,9 +19,9 @@ function surface_reset_target_override() { __surface_reset_target(); winwin_draw
|
||||||
__channel_pre(surface);
|
__channel_pre(surface);
|
||||||
draw_surface(surface, _x, _y);
|
draw_surface(surface, _x, _y);
|
||||||
__channel_pos(surface);
|
__channel_pos(surface);
|
||||||
} #endregion
|
}
|
||||||
|
|
||||||
function draw_surface_stretched_safe(surface, _x, _y, _w, _h) { #region
|
function draw_surface_stretched_safe(surface, _x, _y, _w, _h) {
|
||||||
INLINE
|
INLINE
|
||||||
|
|
||||||
if(is_struct(surface)) {
|
if(is_struct(surface)) {
|
||||||
|
@ -36,9 +36,9 @@ function surface_reset_target_override() { __surface_reset_target(); winwin_draw
|
||||||
__channel_pre(surface);
|
__channel_pre(surface);
|
||||||
draw_surface_stretched(surface, _x, _y, _w, _h);
|
draw_surface_stretched(surface, _x, _y, _w, _h);
|
||||||
__channel_pos(surface);
|
__channel_pos(surface);
|
||||||
} #endregion
|
}
|
||||||
|
|
||||||
function draw_surface_ext_safe(surface, _x = 0, _y = 0, _xs = 1, _ys = 1, _rot = 0, _col = c_white, _alpha = 1) { #region
|
function draw_surface_ext_safe(surface, _x = 0, _y = 0, _xs = 1, _ys = 1, _rot = 0, _col = c_white, _alpha = 1) {
|
||||||
INLINE
|
INLINE
|
||||||
|
|
||||||
if(is_struct(surface)) {
|
if(is_struct(surface)) {
|
||||||
|
@ -54,9 +54,9 @@ function surface_reset_target_override() { __surface_reset_target(); winwin_draw
|
||||||
__channel_pre(surface);
|
__channel_pre(surface);
|
||||||
draw_surface_ext(surface, _x, _y, _xs, _ys, _rot, _col, _alpha);
|
draw_surface_ext(surface, _x, _y, _xs, _ys, _rot, _col, _alpha);
|
||||||
__channel_pos(surface);
|
__channel_pos(surface);
|
||||||
} #endregion
|
}
|
||||||
|
|
||||||
function draw_surface_tiled_safe(surface, _x = 0, _y = 0) { #region
|
function draw_surface_tiled_safe(surface, _x = 0, _y = 0) {
|
||||||
INLINE
|
INLINE
|
||||||
|
|
||||||
if(is_struct(surface)) {
|
if(is_struct(surface)) {
|
||||||
|
@ -71,9 +71,9 @@ function surface_reset_target_override() { __surface_reset_target(); winwin_draw
|
||||||
__channel_pre(surface);
|
__channel_pre(surface);
|
||||||
draw_surface_tiled(surface, _x, _y);
|
draw_surface_tiled(surface, _x, _y);
|
||||||
__channel_pos(surface);
|
__channel_pos(surface);
|
||||||
} #endregion
|
}
|
||||||
|
|
||||||
function draw_surface_tiled_ext_safe(surface, _x = 0, _y = 0, _xs = 1, _ys = 1, _rot = 0, _col = c_white, _alpha = 1) { #region
|
function draw_surface_tiled_ext_safe(surface, _x = 0, _y = 0, _xs = 1, _ys = 1, _rot = 0, _col = c_white, _alpha = 1) {
|
||||||
INLINE
|
INLINE
|
||||||
|
|
||||||
if(is_struct(surface)) {
|
if(is_struct(surface)) {
|
||||||
|
@ -97,30 +97,30 @@ function surface_reset_target_override() { __surface_reset_target(); winwin_draw
|
||||||
|
|
||||||
draw_surface_stretched_ext(surface, 0, 0, bdim[0], bdim[1], _col, _alpha);
|
draw_surface_stretched_ext(surface, 0, 0, bdim[0], bdim[1], _col, _alpha);
|
||||||
shader_reset();
|
shader_reset();
|
||||||
} #endregion
|
|
||||||
|
|
||||||
function draw_surface_part_ext_safe(surface, _l, _t, _w, _h, _x, _y, _xs = 1, _ys = 1, _rot = 0, _col = c_white, _alpha = 1) { #region
|
|
||||||
INLINE
|
|
||||||
|
|
||||||
if(is_struct(surface)) {
|
|
||||||
if(is_instanceof(surface, dynaSurf)) {
|
|
||||||
surface.drawPart(_l, _t, _w, _h, _x, _y, _xs, _ys, _rot, _col, _alpha);
|
|
||||||
return;
|
|
||||||
} else if(is_instanceof(surface, SurfaceAtlas))
|
|
||||||
surface = surface.getSurface();
|
|
||||||
}
|
}
|
||||||
if(is_array(surface) || !surface_exists(surface)) return;
|
|
||||||
|
|
||||||
__channel_pre(surface);
|
function draw_surface_part_ext_safe(surface, _l, _t, _w, _h, _x, _y, _xs = 1, _ys = 1, _rot = 0, _col = c_white, _alpha = 1) {
|
||||||
draw_surface_part_ext(surface, _l, _t, _w, _h, _x, _y, _xs, _ys, _col, _alpha);
|
INLINE
|
||||||
__channel_pos(surface);
|
|
||||||
} #endregion
|
if(is_struct(surface)) {
|
||||||
|
if(is_instanceof(surface, dynaSurf)) {
|
||||||
|
surface.drawPart(_l, _t, _w, _h, _x, _y, _xs, _ys, _rot, _col, _alpha);
|
||||||
|
return;
|
||||||
|
} else if(is_instanceof(surface, SurfaceAtlas))
|
||||||
|
surface = surface.getSurface();
|
||||||
|
}
|
||||||
|
if(is_array(surface) || !surface_exists(surface)) return;
|
||||||
|
|
||||||
|
__channel_pre(surface);
|
||||||
|
draw_surface_part_ext(surface, _l, _t, _w, _h, _x, _y, _xs, _ys, _col, _alpha);
|
||||||
|
__channel_pos(surface);
|
||||||
|
}
|
||||||
|
|
||||||
#endregion ==================================== DRAW ====================================
|
#endregion ==================================== DRAW ====================================
|
||||||
|
|
||||||
#region ==================================== CHECK ===================================
|
#region ==================================== CHECK ===================================
|
||||||
|
|
||||||
function is_surface(s) { #region
|
function is_surface(s) {
|
||||||
INLINE
|
INLINE
|
||||||
|
|
||||||
return !is_array(s) && (
|
return !is_array(s) && (
|
||||||
|
@ -129,16 +129,16 @@ function surface_reset_target_override() { __surface_reset_target(); winwin_draw
|
||||||
(is_numeric(s) && s > 0 && surface_exists(s))
|
(is_numeric(s) && s > 0 && surface_exists(s))
|
||||||
);
|
);
|
||||||
|
|
||||||
} #endregion
|
}
|
||||||
|
|
||||||
function surface_verify(surf, w, h, format = surface_rgba8unorm) { #region
|
function surface_verify(surf, w, h, format = surface_rgba8unorm) {
|
||||||
INLINE
|
INLINE
|
||||||
|
|
||||||
if(!is_surface(surf)) return surface_create_valid(w, h, format);
|
if(!is_surface(surf)) return surface_create_valid(w, h, format);
|
||||||
return surface_size_to(surf, w, h, format, true);
|
return surface_size_to(surf, w, h, format, true);
|
||||||
} #endregion
|
}
|
||||||
|
|
||||||
function surface_valid(surf, w, h, format = surface_rgba8unorm) { #region
|
function surface_valid(surf, w, h, format = surface_rgba8unorm) {
|
||||||
INLINE
|
INLINE
|
||||||
|
|
||||||
if(!is_surface(surf)) return false;
|
if(!is_surface(surf)) return false;
|
||||||
|
@ -146,14 +146,14 @@ function surface_reset_target_override() { __surface_reset_target(); winwin_draw
|
||||||
var _sh = surface_get_height(surf);
|
var _sh = surface_get_height(surf);
|
||||||
var _f = surface_get_format(surf);
|
var _f = surface_get_format(surf);
|
||||||
|
|
||||||
return _sw == w && _sh == h && _f == format;
|
return _sw == w && _sh == h && _f == format;
|
||||||
} #endregion
|
}
|
||||||
|
|
||||||
#endregion ==================================== CHECK ====================================
|
#endregion ==================================== CHECK ====================================
|
||||||
|
|
||||||
#region ==================================== GET =====================================
|
#region ==================================== GET =====================================
|
||||||
|
|
||||||
function surface_get_width_safe(s, crop = true) { #region
|
function surface_get_width_safe(s, crop = true) {
|
||||||
INLINE
|
INLINE
|
||||||
|
|
||||||
if(!is_surface(s)) return 1;
|
if(!is_surface(s)) return 1;
|
||||||
|
@ -164,9 +164,9 @@ function surface_reset_target_override() { __surface_reset_target(); winwin_draw
|
||||||
}
|
}
|
||||||
|
|
||||||
return surface_get_width(s);
|
return surface_get_width(s);
|
||||||
} #endregion
|
}
|
||||||
|
|
||||||
function surface_get_height_safe(s, crop = true) { #region
|
function surface_get_height_safe(s, crop = true) {
|
||||||
INLINE
|
INLINE
|
||||||
|
|
||||||
if(!is_surface(s)) return 1;
|
if(!is_surface(s)) return 1;
|
||||||
|
@ -177,9 +177,9 @@ function surface_reset_target_override() { __surface_reset_target(); winwin_draw
|
||||||
}
|
}
|
||||||
|
|
||||||
return surface_get_height(s);
|
return surface_get_height(s);
|
||||||
} #endregion
|
}
|
||||||
|
|
||||||
function surface_get_format_safe(s, crop = true) { #region
|
function surface_get_format_safe(s, crop = true) {
|
||||||
INLINE
|
INLINE
|
||||||
|
|
||||||
if(is_struct(s)) {
|
if(is_struct(s)) {
|
||||||
|
@ -189,16 +189,16 @@ function surface_reset_target_override() { __surface_reset_target(); winwin_draw
|
||||||
}
|
}
|
||||||
|
|
||||||
return surface_get_format(s);
|
return surface_get_format(s);
|
||||||
} #endregion
|
}
|
||||||
|
|
||||||
function surface_get_dimension(s) { #region
|
function surface_get_dimension(s) {
|
||||||
INLINE
|
INLINE
|
||||||
|
|
||||||
if(!is_surface(s)) return [ 1, 1 ];
|
if(!is_surface(s)) return [ 1, 1 ];
|
||||||
return [ surface_get_width_safe(s), surface_get_height_safe(s) ];
|
return [ surface_get_width_safe(s), surface_get_height_safe(s) ];
|
||||||
} #endregion
|
}
|
||||||
|
|
||||||
function surface_get_pixel(surface, _x, _y) { #region
|
function surface_get_pixel(surface, _x, _y) {
|
||||||
INLINE
|
INLINE
|
||||||
|
|
||||||
if(!is_surface(surface)) return;
|
if(!is_surface(surface)) return;
|
||||||
|
@ -223,9 +223,9 @@ function surface_reset_target_override() { __surface_reset_target(); winwin_draw
|
||||||
merge_color(p2, p3, rx),
|
merge_color(p2, p3, rx),
|
||||||
ry);
|
ry);
|
||||||
|
|
||||||
} #endregion
|
}
|
||||||
|
|
||||||
function surface_get_pixel_ext(surface, _x, _y) { #region
|
function surface_get_pixel_ext(surface, _x, _y) {
|
||||||
INLINE
|
INLINE
|
||||||
|
|
||||||
if(is_instanceof(surface, SurfaceAtlas)) surface = surface.surface.get();
|
if(is_instanceof(surface, SurfaceAtlas)) surface = surface.surface.get();
|
||||||
|
@ -234,42 +234,42 @@ function surface_reset_target_override() { __surface_reset_target(); winwin_draw
|
||||||
|
|
||||||
if(is_numeric(px)) return int64(px);
|
if(is_numeric(px)) return int64(px);
|
||||||
return round(px[0] * (255 * power(256, 0))) + round(px[1] * (255 * power(256, 1))) + round(px[2] * (255 * power(256, 2))) + round(px[3] * (255 * power(256, 3)));
|
return round(px[0] * (255 * power(256, 0))) + round(px[1] * (255 * power(256, 1))) + round(px[2] * (255 * power(256, 2))) + round(px[3] * (255 * power(256, 3)));
|
||||||
} #endregion
|
}
|
||||||
|
|
||||||
#endregion ==================================== GET ====================================
|
#endregion ==================================== GET ====================================
|
||||||
|
|
||||||
#region =================================== CREATE ===================================
|
#region =================================== CREATE ===================================
|
||||||
|
|
||||||
function surface_create_empty(w, h, format = surface_rgba8unorm) { #region
|
function surface_create_empty(w, h, format = surface_rgba8unorm) {
|
||||||
INLINE
|
INLINE
|
||||||
|
|
||||||
var s = surface_create(w, h, format);
|
var s = surface_create(w, h, format);
|
||||||
surface_clear(s);
|
surface_clear(s);
|
||||||
return s;
|
return s;
|
||||||
} #endregion
|
}
|
||||||
|
|
||||||
function surface_create_size(surface, format = surface_rgba8unorm) { #region
|
function surface_create_size(surface, format = surface_rgba8unorm) {
|
||||||
INLINE
|
INLINE
|
||||||
|
|
||||||
return surface_create_valid(surface_get_width_safe(surface), surface_get_height_safe(surface), format);
|
return surface_create_valid(surface_get_width_safe(surface), surface_get_height_safe(surface), format);
|
||||||
} #endregion
|
}
|
||||||
|
|
||||||
function surface_create_valid(w, h, format = surface_rgba8unorm) { #region
|
function surface_create_valid(w, h, format = surface_rgba8unorm) {
|
||||||
INLINE
|
INLINE
|
||||||
|
|
||||||
return surface_create_empty(surface_valid_size(w), surface_valid_size(h), format);
|
return surface_create_empty(surface_valid_size(w), surface_valid_size(h), format);
|
||||||
} #endregion
|
}
|
||||||
|
|
||||||
function surface_create_from_buffer(w, h, buff, format = surface_rgba8unorm) { #region
|
function surface_create_from_buffer(w, h, buff, format = surface_rgba8unorm) {
|
||||||
INLINE
|
INLINE
|
||||||
|
|
||||||
if(buff < 0) return;
|
if(buff < 0) return;
|
||||||
var s = surface_create_valid(surface_valid_size(w), surface_valid_size(h), format);
|
var s = surface_create_valid(surface_valid_size(w), surface_valid_size(h), format);
|
||||||
buffer_set_surface(buff, s, 0);
|
buffer_set_surface(buff, s, 0);
|
||||||
return s;
|
return s;
|
||||||
} #endregion
|
}
|
||||||
|
|
||||||
function surface_from_buffer(buff) { #region
|
function surface_from_buffer(buff) {
|
||||||
static header_length = 24;
|
static header_length = 24;
|
||||||
|
|
||||||
if(!buffer_exists(buff)) return noone;
|
if(!buffer_exists(buff)) return noone;
|
||||||
|
@ -288,9 +288,9 @@ function surface_reset_target_override() { __surface_reset_target(); winwin_draw
|
||||||
var s = surface_create(w, h, format);
|
var s = surface_create(w, h, format);
|
||||||
buffer_set_surface(buff, s, header_length);
|
buffer_set_surface(buff, s, header_length);
|
||||||
return s;
|
return s;
|
||||||
} #endregion
|
}
|
||||||
|
|
||||||
function surface_create_from_sprite(spr) { #region
|
function surface_create_from_sprite(spr) {
|
||||||
if(!sprite_exists(spr)) return noone;
|
if(!sprite_exists(spr)) return noone;
|
||||||
|
|
||||||
if(sprite_get_number(spr) == 1)
|
if(sprite_get_number(spr) == 1)
|
||||||
|
@ -302,9 +302,9 @@ function surface_reset_target_override() { __surface_reset_target(); winwin_draw
|
||||||
}
|
}
|
||||||
|
|
||||||
return s;
|
return s;
|
||||||
} #endregion
|
}
|
||||||
|
|
||||||
function surface_create_from_sprite_ext(spr, ind, format = surface_rgba8unorm) { #region
|
function surface_create_from_sprite_ext(spr, ind, format = surface_rgba8unorm) {
|
||||||
if(!sprite_exists(spr)) return noone;
|
if(!sprite_exists(spr)) return noone;
|
||||||
var sw = sprite_get_width(spr);
|
var sw = sprite_get_width(spr);
|
||||||
var sh = sprite_get_height(spr);
|
var sh = sprite_get_height(spr);
|
||||||
|
@ -318,9 +318,9 @@ function surface_reset_target_override() { __surface_reset_target(); winwin_draw
|
||||||
surface_reset_target();
|
surface_reset_target();
|
||||||
|
|
||||||
return s;
|
return s;
|
||||||
} #endregion
|
}
|
||||||
|
|
||||||
function surface_size_lim(surface, width, height) { #region
|
function surface_size_lim(surface, width, height) {
|
||||||
var sw = surface_get_width_safe(surface);
|
var sw = surface_get_width_safe(surface);
|
||||||
var sh = surface_get_height_safe(surface);
|
var sh = surface_get_height_safe(surface);
|
||||||
if(sw <= width && sh <= height) return surface;
|
if(sw <= width && sh <= height) return surface;
|
||||||
|
@ -332,9 +332,9 @@ function surface_reset_target_override() { __surface_reset_target(); winwin_draw
|
||||||
draw_surface_ext_safe(surface, 0, 0, ss, ss, 0, c_white, 1);
|
draw_surface_ext_safe(surface, 0, 0, ss, ss, 0, c_white, 1);
|
||||||
surface_reset_target();
|
surface_reset_target();
|
||||||
return s;
|
return s;
|
||||||
} #endregion
|
}
|
||||||
|
|
||||||
function surface_size_to(surface, width, height, format = noone, skipCheck = false) { #region
|
function surface_size_to(surface, width, height, format = noone, skipCheck = false) {
|
||||||
INLINE
|
INLINE
|
||||||
if(!skipCheck && !is_surface(surface)) return surface;
|
if(!skipCheck && !is_surface(surface)) return surface;
|
||||||
if(!is_numeric(width) || !is_numeric(height)) return surface;
|
if(!is_numeric(width) || !is_numeric(height)) return surface;
|
||||||
|
@ -357,18 +357,18 @@ function surface_reset_target_override() { __surface_reset_target(); winwin_draw
|
||||||
//surface_clear(surface);
|
//surface_clear(surface);
|
||||||
|
|
||||||
return surface;
|
return surface;
|
||||||
} #endregion
|
}
|
||||||
|
|
||||||
function surface_clear(surface) { #region
|
function surface_clear(surface) {
|
||||||
INLINE
|
INLINE
|
||||||
|
|
||||||
if(!is_surface(surface)) return;
|
if(!is_surface(surface)) return;
|
||||||
surface_set_target(surface);
|
surface_set_target(surface);
|
||||||
DRAW_CLEAR
|
DRAW_CLEAR
|
||||||
surface_reset_target();
|
surface_reset_target();
|
||||||
} #endregion
|
}
|
||||||
|
|
||||||
function surface_copy_from(dst, src, format = noone) { #region
|
function surface_copy_from(dst, src, format = noone) {
|
||||||
INLINE
|
INLINE
|
||||||
|
|
||||||
surface_set_target(dst);
|
surface_set_target(dst);
|
||||||
|
@ -377,9 +377,9 @@ function surface_reset_target_override() { __surface_reset_target(); winwin_draw
|
||||||
draw_surface_safe(src);
|
draw_surface_safe(src);
|
||||||
BLEND_NORMAL
|
BLEND_NORMAL
|
||||||
surface_reset_target();
|
surface_reset_target();
|
||||||
} #endregion
|
}
|
||||||
|
|
||||||
function surface_clone(surface, destination = noone, format = noone) { #region
|
function surface_clone(surface, destination = noone, format = noone) {
|
||||||
INLINE
|
INLINE
|
||||||
|
|
||||||
if(is_struct(surface) && is_instanceof(surface, dynaSurf))
|
if(is_struct(surface) && is_instanceof(surface, dynaSurf))
|
||||||
|
@ -396,13 +396,13 @@ function surface_reset_target_override() { __surface_reset_target(); winwin_draw
|
||||||
surface_reset_target();
|
surface_reset_target();
|
||||||
|
|
||||||
return destination;
|
return destination;
|
||||||
} #endregion
|
}
|
||||||
|
|
||||||
#endregion ==================================== CREATE ====================================
|
#endregion ==================================== CREATE ====================================
|
||||||
|
|
||||||
#region =================================== MODIFY ===================================
|
#region =================================== MODIFY ===================================
|
||||||
|
|
||||||
function surface_stretch(surf, _w, _h) { #region
|
function surface_stretch(surf, _w, _h) {
|
||||||
INLINE
|
INLINE
|
||||||
|
|
||||||
if(!is_surface(surf)) return noone;
|
if(!is_surface(surf)) return noone;
|
||||||
|
@ -418,9 +418,9 @@ function surface_reset_target_override() { __surface_reset_target(); winwin_draw
|
||||||
|
|
||||||
surface_free(surf);
|
surface_free(surf);
|
||||||
return _surf;
|
return _surf;
|
||||||
} #endregion
|
}
|
||||||
|
|
||||||
function surface_mirror(surf, _h, _v) { #region
|
function surface_mirror(surf, _h, _v) {
|
||||||
INLINE
|
INLINE
|
||||||
|
|
||||||
if(!is_surface(surf)) return noone;
|
if(!is_surface(surf)) return noone;
|
||||||
|
@ -437,9 +437,9 @@ function surface_reset_target_override() { __surface_reset_target(); winwin_draw
|
||||||
surface_free(surf);
|
surface_free(surf);
|
||||||
|
|
||||||
return _surf;
|
return _surf;
|
||||||
} #endregion
|
}
|
||||||
|
|
||||||
function surface_project_posterize(surf) { #region
|
function surface_project_posterize(surf) {
|
||||||
INLINE
|
INLINE
|
||||||
|
|
||||||
if(!PROJECT.attributes.palette_fix) return surf;
|
if(!PROJECT.attributes.palette_fix) return surf;
|
||||||
|
@ -458,13 +458,13 @@ function surface_reset_target_override() { __surface_reset_target(); winwin_draw
|
||||||
surface_free(surf);
|
surface_free(surf);
|
||||||
|
|
||||||
return _surf;
|
return _surf;
|
||||||
} #endregion
|
}
|
||||||
|
|
||||||
#endregion ==================================== MODIFY ====================================
|
#endregion ==================================== MODIFY ====================================
|
||||||
|
|
||||||
#region =================================== OTHERS ===================================
|
#region =================================== OTHERS ===================================
|
||||||
|
|
||||||
function surface_copy_size(dest, source, format = noone) { #region
|
function surface_copy_size(dest, source, format = noone) {
|
||||||
INLINE
|
INLINE
|
||||||
|
|
||||||
if(!is_surface(dest)) return;
|
if(!is_surface(dest)) return;
|
||||||
|
@ -476,17 +476,17 @@ function surface_reset_target_override() { __surface_reset_target(); winwin_draw
|
||||||
surface_reset_target();
|
surface_reset_target();
|
||||||
|
|
||||||
surface_copy_from(dest, source);
|
surface_copy_from(dest, source);
|
||||||
} #endregion
|
}
|
||||||
|
|
||||||
function surface_valid_size(s) { #region
|
function surface_valid_size(s) {
|
||||||
INLINE
|
INLINE
|
||||||
|
|
||||||
if(!is_numeric(s)) return 1;
|
if(!is_numeric(s)) return 1;
|
||||||
if(is_infinity(s)) return 1;
|
if(is_infinity(s)) return 1;
|
||||||
return clamp(round(s), 1, 8192);
|
return clamp(round(s), 1, 8192);
|
||||||
} #endregion
|
}
|
||||||
|
|
||||||
function surface_array_free(arr) { #region
|
function surface_array_free(arr) {
|
||||||
INLINE
|
INLINE
|
||||||
|
|
||||||
if(!is_array(arr)) {
|
if(!is_array(arr)) {
|
||||||
|
@ -496,9 +496,9 @@ function surface_reset_target_override() { __surface_reset_target(); winwin_draw
|
||||||
|
|
||||||
for( var i = 0, n = array_length(arr); i < n; i++ )
|
for( var i = 0, n = array_length(arr); i < n; i++ )
|
||||||
surface_array_free(arr[i]);
|
surface_array_free(arr[i]);
|
||||||
} #endregion
|
}
|
||||||
|
|
||||||
function surface_array_clone(arr) { #region
|
function surface_array_clone(arr) {
|
||||||
if(!is_array(arr)) {
|
if(!is_array(arr)) {
|
||||||
if(is_surface(arr))
|
if(is_surface(arr))
|
||||||
return surface_clone(arr);
|
return surface_clone(arr);
|
||||||
|
@ -512,83 +512,9 @@ function surface_reset_target_override() { __surface_reset_target(); winwin_draw
|
||||||
_arr[i] = surface_array_clone(arr[i]);
|
_arr[i] = surface_array_clone(arr[i]);
|
||||||
|
|
||||||
return _arr;
|
return _arr;
|
||||||
} #endregion
|
}
|
||||||
|
|
||||||
function surface_array_serialize(arr) { #region
|
function surface_format_get_bytes(format) {
|
||||||
INLINE
|
|
||||||
|
|
||||||
var _arr = __surface_array_serialize(arr);
|
|
||||||
return json_stringify(_arr);
|
|
||||||
} #endregion
|
|
||||||
|
|
||||||
function __surface_array_serialize(arr) { #region
|
|
||||||
if(!is_array(arr)) {
|
|
||||||
if(is_surface(arr)) {
|
|
||||||
var buff = buffer_create(surface_get_width_safe(arr) * surface_get_height_safe(arr) * 4, buffer_fixed, 1);
|
|
||||||
buffer_get_surface(buff, arr, 0);
|
|
||||||
var comp = buffer_compress(buff, 0, buffer_get_size(buff));
|
|
||||||
var enc = buffer_base64_encode(comp, 0, buffer_get_size(comp));
|
|
||||||
buffer_delete(buff);
|
|
||||||
return { width: surface_get_width_safe(arr), height: surface_get_height_safe(arr), buffer: enc };
|
|
||||||
} else
|
|
||||||
return arr;
|
|
||||||
}
|
|
||||||
|
|
||||||
var _arr = [];
|
|
||||||
|
|
||||||
for( var i = 0, n = array_length(arr); i < n; i++ )
|
|
||||||
_arr[i] = __surface_array_serialize(arr[i]);
|
|
||||||
|
|
||||||
return _arr;
|
|
||||||
} #endregion
|
|
||||||
|
|
||||||
function surface_array_deserialize(arr, index = -1) { #region
|
|
||||||
INLINE
|
|
||||||
|
|
||||||
var _arr = json_try_parse(arr);
|
|
||||||
return index == -1? __surface_array_deserialize(_arr) : __surface_array_deserialize(_arr[index]);
|
|
||||||
} #endregion
|
|
||||||
|
|
||||||
function __surface_array_deserialize(arr) { #region
|
|
||||||
if(!is_array(arr)) {
|
|
||||||
if(!is_struct(arr) || !struct_has(arr, "buffer"))
|
|
||||||
return noone;
|
|
||||||
|
|
||||||
var buff = buffer_base64_decode(arr.buffer);
|
|
||||||
buff = buffer_decompress(buff);
|
|
||||||
return surface_create_from_buffer(arr.width, arr.height, buff);
|
|
||||||
}
|
|
||||||
|
|
||||||
var _arr = [];
|
|
||||||
|
|
||||||
for( var i = 0, n = array_length(arr); i < n; i++ )
|
|
||||||
_arr[i] = __surface_array_deserialize(arr[i]);
|
|
||||||
|
|
||||||
return _arr;
|
|
||||||
} #endregion
|
|
||||||
|
|
||||||
function surface_encode(surface, stringify = true) { #region
|
|
||||||
if(is_instanceof(surface, SurfaceAtlas)) surface = surface.surface.get();
|
|
||||||
if(is_array(surface) || !surface_exists(surface)) return "";
|
|
||||||
|
|
||||||
var buff = buffer_create(surface_get_width_safe(surface) * surface_get_height_safe(surface) * 4, buffer_fixed, 1);
|
|
||||||
|
|
||||||
buffer_get_surface(buff, surface, 0);
|
|
||||||
var comp = buffer_compress(buff, 0, buffer_get_size(buff));
|
|
||||||
var enc = buffer_base64_encode(comp, 0, buffer_get_size(comp));
|
|
||||||
var str = { width: surface_get_width_safe(surface), height: surface_get_height_safe(surface), buffer: enc };
|
|
||||||
buffer_delete(buff);
|
|
||||||
|
|
||||||
return stringify? json_stringify(str) : str;
|
|
||||||
} #endregion
|
|
||||||
|
|
||||||
function surface_decode(_struct) { #region
|
|
||||||
var buff = buffer_base64_decode(_struct.buffer);
|
|
||||||
var buff = buffer_decompress(buff);
|
|
||||||
return surface_create_from_buffer(_struct.width, _struct.height, buff);
|
|
||||||
} #endregion
|
|
||||||
|
|
||||||
function surface_format_get_bytes(format) { #region
|
|
||||||
switch(format) {
|
switch(format) {
|
||||||
case surface_rgba4unorm : return 4 * 0.5; break;
|
case surface_rgba4unorm : return 4 * 0.5; break;
|
||||||
case surface_rgba8unorm : return 4 * 1; break;
|
case surface_rgba8unorm : return 4 * 1; break;
|
||||||
|
@ -600,35 +526,35 @@ function surface_reset_target_override() { __surface_reset_target(); winwin_draw
|
||||||
case surface_r32float : return 1 * 3; break;
|
case surface_r32float : return 1 * 3; break;
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
} #endregion
|
}
|
||||||
|
|
||||||
function surface_get_size(surface) { #region
|
function surface_get_size(surface) {
|
||||||
INLINE
|
INLINE
|
||||||
|
|
||||||
var sw = surface_get_width_safe(surface);
|
var sw = surface_get_width_safe(surface);
|
||||||
var sh = surface_get_height_safe(surface);
|
var sh = surface_get_height_safe(surface);
|
||||||
var sz = sw * sh * surface_format_get_bytes(surface_get_format(surface));
|
var sz = sw * sh * surface_format_get_bytes(surface_get_format(surface));
|
||||||
return sz;
|
return sz;
|
||||||
} #endregion
|
}
|
||||||
|
|
||||||
function surface_texture(surface) { #region
|
function surface_texture(surface) {
|
||||||
INLINE
|
INLINE
|
||||||
|
|
||||||
if(!is_surface(surface)) return -1;
|
if(!is_surface(surface)) return -1;
|
||||||
return surface_get_texture(surface);
|
return surface_get_texture(surface);
|
||||||
} #endregion
|
}
|
||||||
|
|
||||||
#macro surface_free surface_free_safe
|
#macro surface_free surface_free_safe
|
||||||
#macro __surface_free surface_free
|
#macro __surface_free surface_free
|
||||||
|
|
||||||
function surface_free_safe(surface) { #region
|
function surface_free_safe(surface) {
|
||||||
INLINE
|
INLINE
|
||||||
|
|
||||||
if(!is_surface(surface)) return;
|
if(!is_surface(surface)) return;
|
||||||
__surface_free(surface);
|
__surface_free(surface);
|
||||||
} #endregion
|
}
|
||||||
|
|
||||||
function surface_save_safe(surface, path) { #region
|
function surface_save_safe(surface, path) {
|
||||||
if(!is_surface(surface)) return;
|
if(!is_surface(surface)) return;
|
||||||
|
|
||||||
if(is_instanceof(surface, SurfaceAtlas)) surface = surface.surface.get();
|
if(is_instanceof(surface, SurfaceAtlas)) surface = surface.surface.get();
|
||||||
|
@ -671,32 +597,124 @@ function surface_reset_target_override() { __surface_reset_target(); winwin_draw
|
||||||
surface_save(s, path);
|
surface_save(s, path);
|
||||||
surface_free(s);
|
surface_free(s);
|
||||||
return;
|
return;
|
||||||
} #endregion
|
|
||||||
|
|
||||||
function surface_cvt_8unorm(target, surface) { #region
|
|
||||||
if(!is_surface(surface)) return target;
|
|
||||||
|
|
||||||
target = surface_verify(target, surface_get_width_safe(surface), surface_get_height_safe(surface));
|
|
||||||
var _typ = surface_get_format(surface);
|
|
||||||
|
|
||||||
switch(_typ) {
|
|
||||||
case surface_rgba4unorm :
|
|
||||||
case surface_rgba8unorm :
|
|
||||||
case surface_rgba16float :
|
|
||||||
case surface_rgba32float :
|
|
||||||
surface_set_shader(target, sh_draw_normal);
|
|
||||||
break;
|
|
||||||
case surface_r8unorm :
|
|
||||||
case surface_r16float :
|
|
||||||
case surface_r32float :
|
|
||||||
surface_set_shader(target, sh_draw_single_channel);
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
draw_surface_safe(surface);
|
function surface_cvt_8unorm(target, surface) {
|
||||||
surface_reset_shader();
|
if(!is_surface(surface)) return target;
|
||||||
|
|
||||||
return target;
|
target = surface_verify(target, surface_get_width_safe(surface), surface_get_height_safe(surface));
|
||||||
} #endregion
|
var _typ = surface_get_format(surface);
|
||||||
|
|
||||||
|
switch(_typ) {
|
||||||
|
case surface_rgba4unorm :
|
||||||
|
case surface_rgba8unorm :
|
||||||
|
case surface_rgba16float :
|
||||||
|
case surface_rgba32float :
|
||||||
|
surface_set_shader(target, sh_draw_normal);
|
||||||
|
break;
|
||||||
|
case surface_r8unorm :
|
||||||
|
case surface_r16float :
|
||||||
|
case surface_r32float :
|
||||||
|
surface_set_shader(target, sh_draw_single_channel);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
draw_surface_safe(surface);
|
||||||
|
surface_reset_shader();
|
||||||
|
|
||||||
|
return target;
|
||||||
|
}
|
||||||
|
|
||||||
#endregion =================================== OTHERS ===================================
|
#endregion =================================== OTHERS ===================================
|
||||||
|
|
||||||
|
#region ================================= SERIALIZE ==================================
|
||||||
|
|
||||||
|
function surface_array_serialize(arr) {
|
||||||
|
INLINE
|
||||||
|
|
||||||
|
var _arr = __surface_array_serialize(arr);
|
||||||
|
return json_stringify(_arr);
|
||||||
|
}
|
||||||
|
|
||||||
|
function __surface_array_serialize(arr) {
|
||||||
|
if(!is_array(arr)) {
|
||||||
|
if(is_surface(arr)) {
|
||||||
|
var buff = buffer_create(surface_get_width_safe(arr) * surface_get_height_safe(arr) * 4, buffer_fixed, 1);
|
||||||
|
buffer_get_surface(buff, arr, 0);
|
||||||
|
var comp = buffer_compress(buff, 0, buffer_get_size(buff));
|
||||||
|
var enc = buffer_base64_encode(comp, 0, buffer_get_size(comp));
|
||||||
|
buffer_delete(buff);
|
||||||
|
return { width: surface_get_width_safe(arr), height: surface_get_height_safe(arr), buffer: enc };
|
||||||
|
} else
|
||||||
|
return arr;
|
||||||
|
}
|
||||||
|
|
||||||
|
var _arr = [];
|
||||||
|
|
||||||
|
for( var i = 0, n = array_length(arr); i < n; i++ )
|
||||||
|
_arr[i] = __surface_array_serialize(arr[i]);
|
||||||
|
|
||||||
|
return _arr;
|
||||||
|
}
|
||||||
|
|
||||||
|
function surface_array_deserialize(arr, index = -1) {
|
||||||
|
INLINE
|
||||||
|
|
||||||
|
var _arr = json_try_parse(arr);
|
||||||
|
return index == -1? __surface_array_deserialize(_arr) : __surface_array_deserialize(_arr[index]);
|
||||||
|
}
|
||||||
|
|
||||||
|
function __surface_array_deserialize(arr) {
|
||||||
|
if(!is_array(arr)) {
|
||||||
|
if(!is_struct(arr) || !struct_has(arr, "buffer"))
|
||||||
|
return noone;
|
||||||
|
|
||||||
|
var buff = buffer_base64_decode(arr.buffer);
|
||||||
|
buff = buffer_decompress(buff);
|
||||||
|
return surface_create_from_buffer(arr.width, arr.height, buff);
|
||||||
|
}
|
||||||
|
|
||||||
|
var _arr = [];
|
||||||
|
|
||||||
|
for( var i = 0, n = array_length(arr); i < n; i++ )
|
||||||
|
_arr[i] = __surface_array_deserialize(arr[i]);
|
||||||
|
|
||||||
|
return _arr;
|
||||||
|
}
|
||||||
|
|
||||||
|
function surface_encode(surface, stringify = true) {
|
||||||
|
if(is_instanceof(surface, SurfaceAtlas)) surface = surface.surface.get();
|
||||||
|
if(is_array(surface) || !surface_exists(surface)) return "";
|
||||||
|
|
||||||
|
var _sw = surface_get_width_safe(surface);
|
||||||
|
var _sh = surface_get_height_safe(surface);
|
||||||
|
var _sf = surface_get_format(surface);
|
||||||
|
var buff = buffer_create(_sw * _sh * surface_format_get_bytes(_sf), buffer_fixed, 1);
|
||||||
|
|
||||||
|
buffer_get_surface(buff, surface, 0);
|
||||||
|
var comp = buffer_compress(buff, 0, buffer_get_size(buff));
|
||||||
|
var enc = buffer_base64_encode(comp, 0, buffer_get_size(comp));
|
||||||
|
var str = {
|
||||||
|
width: _sw,
|
||||||
|
height: _sh,
|
||||||
|
buffer: enc,
|
||||||
|
format: _sf,
|
||||||
|
};
|
||||||
|
|
||||||
|
buffer_delete(buff);
|
||||||
|
|
||||||
|
return stringify? json_stringify(str) : str;
|
||||||
|
}
|
||||||
|
|
||||||
|
function surface_decode(_struct) {
|
||||||
|
if(is_string(_struct)) _struct = json_try_parse(_struct);
|
||||||
|
if(!is_struct(_struct)) return noone;
|
||||||
|
if(!struct_has(_struct, "buffer")) return noone;
|
||||||
|
|
||||||
|
var buff = buffer_base64_decode(_struct.buffer);
|
||||||
|
var buff = buffer_decompress(buff);
|
||||||
|
var form = struct_try_get(_struct, "format", surface_rgba8unorm);
|
||||||
|
return surface_create_from_buffer(_struct.width, _struct.height, buff, form);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion ================================= SERIALIZE =================================
|
||||||
|
|
|
@ -24,7 +24,7 @@ function tiler_tool_brush(node, _brush, eraser = false) : tiler_tool(node) const
|
||||||
mouse_cur_x = floor(round((_mx - _x) / _s - 0.5) / tile_size[0]);
|
mouse_cur_x = floor(round((_mx - _x) / _s - 0.5) / tile_size[0]);
|
||||||
mouse_cur_y = floor(round((_my - _y) / _s - 0.5) / tile_size[1]);
|
mouse_cur_y = floor(round((_my - _y) / _s - 0.5) / tile_size[1]);
|
||||||
|
|
||||||
var _auto = brush.autotiler;
|
var _auto = brush.autoterrain;
|
||||||
|
|
||||||
if(mouse_pre_draw_x != undefined && mouse_pre_draw_y != undefined && key_mod_presses(SHIFT, CTRL)) {
|
if(mouse_pre_draw_x != undefined && mouse_pre_draw_y != undefined && key_mod_presses(SHIFT, CTRL)) {
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ function tiler_tool_shape(node, _brush, _shape) : tiler_tool(node) constructor {
|
||||||
mouse_cur_x = floor(round((_mx - _x) / _s - 0.5) / tile_size[0]);
|
mouse_cur_x = floor(round((_mx - _x) / _s - 0.5) / tile_size[0]);
|
||||||
mouse_cur_y = floor(round((_my - _y) / _s - 0.5) / tile_size[1]);
|
mouse_cur_y = floor(round((_my - _y) / _s - 0.5) / tile_size[1]);
|
||||||
|
|
||||||
var _auto = brush.autotiler;
|
var _auto = brush.autoterrain;
|
||||||
|
|
||||||
if(mouse_holding && key_mod_press(SHIFT)) {
|
if(mouse_holding && key_mod_press(SHIFT)) {
|
||||||
var ww = mouse_cur_x - mouse_pre_x;
|
var ww = mouse_cur_x - mouse_pre_x;
|
||||||
|
|
|
@ -15,7 +15,7 @@ function tiler_tool_fill(node, _brush, toolAttr) : tiler_tool(node) constructor
|
||||||
surface_w = surface_get_width(drawing_surface);
|
surface_w = surface_get_width(drawing_surface);
|
||||||
surface_h = surface_get_height(drawing_surface);
|
surface_h = surface_get_height(drawing_surface);
|
||||||
|
|
||||||
var _auto = brush.autotiler;
|
var _auto = brush.autoterrain;
|
||||||
|
|
||||||
if(mouse_press(mb_left, active) && point_in_rectangle(mouse_cur_x, mouse_cur_y, 0, 0, surface_w - 1, surface_h - 1)) {
|
if(mouse_press(mb_left, active) && point_in_rectangle(mouse_cur_x, mouse_cur_y, 0, 0, surface_w - 1, surface_h - 1)) {
|
||||||
surface_set_target(drawing_surface);
|
surface_set_target(drawing_surface);
|
||||||
|
|
|
@ -2,11 +2,14 @@ function tilesetBox(_junction) : widget() constructor {
|
||||||
self.junction = _junction;
|
self.junction = _junction;
|
||||||
|
|
||||||
b_newTileset = button(function() /*=>*/ {
|
b_newTileset = button(function() /*=>*/ {
|
||||||
var b = nodeBuild("Node_Tile_Tileset", junction.node.x - 160, junction.node.y);
|
var b = nodeBuild("Node_Tile_Tileset", junction.node.x - 160, junction.ry - 32);
|
||||||
junction.setFrom(b.outputs[0]);
|
junction.setFrom(b.outputs[0]);
|
||||||
});
|
});
|
||||||
|
|
||||||
b_newTileset.text = __txt("New tileset");
|
b_newTileset.text = __txt("New tileset");
|
||||||
|
b_newTileset.icon = THEME.add_16;
|
||||||
|
b_newTileset.icon_size = .75;
|
||||||
|
b_newTileset.icon_blend = COLORS._main_value_positive;
|
||||||
|
|
||||||
static trigger = function() { }
|
static trigger = function() { }
|
||||||
|
|
||||||
|
@ -27,11 +30,38 @@ function tilesetBox(_junction) : widget() constructor {
|
||||||
b_newTileset.drawParam(param);
|
b_newTileset.drawParam(param);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
draw_sprite_stretched_ext(THEME.ui_panel_bg, 1, x, y, w, h, COLORS._main_icon_light);
|
var ic = s_node_tileset;
|
||||||
|
|
||||||
|
switch(instanceof(_tileset)) {
|
||||||
|
case "Node_Tile_Tileset" : ic = s_node_tileset; break;
|
||||||
|
}
|
||||||
|
|
||||||
|
var iw = ui(24);
|
||||||
|
var _s = (iw - ui(8)) / max(sprite_get_width(ic), sprite_get_height(ic));
|
||||||
|
var bi = 0;
|
||||||
|
|
||||||
|
if(ihover && point_in_rectangle(_m[0], _m[1], x, y, x + iw, y + h)) {
|
||||||
|
TOOLTIP = __txt("Go to node");
|
||||||
|
bi = 1;
|
||||||
|
|
||||||
|
if(mouse_click(mb_left, iactive))
|
||||||
|
bi = 2;
|
||||||
|
|
||||||
|
if(mouse_press(mb_left, iactive))
|
||||||
|
PANEL_GRAPH.setFocusingNode(_tileset);
|
||||||
|
}
|
||||||
|
|
||||||
|
draw_sprite_stretched_ext(THEME.button_def, bi, x, y, iw, h);
|
||||||
|
|
||||||
|
draw_sprite_stretched_ext(THEME.ui_panel_bg, 1, x + iw + ui(4), y, w - iw - ui(4), h, COLORS._main_icon_light);
|
||||||
|
draw_sprite_ext(ic, 0, x + iw / 2, y + h / 2, _s, _s);
|
||||||
|
|
||||||
|
draw_set_text(f_p2, fa_left, fa_center, COLORS._main_text_sub);
|
||||||
|
draw_text_add(x + iw + ui(4 + 8), y + h / 2, _tileset.getDisplayName());
|
||||||
}
|
}
|
||||||
|
|
||||||
return h;
|
return h;
|
||||||
}
|
}
|
||||||
|
|
||||||
static clone = function() { return new outputBox(); }
|
static clone = function() { return new tilesetBox(); }
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
varying vec2 v_vTexcoord;
|
varying vec2 v_vTexcoord;
|
||||||
varying vec4 v_vColour;
|
varying vec4 v_vColour;
|
||||||
|
|
||||||
uniform int operator;
|
uniform int operator;
|
||||||
uniform vec4 operand;
|
uniform vec4 operand;
|
||||||
|
uniform float mixAmount;
|
||||||
|
|
||||||
uniform int operandType;
|
uniform int operandType;
|
||||||
uniform sampler2D operandSurf;
|
uniform sampler2D operandSurf;
|
||||||
|
@ -72,17 +73,35 @@ void main() {
|
||||||
res.a = round(res.a);
|
res.a = round(res.a);
|
||||||
|
|
||||||
} else if(operator == 13) {
|
} else if(operator == 13) {
|
||||||
|
res.r = mix(res.r, op.r, mixAmount);
|
||||||
|
res.g = mix(res.g, op.g, mixAmount);
|
||||||
|
res.b = mix(res.b, op.b, mixAmount);
|
||||||
|
res.a = mix(res.a, op.a, mixAmount);
|
||||||
|
|
||||||
|
} else if(operator == 14) {
|
||||||
res.r = abs(res.r);
|
res.r = abs(res.r);
|
||||||
res.g = abs(res.g);
|
res.g = abs(res.g);
|
||||||
res.b = abs(res.b);
|
res.b = abs(res.b);
|
||||||
res.a = abs(res.a);
|
res.a = abs(res.a);
|
||||||
|
|
||||||
} else if(operator == 14) {
|
} else if(operator == 15) {
|
||||||
res.r = clamp(res.r, op.x, op.y);
|
res.r = clamp(res.r, op.x, op.y);
|
||||||
res.g = clamp(res.g, op.x, op.y);
|
res.g = clamp(res.g, op.x, op.y);
|
||||||
res.b = clamp(res.b, op.x, op.y);
|
res.b = clamp(res.b, op.x, op.y);
|
||||||
res.a = clamp(res.a, op.x, op.y);
|
res.a = clamp(res.a, op.x, op.y);
|
||||||
|
|
||||||
|
} else if(operator == 16) {
|
||||||
|
res.r = floor(res.r / op.r) * op.r;
|
||||||
|
res.g = floor(res.g / op.g) * op.g;
|
||||||
|
res.b = floor(res.b / op.b) * op.b;
|
||||||
|
res.a = floor(res.a / op.a) * op.a;
|
||||||
|
|
||||||
|
} else if(operator == 17) {
|
||||||
|
res.r = fract(res.r);
|
||||||
|
res.g = fract(res.g);
|
||||||
|
res.b = fract(res.b);
|
||||||
|
res.a = fract(res.a);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
gl_FragColor = res;
|
gl_FragColor = res;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"$GMShader":"",
|
"$GMShader":"",
|
||||||
"%Name":"sh_tiler_autotile_mask",
|
"%Name":"sh_tiler_autoterrain_apply",
|
||||||
"name":"sh_tiler_autotile_mask",
|
"name":"sh_tiler_autoterrain_apply",
|
||||||
"parent":{
|
"parent":{
|
||||||
"name":"shaders",
|
"name":"shaders",
|
||||||
"path":"folders/nodes/data/tiler/shaders.yy",
|
"path":"folders/nodes/data/tiler/shaders.yy",
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"$GMShader":"",
|
"$GMShader":"",
|
||||||
"%Name":"sh_tiler_autotile_apply",
|
"%Name":"sh_tiler_autoterrain_mask",
|
||||||
"name":"sh_tiler_autotile_apply",
|
"name":"sh_tiler_autoterrain_mask",
|
||||||
"parent":{
|
"parent":{
|
||||||
"name":"shaders",
|
"name":"shaders",
|
||||||
"path":"folders/nodes/data/tiler/shaders.yy",
|
"path":"folders/nodes/data/tiler/shaders.yy",
|
BIN
sprites/s_autotile_11x5/01232f7d-baf1-431a-a423-87f5315b841e.png
Normal file
After Width: | Height: | Size: 430 B |
After Width: | Height: | Size: 430 B |
90
sprites/s_autotile_11x5/s_autotile_11x5.yy
Normal file
|
@ -0,0 +1,90 @@
|
||||||
|
{
|
||||||
|
"$GMSprite":"",
|
||||||
|
"%Name":"s_autotile_11x5",
|
||||||
|
"bboxMode":0,
|
||||||
|
"bbox_bottom":19,
|
||||||
|
"bbox_left":1,
|
||||||
|
"bbox_right":43,
|
||||||
|
"bbox_top":0,
|
||||||
|
"collisionKind":1,
|
||||||
|
"collisionTolerance":0,
|
||||||
|
"DynamicTexturePage":false,
|
||||||
|
"edgeFiltering":false,
|
||||||
|
"For3D":false,
|
||||||
|
"frames":[
|
||||||
|
{"$GMSpriteFrame":"","%Name":"01232f7d-baf1-431a-a423-87f5315b841e","name":"01232f7d-baf1-431a-a423-87f5315b841e","resourceType":"GMSpriteFrame","resourceVersion":"2.0",},
|
||||||
|
],
|
||||||
|
"gridX":0,
|
||||||
|
"gridY":0,
|
||||||
|
"height":20,
|
||||||
|
"HTile":false,
|
||||||
|
"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",
|
||||||
|
"nineSlice":null,
|
||||||
|
"origin":0,
|
||||||
|
"parent":{
|
||||||
|
"name":"sprites",
|
||||||
|
"path":"folders/nodes/data/tiler/sprites.yy",
|
||||||
|
},
|
||||||
|
"preMultiplyAlpha":false,
|
||||||
|
"resourceType":"GMSprite",
|
||||||
|
"resourceVersion":"2.0",
|
||||||
|
"sequence":{
|
||||||
|
"$GMSequence":"",
|
||||||
|
"%Name":"s_autotile_11x5",
|
||||||
|
"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_autotile_11x5",
|
||||||
|
"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":"01232f7d-baf1-431a-a423-87f5315b841e","path":"sprites/s_autotile_11x5/s_autotile_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,},
|
||||||
|
],
|
||||||
|
"visibleRange":null,
|
||||||
|
"volume":1.0,
|
||||||
|
"xorigin":0,
|
||||||
|
"yorigin":0,
|
||||||
|
},
|
||||||
|
"swatchColours":null,
|
||||||
|
"swfPrecision":0.5,
|
||||||
|
"textureGroupId":{
|
||||||
|
"name":"Default",
|
||||||
|
"path":"texturegroups/Default",
|
||||||
|
},
|
||||||
|
"type":0,
|
||||||
|
"VTile":false,
|
||||||
|
"width":44,
|
||||||
|
}
|
BIN
sprites/s_autotile_3x3/489436ec-6bcc-43d3-937c-b67a3080c21b.png
Normal file
After Width: | Height: | Size: 306 B |
After Width: | Height: | Size: 306 B |
90
sprites/s_autotile_3x3/s_autotile_3x3.yy
Normal file
|
@ -0,0 +1,90 @@
|
||||||
|
{
|
||||||
|
"$GMSprite":"",
|
||||||
|
"%Name":"s_autotile_3x3",
|
||||||
|
"bboxMode":0,
|
||||||
|
"bbox_bottom":10,
|
||||||
|
"bbox_left":1,
|
||||||
|
"bbox_right":10,
|
||||||
|
"bbox_top":1,
|
||||||
|
"collisionKind":1,
|
||||||
|
"collisionTolerance":0,
|
||||||
|
"DynamicTexturePage":false,
|
||||||
|
"edgeFiltering":false,
|
||||||
|
"For3D":false,
|
||||||
|
"frames":[
|
||||||
|
{"$GMSpriteFrame":"","%Name":"489436ec-6bcc-43d3-937c-b67a3080c21b","name":"489436ec-6bcc-43d3-937c-b67a3080c21b","resourceType":"GMSpriteFrame","resourceVersion":"2.0",},
|
||||||
|
],
|
||||||
|
"gridX":0,
|
||||||
|
"gridY":0,
|
||||||
|
"height":12,
|
||||||
|
"HTile":false,
|
||||||
|
"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",
|
||||||
|
"nineSlice":null,
|
||||||
|
"origin":0,
|
||||||
|
"parent":{
|
||||||
|
"name":"sprites",
|
||||||
|
"path":"folders/nodes/data/tiler/sprites.yy",
|
||||||
|
},
|
||||||
|
"preMultiplyAlpha":false,
|
||||||
|
"resourceType":"GMSprite",
|
||||||
|
"resourceVersion":"2.0",
|
||||||
|
"sequence":{
|
||||||
|
"$GMSequence":"",
|
||||||
|
"%Name":"s_autotile_3x3",
|
||||||
|
"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_autotile_3x3",
|
||||||
|
"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":"489436ec-6bcc-43d3-937c-b67a3080c21b","path":"sprites/s_autotile_3x3/s_autotile_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,},
|
||||||
|
],
|
||||||
|
"visibleRange":null,
|
||||||
|
"volume":1.0,
|
||||||
|
"xorigin":0,
|
||||||
|
"yorigin":0,
|
||||||
|
},
|
||||||
|
"swatchColours":null,
|
||||||
|
"swfPrecision":0.5,
|
||||||
|
"textureGroupId":{
|
||||||
|
"name":"Default",
|
||||||
|
"path":"texturegroups/Default",
|
||||||
|
},
|
||||||
|
"type":0,
|
||||||
|
"VTile":false,
|
||||||
|
"width":12,
|
||||||
|
}
|
BIN
sprites/s_autotile_5x3/e3f83286-9b7e-4bd4-b2ea-c08183709b23.png
Normal file
After Width: | Height: | Size: 335 B |
After Width: | Height: | Size: 335 B |
90
sprites/s_autotile_5x3/s_autotile_5x3.yy
Normal file
|
@ -0,0 +1,90 @@
|
||||||
|
{
|
||||||
|
"$GMSprite":"",
|
||||||
|
"%Name":"s_autotile_5x3",
|
||||||
|
"bboxMode":0,
|
||||||
|
"bbox_bottom":11,
|
||||||
|
"bbox_left":1,
|
||||||
|
"bbox_right":19,
|
||||||
|
"bbox_top":0,
|
||||||
|
"collisionKind":1,
|
||||||
|
"collisionTolerance":0,
|
||||||
|
"DynamicTexturePage":false,
|
||||||
|
"edgeFiltering":false,
|
||||||
|
"For3D":false,
|
||||||
|
"frames":[
|
||||||
|
{"$GMSpriteFrame":"","%Name":"e3f83286-9b7e-4bd4-b2ea-c08183709b23","name":"e3f83286-9b7e-4bd4-b2ea-c08183709b23","resourceType":"GMSpriteFrame","resourceVersion":"2.0",},
|
||||||
|
],
|
||||||
|
"gridX":0,
|
||||||
|
"gridY":0,
|
||||||
|
"height":12,
|
||||||
|
"HTile":false,
|
||||||
|
"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",
|
||||||
|
"nineSlice":null,
|
||||||
|
"origin":0,
|
||||||
|
"parent":{
|
||||||
|
"name":"sprites",
|
||||||
|
"path":"folders/nodes/data/tiler/sprites.yy",
|
||||||
|
},
|
||||||
|
"preMultiplyAlpha":false,
|
||||||
|
"resourceType":"GMSprite",
|
||||||
|
"resourceVersion":"2.0",
|
||||||
|
"sequence":{
|
||||||
|
"$GMSequence":"",
|
||||||
|
"%Name":"s_autotile_5x3",
|
||||||
|
"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_autotile_5x3",
|
||||||
|
"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":"e3f83286-9b7e-4bd4-b2ea-c08183709b23","path":"sprites/s_autotile_5x3/s_autotile_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,},
|
||||||
|
],
|
||||||
|
"visibleRange":null,
|
||||||
|
"volume":1.0,
|
||||||
|
"xorigin":0,
|
||||||
|
"yorigin":0,
|
||||||
|
},
|
||||||
|
"swatchColours":null,
|
||||||
|
"swfPrecision":0.5,
|
||||||
|
"textureGroupId":{
|
||||||
|
"name":"Default",
|
||||||
|
"path":"texturegroups/Default",
|
||||||
|
},
|
||||||
|
"type":0,
|
||||||
|
"VTile":false,
|
||||||
|
"width":20,
|
||||||
|
}
|
BIN
sprites/s_autotile_8x6/b83bc046-0985-4dc1-8946-97dfc2b07310.png
Normal file
After Width: | Height: | Size: 420 B |
After Width: | Height: | Size: 420 B |
90
sprites/s_autotile_8x6/s_autotile_8x6.yy
Normal file
|
@ -0,0 +1,90 @@
|
||||||
|
{
|
||||||
|
"$GMSprite":"",
|
||||||
|
"%Name":"s_autotile_8x6",
|
||||||
|
"bboxMode":0,
|
||||||
|
"bbox_bottom":15,
|
||||||
|
"bbox_left":1,
|
||||||
|
"bbox_right":47,
|
||||||
|
"bbox_top":0,
|
||||||
|
"collisionKind":1,
|
||||||
|
"collisionTolerance":0,
|
||||||
|
"DynamicTexturePage":false,
|
||||||
|
"edgeFiltering":false,
|
||||||
|
"For3D":false,
|
||||||
|
"frames":[
|
||||||
|
{"$GMSpriteFrame":"","%Name":"b83bc046-0985-4dc1-8946-97dfc2b07310","name":"b83bc046-0985-4dc1-8946-97dfc2b07310","resourceType":"GMSpriteFrame","resourceVersion":"2.0",},
|
||||||
|
],
|
||||||
|
"gridX":0,
|
||||||
|
"gridY":0,
|
||||||
|
"height":16,
|
||||||
|
"HTile":false,
|
||||||
|
"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",
|
||||||
|
"nineSlice":null,
|
||||||
|
"origin":0,
|
||||||
|
"parent":{
|
||||||
|
"name":"sprites",
|
||||||
|
"path":"folders/nodes/data/tiler/sprites.yy",
|
||||||
|
},
|
||||||
|
"preMultiplyAlpha":false,
|
||||||
|
"resourceType":"GMSprite",
|
||||||
|
"resourceVersion":"2.0",
|
||||||
|
"sequence":{
|
||||||
|
"$GMSequence":"",
|
||||||
|
"%Name":"s_autotile_8x6",
|
||||||
|
"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_autotile_8x6",
|
||||||
|
"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":"b83bc046-0985-4dc1-8946-97dfc2b07310","path":"sprites/s_autotile_8x6/s_autotile_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,},
|
||||||
|
],
|
||||||
|
"visibleRange":null,
|
||||||
|
"volume":1.0,
|
||||||
|
"xorigin":0,
|
||||||
|
"yorigin":0,
|
||||||
|
},
|
||||||
|
"swatchColours":null,
|
||||||
|
"swfPrecision":0.5,
|
||||||
|
"textureGroupId":{
|
||||||
|
"name":"Default",
|
||||||
|
"path":"texturegroups/Default",
|
||||||
|
},
|
||||||
|
"type":0,
|
||||||
|
"VTile":false,
|
||||||
|
"width":48,
|
||||||
|
}
|
After Width: | Height: | Size: 355 B |
After Width: | Height: | Size: 628 B |
After Width: | Height: | Size: 486 B |
After Width: | Height: | Size: 556 B |
After Width: | Height: | Size: 412 B |
After Width: | Height: | Size: 402 B |
After Width: | Height: | Size: 579 B |
After Width: | Height: | Size: 384 B |
After Width: | Height: | Size: 521 B |
After Width: | Height: | Size: 381 B |
After Width: | Height: | Size: 491 B |
After Width: | Height: | Size: 388 B |
After Width: | Height: | Size: 638 B |
After Width: | Height: | Size: 347 B |
After Width: | Height: | Size: 526 B |
After Width: | Height: | Size: 341 B |
After Width: | Height: | Size: 560 B |
After Width: | Height: | Size: 433 B |
After Width: | Height: | Size: 355 B |
After Width: | Height: | Size: 628 B |
After Width: | Height: | Size: 486 B |
After Width: | Height: | Size: 556 B |
After Width: | Height: | Size: 412 B |
After Width: | Height: | Size: 402 B |
After Width: | Height: | Size: 579 B |
After Width: | Height: | Size: 384 B |
After Width: | Height: | Size: 521 B |
After Width: | Height: | Size: 381 B |
After Width: | Height: | Size: 491 B |