diff --git a/assets/Scene/Home/Home.ts b/assets/Scene/Home/Home.ts index 4089215..7574f92 100644 --- a/assets/Scene/Home/Home.ts +++ b/assets/Scene/Home/Home.ts @@ -18,7 +18,8 @@ enum sceneList { 'Change_clothes' = '换装', 'Screen_vibrating' = '震屏效果+动画恢复第一帧', 'Joystick' = '遥控杆', - 'Filter' = '颜色滤镜' + 'Filter' = '颜色滤镜', + 'Mosaic' = '马赛克/像素风(shader)' } @ccclass diff --git a/assets/Scene/Mosaic.meta b/assets/Scene/Mosaic.meta new file mode 100644 index 0000000..4f6a8a7 --- /dev/null +++ b/assets/Scene/Mosaic.meta @@ -0,0 +1,7 @@ +{ + "ver": "1.0.1", + "uuid": "bbd908a4-1464-41f7-a2dd-66115d27bc7a", + "isSubpackage": false, + "subpackageName": "", + "subMetas": {} +} \ No newline at end of file diff --git a/assets/Scene/Mosaic/Mosaic.effect b/assets/Scene/Mosaic/Mosaic.effect new file mode 100644 index 0000000..ce18386 --- /dev/null +++ b/assets/Scene/Mosaic/Mosaic.effect @@ -0,0 +1,94 @@ +// Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. + +CCEffect %{ + techniques: + - passes: + - vert: vs + frag: fs + blendState: + targets: + - blend: true + rasterizerState: + cullMode: none + properties: + texture: { value: white } + x_count: { value: 100.0 } + y_count: { value: 100.0 } +}% + + +CCProgram vs %{ + precision highp float; + + #include + + in vec3 a_position; + in vec4 a_color; + out vec4 v_color; + + #if USE_TEXTURE + in vec2 a_uv0; + out vec2 v_uv0; + #endif + + void main () { + vec4 pos = vec4(a_position, 1); + + #if CC_USE_MODEL + pos = cc_matViewProj * cc_matWorld * pos; + #else + pos = cc_matViewProj * pos; + #endif + + #if USE_TEXTURE + v_uv0 = a_uv0; + #endif + + v_color = a_color; + + gl_Position = pos; + } +}% + + +CCProgram fs %{ + precision highp float; + + in vec4 v_color; + + #if USE_TEXTURE + in vec2 v_uv0; + uniform sampler2D texture; + #endif + + #if USE_MASAIC + uniform ARGS{ + float x_count; + float y_count; + }; + + vec2 getUvMapPos() { + float block_w = 1.0 / x_count; + float block_x_idx = floor(v_uv0.x / block_w); + + float block_h = 1.0 / y_count; + float block_y_idx = floor(v_uv0.y / block_h); + + return vec2(block_w * (block_x_idx + 0.5), block_h * (block_y_idx + 0.5)); + } + #endif + + void main () { + vec4 o = vec4(1, 1, 1, 1); + vec2 realPos = v_uv0; + + #if USE_MASAIC + realPos = getUvMapPos(); + #endif + + o *= texture(texture, realPos); + o *= v_color; + + gl_FragColor = o; + } +}% diff --git a/assets/Scene/Mosaic/Mosaic.effect.meta b/assets/Scene/Mosaic/Mosaic.effect.meta new file mode 100644 index 0000000..38d9da9 --- /dev/null +++ b/assets/Scene/Mosaic/Mosaic.effect.meta @@ -0,0 +1,17 @@ +{ + "ver": "1.0.25", + "uuid": "a94a99c8-625f-4aef-8960-e983d429d3a6", + "compiledShaders": [ + { + "glsl1": { + "vert": "\nprecision highp float;\nuniform mediump mat4 cc_matViewProj;\nattribute vec3 a_position;\nattribute vec4 a_color;\nvarying vec4 v_color;\n#if USE_TEXTURE\nattribute vec2 a_uv0;\nvarying vec2 v_uv0;\n#endif\nvoid main () {\n vec4 pos = vec4(a_position, 1);\n #if CC_USE_MODEL\n pos = cc_matViewProj * cc_matWorld * pos;\n #else\n pos = cc_matViewProj * pos;\n #endif\n #if USE_TEXTURE\n v_uv0 = a_uv0;\n #endif\n v_color = a_color;\n gl_Position = pos;\n}", + "frag": "\nprecision highp float;\nvarying vec4 v_color;\n#if USE_TEXTURE\nvarying vec2 v_uv0;\nuniform sampler2D texture;\n#endif\n#if USE_MASAIC\nuniform float x_count;\nuniform float y_count;\nvec2 getUvMapPos() {\n float block_w = 1.0 / x_count;\n float block_x_idx = floor(v_uv0.x / block_w);\n float block_h = 1.0 / y_count;\n float block_y_idx = floor(v_uv0.y / block_h);\n return vec2(block_w * (block_x_idx + 0.5), block_h * (block_y_idx + 0.5));\n}\n#endif\nvoid main () {\n vec4 o = vec4(1, 1, 1, 1);\n vec2 realPos = v_uv0;\n #if USE_MASAIC\n realPos = getUvMapPos();\n #endif\n o *= texture2D(texture, realPos);\n o *= v_color;\n gl_FragColor = o;\n}" + }, + "glsl3": { + "vert": "\nprecision highp float;\nuniform CCGlobal {\n highp vec4 cc_time;\n mediump vec4 cc_screenSize;\n mediump vec4 cc_screenScale;\n mediump vec4 cc_nativeSize;\n highp mat4 cc_matView;\n mediump mat4 cc_matViewInv;\n mediump mat4 cc_matProj;\n mediump mat4 cc_matProjInv;\n mediump mat4 cc_matViewProj;\n mediump mat4 cc_matViewProjInv;\n mediump vec4 cc_cameraPos;\n};\nin vec3 a_position;\nin vec4 a_color;\nout vec4 v_color;\n#if USE_TEXTURE\nin vec2 a_uv0;\nout vec2 v_uv0;\n#endif\nvoid main () {\n vec4 pos = vec4(a_position, 1);\n #if CC_USE_MODEL\n pos = cc_matViewProj * cc_matWorld * pos;\n #else\n pos = cc_matViewProj * pos;\n #endif\n #if USE_TEXTURE\n v_uv0 = a_uv0;\n #endif\n v_color = a_color;\n gl_Position = pos;\n}", + "frag": "\nprecision highp float;\nin vec4 v_color;\n#if USE_TEXTURE\nin vec2 v_uv0;\nuniform sampler2D texture;\n#endif\n#if USE_MASAIC\nuniform ARGS{\n float x_count;\n float y_count;\n};\nvec2 getUvMapPos() {\n float block_w = 1.0 / x_count;\n float block_x_idx = floor(v_uv0.x / block_w);\n float block_h = 1.0 / y_count;\n float block_y_idx = floor(v_uv0.y / block_h);\n return vec2(block_w * (block_x_idx + 0.5), block_h * (block_y_idx + 0.5));\n}\n#endif\nvoid main () {\n vec4 o = vec4(1, 1, 1, 1);\n vec2 realPos = v_uv0;\n #if USE_MASAIC\n realPos = getUvMapPos();\n #endif\n o *= texture(texture, realPos);\n o *= v_color;\n gl_FragColor = o;\n}" + } + } + ], + "subMetas": {} +} \ No newline at end of file diff --git a/assets/Scene/Mosaic/Mosaic.fire b/assets/Scene/Mosaic/Mosaic.fire new file mode 100644 index 0000000..86ede22 --- /dev/null +++ b/assets/Scene/Mosaic/Mosaic.fire @@ -0,0 +1,2092 @@ +[ + { + "__type__": "cc.SceneAsset", + "_name": "", + "_objFlags": 0, + "_native": "", + "scene": { + "__id__": 1 + } + }, + { + "__type__": "cc.Scene", + "_objFlags": 0, + "_parent": null, + "_children": [ + { + "__id__": 2 + } + ], + "_active": true, + "_components": [], + "_prefab": null, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 0, + "height": 0 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1 + ] + }, + "_is3DNode": true, + "_groupIndex": 0, + "groupIndex": 0, + "autoReleaseAssets": false, + "_id": "9708c3cd-9189-4481-a85e-7200d9e89417" + }, + { + "__type__": "cc.Node", + "_name": "Canvas", + "_objFlags": 0, + "_parent": { + "__id__": 1 + }, + "_children": [ + { + "__id__": 3 + }, + { + "__id__": 5 + }, + { + "__id__": 8 + }, + { + "__id__": 10 + }, + { + "__id__": 20 + }, + { + "__id__": 31 + } + ], + "_active": true, + "_components": [ + { + "__id__": 42 + }, + { + "__id__": 43 + }, + { + "__id__": 44 + } + ], + "_prefab": null, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 1334, + "height": 750 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + 667, + 375, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1 + ] + }, + "_eulerAngles": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_skewX": 0, + "_skewY": 0, + "_is3DNode": false, + "_groupIndex": 0, + "groupIndex": 0, + "_id": "a5esZu+45LA5mBpvttspPD" + }, + { + "__type__": "cc.Node", + "_name": "Main Camera", + "_objFlags": 0, + "_parent": { + "__id__": 2 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 4 + } + ], + "_prefab": null, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 1334, + "height": 750 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + 0, + 0, + 452.93128617926146, + 0, + 0, + 0, + 1, + 1, + 1, + 1 + ] + }, + "_eulerAngles": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_skewX": 0, + "_skewY": 0, + "_is3DNode": false, + "_groupIndex": 0, + "groupIndex": 0, + "_id": "e1WoFrQ79G7r4ZuQE3HlNb" + }, + { + "__type__": "cc.Camera", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 3 + }, + "_enabled": true, + "_cullingMask": 4294967295, + "_clearFlags": 7, + "_backgroundColor": { + "__type__": "cc.Color", + "r": 0, + "g": 0, + "b": 0, + "a": 255 + }, + "_depth": -1, + "_zoomRatio": 1, + "_targetTexture": null, + "_fov": 60, + "_orthoSize": 10, + "_nearClip": 1, + "_farClip": 4096, + "_ortho": true, + "_rect": { + "__type__": "cc.Rect", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + "_renderStages": 1, + "_alignWithScreen": true, + "_id": "81GN3uXINKVLeW4+iKSlim" + }, + { + "__type__": "cc.Node", + "_name": "bg", + "_objFlags": 0, + "_parent": { + "__id__": 2 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 6 + }, + { + "__id__": 7 + } + ], + "_prefab": null, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 1334, + "height": 750 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1 + ] + }, + "_eulerAngles": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_skewX": 0, + "_skewY": 0, + "_is3DNode": false, + "_groupIndex": 0, + "groupIndex": 0, + "_id": "c20zL0WxNIVY5AQDy7Pssg" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 5 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + } + ], + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_spriteFrame": { + "__uuid__": "73a9939f-c882-4bdb-a6b4-7384bd4f32a3" + }, + "_type": 0, + "_sizeMode": 0, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_atlas": null, + "_id": "b5bfK4oF5NzK2bTz3cq41q" + }, + { + "__type__": "cc.Widget", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 5 + }, + "_enabled": true, + "alignMode": 1, + "_target": null, + "_alignFlags": 45, + "_left": 0, + "_right": 0, + "_top": 0, + "_bottom": 0, + "_verticalCenter": 0, + "_horizontalCenter": 0, + "_isAbsLeft": true, + "_isAbsRight": true, + "_isAbsTop": true, + "_isAbsBottom": true, + "_isAbsHorizontalCenter": true, + "_isAbsVerticalCenter": true, + "_originalWidth": 2, + "_originalHeight": 2, + "_id": "4bVwtTLlFCgZk5XUJBjoxM" + }, + { + "__type__": "cc.Node", + "_name": "npc", + "_objFlags": 0, + "_parent": { + "__id__": 2 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 9 + } + ], + "_prefab": null, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 361, + "height": 458 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + -175.877, + 0, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1 + ] + }, + "_eulerAngles": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_skewX": 0, + "_skewY": 0, + "_is3DNode": false, + "_groupIndex": 0, + "groupIndex": 0, + "_id": "ea6IVEvMRKmpcOfAkHPkN4" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 8 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "67dbc9c2-8d9f-4267-b0ac-79eac5cd2077" + } + ], + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_spriteFrame": { + "__uuid__": "8e6013be-9ce2-4cee-bebe-6d94b901ccfe" + }, + "_type": 0, + "_sizeMode": 1, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_atlas": null, + "_id": "290zu2+NxAaYdieotHwT09" + }, + { + "__type__": "cc.Node", + "_name": "toggle", + "_objFlags": 0, + "_parent": { + "__id__": 2 + }, + "_children": [ + { + "__id__": 11 + }, + { + "__id__": 13 + } + ], + "_active": true, + "_components": [], + "_prefab": null, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 0, + "height": 0 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + 181.288, + 147.002, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1 + ] + }, + "_eulerAngles": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_skewX": 0, + "_skewY": 0, + "_is3DNode": false, + "_groupIndex": 0, + "groupIndex": 0, + "_id": "b4fyL8r9lOPLnSA2607XQ0" + }, + { + "__type__": "cc.Node", + "_name": "label", + "_objFlags": 0, + "_parent": { + "__id__": 10 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 12 + } + ], + "_prefab": null, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 120, + "height": 50.4 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + 1.057, + 0, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1 + ] + }, + "_eulerAngles": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_skewX": 0, + "_skewY": 0, + "_is3DNode": false, + "_groupIndex": 0, + "groupIndex": 0, + "_id": "2bYM4UEXlK1qFIbbcwihs7" + }, + { + "__type__": "cc.Label", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 11 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + } + ], + "_useOriginalSize": false, + "_string": "打码开关", + "_N$string": "打码开关", + "_fontSize": 30, + "_lineHeight": 40, + "_enableWrapText": true, + "_N$file": null, + "_isSystemFontUsed": true, + "_spacingX": 0, + "_batchAsBitmap": false, + "_styleFlags": 0, + "_underlineHeight": 0, + "_N$horizontalAlign": 1, + "_N$verticalAlign": 1, + "_N$fontFamily": "Arial", + "_N$overflow": 0, + "_N$cacheMode": 1, + "_id": "325X8KfsZEbLXkuQb+L4CU" + }, + { + "__type__": "cc.Node", + "_name": "toggle", + "_objFlags": 0, + "_parent": { + "__id__": 10 + }, + "_children": [ + { + "__id__": 14 + }, + { + "__id__": 16 + } + ], + "_active": true, + "_components": [ + { + "__id__": 18 + } + ], + "_prefab": null, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 28, + "height": 28 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + 113.955, + 0, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1 + ] + }, + "_eulerAngles": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_skewX": 0, + "_skewY": 0, + "_is3DNode": false, + "_groupIndex": 0, + "groupIndex": 0, + "_id": "a8Wz5vflBMZLZvcMlB7UVY" + }, + { + "__type__": "cc.Node", + "_name": "Background", + "_objFlags": 0, + "_parent": { + "__id__": 13 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 15 + } + ], + "_prefab": null, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 28, + "height": 28 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1 + ] + }, + "_eulerAngles": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_skewX": 0, + "_skewY": 0, + "_is3DNode": false, + "_groupIndex": 0, + "groupIndex": 0, + "_id": "fcK5jQJHdGHakLPpAO3VR1" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 14 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + } + ], + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_spriteFrame": { + "__uuid__": "6827ca32-0107-4552-bab2-dfb31799bb44" + }, + "_type": 0, + "_sizeMode": 1, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_atlas": null, + "_id": "adBjmyNwtAgrEKkQ8xNv7A" + }, + { + "__type__": "cc.Node", + "_name": "checkmark", + "_objFlags": 0, + "_parent": { + "__id__": 13 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 17 + } + ], + "_prefab": null, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 28, + "height": 28 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1 + ] + }, + "_eulerAngles": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_skewX": 0, + "_skewY": 0, + "_is3DNode": false, + "_groupIndex": 0, + "groupIndex": 0, + "_id": "d6aNzGEVVOPayaSsAWk6cU" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 16 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + } + ], + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_spriteFrame": { + "__uuid__": "90004ad6-2f6d-40e1-93ef-b714375c6f06" + }, + "_type": 0, + "_sizeMode": 2, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": false, + "_atlas": null, + "_id": "fb5KnKxJpKMZyYQ2sU6xYZ" + }, + { + "__type__": "cc.Toggle", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 13 + }, + "_enabled": true, + "_normalMaterial": null, + "_grayMaterial": null, + "duration": 0.1, + "zoomScale": 1.2, + "clickEvents": [], + "_N$interactable": true, + "_N$enableAutoGrayEffect": false, + "_N$transition": 3, + "transition": 3, + "_N$normalColor": { + "__type__": "cc.Color", + "r": 214, + "g": 214, + "b": 214, + "a": 255 + }, + "_N$pressedColor": { + "__type__": "cc.Color", + "r": 211, + "g": 211, + "b": 211, + "a": 255 + }, + "pressedColor": { + "__type__": "cc.Color", + "r": 211, + "g": 211, + "b": 211, + "a": 255 + }, + "_N$hoverColor": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "hoverColor": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_N$disabledColor": { + "__type__": "cc.Color", + "r": 124, + "g": 124, + "b": 124, + "a": 255 + }, + "_N$normalSprite": null, + "_N$pressedSprite": null, + "pressedSprite": null, + "_N$hoverSprite": null, + "hoverSprite": null, + "_N$disabledSprite": null, + "_N$target": { + "__id__": 14 + }, + "_N$isChecked": true, + "toggleGroup": null, + "checkMark": { + "__id__": 17 + }, + "checkEvents": [ + { + "__id__": 19 + } + ], + "_id": "74GLBqTKJGMrQlvK++8rRD" + }, + { + "__type__": "cc.ClickEvent", + "target": { + "__id__": 2 + }, + "component": "", + "_componentId": "e6cdawfgB1DSKkHRoeo2dHy", + "handler": "togglePixel", + "customEventData": "" + }, + { + "__type__": "cc.Node", + "_name": "direction_x", + "_objFlags": 0, + "_parent": { + "__id__": 2 + }, + "_children": [ + { + "__id__": 21 + }, + { + "__id__": 23 + } + ], + "_active": true, + "_components": [], + "_prefab": null, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 0, + "height": 0 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + 210.523, + 34.936, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1 + ] + }, + "_eulerAngles": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_skewX": 0, + "_skewY": 0, + "_is3DNode": false, + "_groupIndex": 0, + "groupIndex": 0, + "_id": "2aMy+uSOdMxa+tBVmB2zxt" + }, + { + "__type__": "cc.Node", + "_name": "tip", + "_objFlags": 0, + "_parent": { + "__id__": 20 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 22 + } + ], + "_prefab": null, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 240, + "height": 50.4 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + 31.968, + 0, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1 + ] + }, + "_eulerAngles": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_skewX": 0, + "_skewY": 0, + "_is3DNode": false, + "_groupIndex": 0, + "groupIndex": 0, + "_id": "48wyEYYAZDALDveLRXvA9n" + }, + { + "__type__": "cc.Label", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 21 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + } + ], + "_useOriginalSize": false, + "_string": "水平方向格子数量", + "_N$string": "水平方向格子数量", + "_fontSize": 30, + "_lineHeight": 40, + "_enableWrapText": true, + "_N$file": null, + "_isSystemFontUsed": true, + "_spacingX": 0, + "_batchAsBitmap": false, + "_styleFlags": 0, + "_underlineHeight": 0, + "_N$horizontalAlign": 1, + "_N$verticalAlign": 1, + "_N$fontFamily": "Arial", + "_N$overflow": 0, + "_N$cacheMode": 1, + "_id": "34mGvrFsZBaozE5qJAmMuD" + }, + { + "__type__": "cc.Node", + "_name": "slider", + "_objFlags": 0, + "_parent": { + "__id__": 20 + }, + "_children": [ + { + "__id__": 24 + }, + { + "__id__": 26 + } + ], + "_active": true, + "_components": [ + { + "__id__": 29 + } + ], + "_prefab": null, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 300, + "height": 20 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + 59.055, + -54.647, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1 + ] + }, + "_eulerAngles": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_skewX": 0, + "_skewY": 0, + "_is3DNode": false, + "_groupIndex": 0, + "groupIndex": 0, + "_id": "69YxRZEBtBXaquQ7WEt21b" + }, + { + "__type__": "cc.Node", + "_name": "Background", + "_objFlags": 0, + "_parent": { + "__id__": 23 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 25 + } + ], + "_prefab": null, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 300, + "height": 20 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1 + ] + }, + "_eulerAngles": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_skewX": 0, + "_skewY": 0, + "_is3DNode": false, + "_groupIndex": 0, + "groupIndex": 0, + "_id": "adnwtghX9EJo7rm8pTOHlD" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 24 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + } + ], + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_spriteFrame": { + "__uuid__": "31d8962d-babb-4ec7-be19-8e9f54a4ea99" + }, + "_type": 1, + "_sizeMode": 0, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_atlas": null, + "_id": "daLqUKBtZFLI2ikyZCmzhv" + }, + { + "__type__": "cc.Node", + "_name": "Handle", + "_objFlags": 0, + "_parent": { + "__id__": 23 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 27 + }, + { + "__id__": 28 + } + ], + "_prefab": null, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 32, + "height": 32 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1 + ] + }, + "_eulerAngles": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_skewX": 0, + "_skewY": 0, + "_is3DNode": false, + "_groupIndex": 0, + "groupIndex": 0, + "_id": "1cBVxrAFhBpKmiH5d+Cgc2" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 26 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + } + ], + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_spriteFrame": { + "__uuid__": "e7aba14b-f956-4480-b254-8d57832e273f" + }, + "_type": 1, + "_sizeMode": 2, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_atlas": null, + "_id": "f7GaZD2E9Bmqwp1fzM/dgl" + }, + { + "__type__": "cc.Button", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 26 + }, + "_enabled": true, + "_normalMaterial": { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + }, + "_grayMaterial": null, + "duration": 0.1, + "zoomScale": 1.1, + "clickEvents": [], + "_N$interactable": true, + "_N$enableAutoGrayEffect": true, + "_N$transition": 3, + "transition": 3, + "_N$normalColor": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_N$pressedColor": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "pressedColor": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_N$hoverColor": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "hoverColor": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_N$disabledColor": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_N$normalSprite": { + "__uuid__": "e7aba14b-f956-4480-b254-8d57832e273f" + }, + "_N$pressedSprite": { + "__uuid__": "e7aba14b-f956-4480-b254-8d57832e273f" + }, + "pressedSprite": { + "__uuid__": "e7aba14b-f956-4480-b254-8d57832e273f" + }, + "_N$hoverSprite": { + "__uuid__": "e7aba14b-f956-4480-b254-8d57832e273f" + }, + "hoverSprite": { + "__uuid__": "e7aba14b-f956-4480-b254-8d57832e273f" + }, + "_N$disabledSprite": { + "__uuid__": "29158224-f8dd-4661-a796-1ffab537140e" + }, + "_N$target": { + "__id__": 26 + }, + "_id": "7f2bMyBkVNBYM7lq+4Dxg5" + }, + { + "__type__": "cc.Slider", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 23 + }, + "_enabled": true, + "direction": 0, + "slideEvents": [ + { + "__id__": 30 + } + ], + "_N$handle": { + "__id__": 28 + }, + "_N$progress": 0.5, + "_id": "29vA4CRbxID6AHsbmGJq3a" + }, + { + "__type__": "cc.ClickEvent", + "target": { + "__id__": 2 + }, + "component": "", + "_componentId": "e6cdawfgB1DSKkHRoeo2dHy", + "handler": "setPixelCount", + "customEventData": "x" + }, + { + "__type__": "cc.Node", + "_name": "direction_y", + "_objFlags": 0, + "_parent": { + "__id__": 2 + }, + "_children": [ + { + "__id__": 32 + }, + { + "__id__": 34 + } + ], + "_active": true, + "_components": [], + "_prefab": null, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 0, + "height": 0 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + 210.523, + -119.694, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1 + ] + }, + "_eulerAngles": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_skewX": 0, + "_skewY": 0, + "_is3DNode": false, + "_groupIndex": 0, + "groupIndex": 0, + "_id": "a8ZPV6DQ1E1qDuudMxt07O" + }, + { + "__type__": "cc.Node", + "_name": "tip", + "_objFlags": 0, + "_parent": { + "__id__": 31 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 33 + } + ], + "_prefab": null, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 240, + "height": 50.4 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + 29.661, + 0, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1 + ] + }, + "_eulerAngles": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_skewX": 0, + "_skewY": 0, + "_is3DNode": false, + "_groupIndex": 0, + "groupIndex": 0, + "_id": "78zwjytMVPCro1tlxvpzB1" + }, + { + "__type__": "cc.Label", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 32 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + } + ], + "_useOriginalSize": false, + "_string": "垂直方向格子数量", + "_N$string": "垂直方向格子数量", + "_fontSize": 30, + "_lineHeight": 40, + "_enableWrapText": true, + "_N$file": null, + "_isSystemFontUsed": true, + "_spacingX": 0, + "_batchAsBitmap": false, + "_styleFlags": 0, + "_underlineHeight": 0, + "_N$horizontalAlign": 1, + "_N$verticalAlign": 1, + "_N$fontFamily": "Arial", + "_N$overflow": 0, + "_N$cacheMode": 1, + "_id": "8cDlzttJFKXL9lL0pwPff/" + }, + { + "__type__": "cc.Node", + "_name": "slider", + "_objFlags": 0, + "_parent": { + "__id__": 31 + }, + "_children": [ + { + "__id__": 35 + }, + { + "__id__": 37 + } + ], + "_active": true, + "_components": [ + { + "__id__": 40 + } + ], + "_prefab": null, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 300, + "height": 20 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + 59.055, + -54.647, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1 + ] + }, + "_eulerAngles": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_skewX": 0, + "_skewY": 0, + "_is3DNode": false, + "_groupIndex": 0, + "groupIndex": 0, + "_id": "79JWsv/1ZBfK8kY+Z1eOZ/" + }, + { + "__type__": "cc.Node", + "_name": "Background", + "_objFlags": 0, + "_parent": { + "__id__": 34 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 36 + } + ], + "_prefab": null, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 300, + "height": 20 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1 + ] + }, + "_eulerAngles": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_skewX": 0, + "_skewY": 0, + "_is3DNode": false, + "_groupIndex": 0, + "groupIndex": 0, + "_id": "c9gPxazkRKOKIuBr1BJFfm" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 35 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + } + ], + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_spriteFrame": { + "__uuid__": "31d8962d-babb-4ec7-be19-8e9f54a4ea99" + }, + "_type": 1, + "_sizeMode": 0, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_atlas": null, + "_id": "5ct0FCY2RCw57D/ZuwmjMf" + }, + { + "__type__": "cc.Node", + "_name": "Handle", + "_objFlags": 0, + "_parent": { + "__id__": 34 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 38 + }, + { + "__id__": 39 + } + ], + "_prefab": null, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 32, + "height": 32 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1 + ] + }, + "_eulerAngles": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_skewX": 0, + "_skewY": 0, + "_is3DNode": false, + "_groupIndex": 0, + "groupIndex": 0, + "_id": "3fWyQ/7LxGYKK42ZfCZHk2" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 37 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + } + ], + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_spriteFrame": { + "__uuid__": "e7aba14b-f956-4480-b254-8d57832e273f" + }, + "_type": 1, + "_sizeMode": 2, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_atlas": null, + "_id": "eaPwjBImJAYI/tBYmc8rsw" + }, + { + "__type__": "cc.Button", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 37 + }, + "_enabled": true, + "_normalMaterial": { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + }, + "_grayMaterial": null, + "duration": 0.1, + "zoomScale": 1.1, + "clickEvents": [], + "_N$interactable": true, + "_N$enableAutoGrayEffect": true, + "_N$transition": 3, + "transition": 3, + "_N$normalColor": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_N$pressedColor": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "pressedColor": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_N$hoverColor": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "hoverColor": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_N$disabledColor": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_N$normalSprite": { + "__uuid__": "e7aba14b-f956-4480-b254-8d57832e273f" + }, + "_N$pressedSprite": { + "__uuid__": "e7aba14b-f956-4480-b254-8d57832e273f" + }, + "pressedSprite": { + "__uuid__": "e7aba14b-f956-4480-b254-8d57832e273f" + }, + "_N$hoverSprite": { + "__uuid__": "e7aba14b-f956-4480-b254-8d57832e273f" + }, + "hoverSprite": { + "__uuid__": "e7aba14b-f956-4480-b254-8d57832e273f" + }, + "_N$disabledSprite": { + "__uuid__": "29158224-f8dd-4661-a796-1ffab537140e" + }, + "_N$target": { + "__id__": 37 + }, + "_id": "53BBdpGttBwbXQVkOEe3wa" + }, + { + "__type__": "cc.Slider", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 34 + }, + "_enabled": true, + "direction": 0, + "slideEvents": [ + { + "__id__": 41 + } + ], + "_N$handle": { + "__id__": 39 + }, + "_N$progress": 0.5, + "_id": "302iClx4tCk5hYCJEDJ5F6" + }, + { + "__type__": "cc.ClickEvent", + "target": { + "__id__": 2 + }, + "component": "", + "_componentId": "e6cdawfgB1DSKkHRoeo2dHy", + "handler": "setPixelCount", + "customEventData": "y" + }, + { + "__type__": "cc.Canvas", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 2 + }, + "_enabled": true, + "_designResolution": { + "__type__": "cc.Size", + "width": 1334, + "height": 750 + }, + "_fitWidth": false, + "_fitHeight": true, + "_id": "59Cd0ovbdF4byw5sbjJDx7" + }, + { + "__type__": "cc.Widget", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 2 + }, + "_enabled": true, + "alignMode": 1, + "_target": null, + "_alignFlags": 45, + "_left": 0, + "_right": 0, + "_top": 0, + "_bottom": 0, + "_verticalCenter": 0, + "_horizontalCenter": 0, + "_isAbsLeft": true, + "_isAbsRight": true, + "_isAbsTop": true, + "_isAbsBottom": true, + "_isAbsHorizontalCenter": true, + "_isAbsVerticalCenter": true, + "_originalWidth": 0, + "_originalHeight": 0, + "_id": "29zXboiXFBKoIV4PQ2liTe" + }, + { + "__type__": "e6cdawfgB1DSKkHRoeo2dHy", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 2 + }, + "_enabled": true, + "_id": "75puEmhk1KJZvqujGNOy33" + } +] \ No newline at end of file diff --git a/assets/Scene/Mosaic/Mosaic.fire.meta b/assets/Scene/Mosaic/Mosaic.fire.meta new file mode 100644 index 0000000..4f59fe7 --- /dev/null +++ b/assets/Scene/Mosaic/Mosaic.fire.meta @@ -0,0 +1,7 @@ +{ + "ver": "1.2.6", + "uuid": "9708c3cd-9189-4481-a85e-7200d9e89417", + "asyncLoadAssets": false, + "autoReleaseAssets": false, + "subMetas": {} +} \ No newline at end of file diff --git a/assets/Scene/Mosaic/Mosaic.mtl b/assets/Scene/Mosaic/Mosaic.mtl new file mode 100644 index 0000000..dad05f3 --- /dev/null +++ b/assets/Scene/Mosaic/Mosaic.mtl @@ -0,0 +1,22 @@ +{ + "__type__": "cc.Material", + "_name": "Mosaic", + "_objFlags": 0, + "_native": "", + "_effectAsset": { + "__uuid__": "a94a99c8-625f-4aef-8960-e983d429d3a6" + }, + "_techniqueIndex": 0, + "_techniqueData": { + "0": { + "props": { + "x_count": 100, + "y_count": 100 + }, + "defines": { + "USE_TEXTURE": true, + "USE_MASAIC": true + } + } + } +} \ No newline at end of file diff --git a/assets/Scene/Mosaic/Mosaic.mtl.meta b/assets/Scene/Mosaic/Mosaic.mtl.meta new file mode 100644 index 0000000..c74dd97 --- /dev/null +++ b/assets/Scene/Mosaic/Mosaic.mtl.meta @@ -0,0 +1,6 @@ +{ + "ver": "1.0.3", + "uuid": "67dbc9c2-8d9f-4267-b0ac-79eac5cd2077", + "dataAsSubAsset": null, + "subMetas": {} +} \ No newline at end of file diff --git a/assets/Scene/Mosaic/Mosaic.ts b/assets/Scene/Mosaic/Mosaic.ts new file mode 100644 index 0000000..578d801 --- /dev/null +++ b/assets/Scene/Mosaic/Mosaic.ts @@ -0,0 +1,18 @@ +const { ccclass, property } = cc._decorator; + +@ccclass +export default class Mosaic extends cc.Component { + material: cc.Material = null; + + onLoad() { + this.material = this.node.getChildByName('npc').getComponent(cc.Sprite).getMaterial(0); + } + + setPixelCount(slide: cc.Slider, type: 'x' | 'y') { + this.material.setProperty(`${type}_count`, Math.floor(slide.progress * 100)); + } + + togglePixel(toggle: cc.Toggle) { + this.material.define('USE_MASAIC', toggle.isChecked, 0, true); + } +} diff --git a/assets/Scene/Mosaic/Mosaic.ts.meta b/assets/Scene/Mosaic/Mosaic.ts.meta new file mode 100644 index 0000000..6f3e47a --- /dev/null +++ b/assets/Scene/Mosaic/Mosaic.ts.meta @@ -0,0 +1,9 @@ +{ + "ver": "1.0.5", + "uuid": "e6cdac1f-801d-4348-a907-4687a8d9d1f2", + "isPlugin": false, + "loadPluginInWeb": true, + "loadPluginInNative": true, + "loadPluginInEditor": false, + "subMetas": {} +} \ No newline at end of file diff --git a/assets/Scene/Mosaic/Texture.meta b/assets/Scene/Mosaic/Texture.meta new file mode 100644 index 0000000..efd5204 --- /dev/null +++ b/assets/Scene/Mosaic/Texture.meta @@ -0,0 +1,7 @@ +{ + "ver": "1.0.1", + "uuid": "bc34001f-7af6-4bb4-a663-2e1850c181c9", + "isSubpackage": false, + "subpackageName": "", + "subMetas": {} +} \ No newline at end of file diff --git a/assets/Scene/Mosaic/Texture/bg.png b/assets/Scene/Mosaic/Texture/bg.png new file mode 100644 index 0000000..e624a70 Binary files /dev/null and b/assets/Scene/Mosaic/Texture/bg.png differ diff --git a/assets/Scene/Mosaic/Texture/bg.png.meta b/assets/Scene/Mosaic/Texture/bg.png.meta new file mode 100644 index 0000000..fb080a5 --- /dev/null +++ b/assets/Scene/Mosaic/Texture/bg.png.meta @@ -0,0 +1,36 @@ +{ + "ver": "2.3.4", + "uuid": "ab0995ce-a9ef-4247-a848-d4bd77db5258", + "type": "sprite", + "wrapMode": "clamp", + "filterMode": "bilinear", + "premultiplyAlpha": false, + "genMipmaps": false, + "packable": true, + "width": 2, + "height": 2, + "platformSettings": {}, + "subMetas": { + "bg": { + "ver": "1.0.4", + "uuid": "73a9939f-c882-4bdb-a6b4-7384bd4f32a3", + "rawTextureUuid": "ab0995ce-a9ef-4247-a848-d4bd77db5258", + "trimType": "auto", + "trimThreshold": 1, + "rotated": false, + "offsetX": 0, + "offsetY": 0, + "trimX": 0, + "trimY": 0, + "width": 2, + "height": 2, + "rawWidth": 2, + "rawHeight": 2, + "borderTop": 0, + "borderBottom": 0, + "borderLeft": 0, + "borderRight": 0, + "subMetas": {} + } + } +} \ No newline at end of file diff --git a/assets/Scene/Mosaic/Texture/npc.png b/assets/Scene/Mosaic/Texture/npc.png new file mode 100644 index 0000000..36a806f Binary files /dev/null and b/assets/Scene/Mosaic/Texture/npc.png differ diff --git a/assets/Scene/Mosaic/Texture/npc.png.meta b/assets/Scene/Mosaic/Texture/npc.png.meta new file mode 100644 index 0000000..023c273 --- /dev/null +++ b/assets/Scene/Mosaic/Texture/npc.png.meta @@ -0,0 +1,36 @@ +{ + "ver": "2.3.4", + "uuid": "ecdb72e0-ae6f-445f-9513-baac57e1469a", + "type": "sprite", + "wrapMode": "clamp", + "filterMode": "bilinear", + "premultiplyAlpha": false, + "genMipmaps": false, + "packable": false, + "width": 512, + "height": 512, + "platformSettings": {}, + "subMetas": { + "npc": { + "ver": "1.0.4", + "uuid": "8e6013be-9ce2-4cee-bebe-6d94b901ccfe", + "rawTextureUuid": "ecdb72e0-ae6f-445f-9513-baac57e1469a", + "trimType": "auto", + "trimThreshold": 1, + "rotated": false, + "offsetX": -3.5, + "offsetY": -27, + "trimX": 72, + "trimY": 54, + "width": 361, + "height": 458, + "rawWidth": 512, + "rawHeight": 512, + "borderTop": 0, + "borderBottom": 0, + "borderLeft": 0, + "borderRight": 0, + "subMetas": {} + } + } +} \ No newline at end of file diff --git a/doc/footer.md b/doc/footer.md index df09f55..38be04d 100644 --- a/doc/footer.md +++ b/doc/footer.md @@ -1,6 +1,9 @@ 我是异名,你的阅读是我的动力,其他文章链接: +- [水波扩散效果(shader)](https://mp.weixin.qq.com/s/e9WHuwaLKt8qov91D_JVwA) +- [镜面光泽效果(shader)](https://mp.weixin.qq.com/s/zcUvkPuMJT_wA82jCsUXig) - [追光效果(shader)](https://mp.weixin.qq.com/s/YFvMAuMqageplRCp9YYgpQ) - [溶解效果(shader)](https://mp.weixin.qq.com/s/8uu3gyWWMt0gf32XAinl-g) +- [颜色滤镜(shader)](https://mp.weixin.qq.com/s/qxzNOz97818wc9f5khwNyg) - [富文本打字机效果](https://mp.weixin.qq.com/s/WlVBzSgCNTNPD2bxXda-mg) - [子弹跟踪效果](https://mp.weixin.qq.com/s/2egrmJC1AgRXNWuGOIhbXg) - [微信小游戏超出4M之后](https://mp.weixin.qq.com/s/l8MDHMnVl8eVl8U6krBeDw)