mirror of
				https://github.com/smallmain/cocos-enhance-kit.git
				synced 2025-10-31 08:15:24 +00:00 
			
		
		
		
	完善 docs
This commit is contained in:
		
							
								
								
									
										12
									
								
								demo/assets/common/effects.meta
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								demo/assets/common/effects.meta
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,12 @@ | |||||||
|  | { | ||||||
|  |   "ver": "1.1.2", | ||||||
|  |   "uuid": "50a4982f-e892-44a2-9d49-202a0a10a446", | ||||||
|  |   "isBundle": false, | ||||||
|  |   "bundleName": "", | ||||||
|  |   "priority": 1, | ||||||
|  |   "compressionType": {}, | ||||||
|  |   "optimizeHotUpdate": {}, | ||||||
|  |   "inlineSpriteFrames": {}, | ||||||
|  |   "isRemoteBundle": {}, | ||||||
|  |   "subMetas": {} | ||||||
|  | } | ||||||
							
								
								
									
										167
									
								
								demo/assets/common/effects/custom-2d-sprite.effect
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										167
									
								
								demo/assets/common/effects/custom-2d-sprite.effect
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,167 @@ | |||||||
|  | // 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 } | ||||||
|  |         texture2: { value: white } | ||||||
|  |         texture3: { value: white } | ||||||
|  |         texture4: { value: white } | ||||||
|  |         texture5: { value: white } | ||||||
|  |         texture6: { value: white } | ||||||
|  |         texture7: { value: white } | ||||||
|  |         texture8: { value: white } | ||||||
|  |         alphaThreshold: { value: 0.5 } | ||||||
|  |         wh_ratio: { | ||||||
|  |           value: 1, | ||||||
|  |           editor: { | ||||||
|  |             tooltip: "宽高比" | ||||||
|  |           } | ||||||
|  |         } | ||||||
|  |         blur: { | ||||||
|  |           value: 0.35, | ||||||
|  |           editor: { | ||||||
|  |             tooltip: "光圈模糊程度" | ||||||
|  |           } | ||||||
|  |         } | ||||||
|  |         radius: { | ||||||
|  |           value: 0.5, | ||||||
|  |           editor: { | ||||||
|  |             tooltip: "光圈半径" | ||||||
|  |           } | ||||||
|  |         } | ||||||
|  |         center: { | ||||||
|  |           value: [0.5, 0.5], | ||||||
|  |           editor: { | ||||||
|  |             tooltip: "光圈起点" | ||||||
|  |           } | ||||||
|  |         } | ||||||
|  | }% | ||||||
|  |  | ||||||
|  |  | ||||||
|  | CCProgram vs %{ | ||||||
|  |   precision highp float; | ||||||
|  |  | ||||||
|  |   #include <cc-global> | ||||||
|  |   #include <cc-local> | ||||||
|  |    | ||||||
|  |   in vec3 a_position; | ||||||
|  |   in vec4 a_color; | ||||||
|  |   out vec4 v_color; | ||||||
|  |  | ||||||
|  |   #if USE_TEXTURE | ||||||
|  |   in vec2 a_uv0; | ||||||
|  |   out vec2 v_uv0; | ||||||
|  |  | ||||||
|  |   #if USE_MULTI_TEXTURE | ||||||
|  |   in float a_texId; | ||||||
|  |   out float v_texId; | ||||||
|  |   #endif | ||||||
|  |  | ||||||
|  |   #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; | ||||||
|  |  | ||||||
|  |     #if USE_MULTI_TEXTURE | ||||||
|  |     v_texId = a_texId; | ||||||
|  |     #endif | ||||||
|  |      | ||||||
|  |     #endif | ||||||
|  |  | ||||||
|  |     v_color = a_color; | ||||||
|  |  | ||||||
|  |     gl_Position = pos; | ||||||
|  |   } | ||||||
|  | }% | ||||||
|  |  | ||||||
|  |  | ||||||
|  | CCProgram fs %{ | ||||||
|  |   precision highp float; | ||||||
|  |    | ||||||
|  |   #include <alpha-test> | ||||||
|  |   #include <texture> | ||||||
|  |  | ||||||
|  |   in vec4 v_color; | ||||||
|  |  | ||||||
|  |   #if USE_TEXTURE | ||||||
|  |   in vec2 v_uv0; | ||||||
|  |   uniform sampler2D texture; | ||||||
|  |  | ||||||
|  |   #if USE_MULTI_TEXTURE  | ||||||
|  |   in float v_texId; | ||||||
|  |   uniform sampler2D texture2; | ||||||
|  |   uniform sampler2D texture3; | ||||||
|  |   uniform sampler2D texture4; | ||||||
|  |   uniform sampler2D texture5; | ||||||
|  |   uniform sampler2D texture6; | ||||||
|  |   uniform sampler2D texture7; | ||||||
|  |   uniform sampler2D texture8; | ||||||
|  |   #endif | ||||||
|  |    | ||||||
|  |   #endif | ||||||
|  |  | ||||||
|  |   uniform ARGS{ | ||||||
|  |     float radius; | ||||||
|  |     float blur; | ||||||
|  |     vec2 center; | ||||||
|  |     float wh_ratio; | ||||||
|  |   }; | ||||||
|  |  | ||||||
|  |   void main () { | ||||||
|  |     vec4 o = vec4(1, 1, 1, 1); | ||||||
|  |  | ||||||
|  |     #if USE_TEXTURE | ||||||
|  |       #if USE_MULTI_TEXTURE  | ||||||
|  |         if(v_texId < 1.0){ | ||||||
|  |           CCTexture(texture, v_uv0, o); | ||||||
|  |         } else if(v_texId < 2.0){ | ||||||
|  |           CCTexture(texture2, v_uv0, o); | ||||||
|  |         } else if(v_texId < 3.0){ | ||||||
|  |           CCTexture(texture3, v_uv0, o); | ||||||
|  |         } else if(v_texId < 4.0){ | ||||||
|  |           CCTexture(texture4, v_uv0, o); | ||||||
|  |         } else if(v_texId < 5.0){ | ||||||
|  |           CCTexture(texture5, v_uv0, o); | ||||||
|  |         } else if(v_texId < 6.0){ | ||||||
|  |           CCTexture(texture6, v_uv0, o); | ||||||
|  |         } else if(v_texId < 7.0){ | ||||||
|  |           CCTexture(texture7, v_uv0, o); | ||||||
|  |         } else { | ||||||
|  |           CCTexture(texture8, v_uv0, o); | ||||||
|  |         } | ||||||
|  |       #else | ||||||
|  |         CCTexture(texture, v_uv0, o); | ||||||
|  |       #endif | ||||||
|  |     #endif | ||||||
|  |  | ||||||
|  |     o *= v_color; | ||||||
|  |  | ||||||
|  |     ALPHA_TEST(o); | ||||||
|  |  | ||||||
|  |     float circle = radius * radius; | ||||||
|  |     float rx = center.x * wh_ratio; | ||||||
|  |     float ry = center.y; | ||||||
|  |     float dis = (v_uv0.x * wh_ratio - rx) * (v_uv0.x * wh_ratio - rx) + (v_uv0.y  - ry) * (v_uv0.y - ry); | ||||||
|  |  | ||||||
|  |     o.a = smoothstep(circle, circle - blur, dis); | ||||||
|  |     gl_FragColor = o; | ||||||
|  |   } | ||||||
|  | }% | ||||||
							
								
								
									
										17
									
								
								demo/assets/common/effects/custom-2d-sprite.effect.meta
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								demo/assets/common/effects/custom-2d-sprite.effect.meta
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,17 @@ | |||||||
|  | { | ||||||
|  |   "ver": "1.0.25", | ||||||
|  |   "uuid": "3edf42b2-00b8-4d91-9b6d-cae5b403a114", | ||||||
|  |   "compiledShaders": [ | ||||||
|  |     { | ||||||
|  |       "glsl1": { | ||||||
|  |         "vert": "\nprecision highp float;\nuniform mat4 cc_matViewProj;\nuniform mat4 cc_matWorld;\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#if USE_MULTI_TEXTURE\nattribute float a_texId;\nvarying float v_texId;\n#endif\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  #if USE_MULTI_TEXTURE\n  v_texId = a_texId;\n  #endif\n  #endif\n  v_color = a_color;\n  gl_Position = pos;\n}", | ||||||
|  |         "frag": "\nprecision highp float;\n#if USE_ALPHA_TEST\n  uniform float alphaThreshold;\n#endif\nvoid ALPHA_TEST (in vec4 color) {\n  #if USE_ALPHA_TEST\n      if (color.a < alphaThreshold) discard;\n  #endif\n}\nvoid ALPHA_TEST (in float alpha) {\n  #if USE_ALPHA_TEST\n      if (alpha < alphaThreshold) discard;\n  #endif\n}\nvarying vec4 v_color;\n#if USE_TEXTURE\nvarying vec2 v_uv0;\nuniform sampler2D texture;\n#if USE_MULTI_TEXTURE\nvarying float v_texId;\nuniform sampler2D texture2;\nuniform sampler2D texture3;\nuniform sampler2D texture4;\nuniform sampler2D texture5;\nuniform sampler2D texture6;\nuniform sampler2D texture7;\nuniform sampler2D texture8;\n#endif\n#endif\nuniform float radius;\nuniform float blur;\nuniform vec2 center;\nuniform float wh_ratio;\nvoid main () {\n  vec4 o = vec4(1, 1, 1, 1);\n  #if USE_TEXTURE\n    #if USE_MULTI_TEXTURE\n      if(v_texId < 1.0){\n  vec4 texture_tmp = texture2D(texture, v_uv0);\n  #if CC_USE_ALPHA_ATLAS_texture\n      texture_tmp.a *= texture2D(texture, v_uv0 + vec2(0, 0.5)).r;\n  #endif\n  #if INPUT_IS_GAMMA\n    o.rgb *= (texture_tmp.rgb * texture_tmp.rgb);\n    o.a *= texture_tmp.a;\n  #else\n    o *= texture_tmp;\n  #endif\n      } else if(v_texId < 2.0){\n  vec4 texture2_tmp = texture2D(texture2, v_uv0);\n  #if CC_USE_ALPHA_ATLAS_texture2\n      texture2_tmp.a *= texture2D(texture2, v_uv0 + vec2(0, 0.5)).r;\n  #endif\n  #if INPUT_IS_GAMMA\n    o.rgb *= (texture2_tmp.rgb * texture2_tmp.rgb);\n    o.a *= texture2_tmp.a;\n  #else\n    o *= texture2_tmp;\n  #endif\n      } else if(v_texId < 3.0){\n  vec4 texture3_tmp = texture2D(texture3, v_uv0);\n  #if CC_USE_ALPHA_ATLAS_texture3\n      texture3_tmp.a *= texture2D(texture3, v_uv0 + vec2(0, 0.5)).r;\n  #endif\n  #if INPUT_IS_GAMMA\n    o.rgb *= (texture3_tmp.rgb * texture3_tmp.rgb);\n    o.a *= texture3_tmp.a;\n  #else\n    o *= texture3_tmp;\n  #endif\n      } else if(v_texId < 4.0){\n  vec4 texture4_tmp = texture2D(texture4, v_uv0);\n  #if CC_USE_ALPHA_ATLAS_texture4\n      texture4_tmp.a *= texture2D(texture4, v_uv0 + vec2(0, 0.5)).r;\n  #endif\n  #if INPUT_IS_GAMMA\n    o.rgb *= (texture4_tmp.rgb * texture4_tmp.rgb);\n    o.a *= texture4_tmp.a;\n  #else\n    o *= texture4_tmp;\n  #endif\n      } else if(v_texId < 5.0){\n  vec4 texture5_tmp = texture2D(texture5, v_uv0);\n  #if CC_USE_ALPHA_ATLAS_texture5\n      texture5_tmp.a *= texture2D(texture5, v_uv0 + vec2(0, 0.5)).r;\n  #endif\n  #if INPUT_IS_GAMMA\n    o.rgb *= (texture5_tmp.rgb * texture5_tmp.rgb);\n    o.a *= texture5_tmp.a;\n  #else\n    o *= texture5_tmp;\n  #endif\n      } else if(v_texId < 6.0){\n  vec4 texture6_tmp = texture2D(texture6, v_uv0);\n  #if CC_USE_ALPHA_ATLAS_texture6\n      texture6_tmp.a *= texture2D(texture6, v_uv0 + vec2(0, 0.5)).r;\n  #endif\n  #if INPUT_IS_GAMMA\n    o.rgb *= (texture6_tmp.rgb * texture6_tmp.rgb);\n    o.a *= texture6_tmp.a;\n  #else\n    o *= texture6_tmp;\n  #endif\n      } else if(v_texId < 7.0){\n  vec4 texture7_tmp = texture2D(texture7, v_uv0);\n  #if CC_USE_ALPHA_ATLAS_texture7\n      texture7_tmp.a *= texture2D(texture7, v_uv0 + vec2(0, 0.5)).r;\n  #endif\n  #if INPUT_IS_GAMMA\n    o.rgb *= (texture7_tmp.rgb * texture7_tmp.rgb);\n    o.a *= texture7_tmp.a;\n  #else\n    o *= texture7_tmp;\n  #endif\n      } else {\n  vec4 texture8_tmp = texture2D(texture8, v_uv0);\n  #if CC_USE_ALPHA_ATLAS_texture8\n      texture8_tmp.a *= texture2D(texture8, v_uv0 + vec2(0, 0.5)).r;\n  #endif\n  #if INPUT_IS_GAMMA\n    o.rgb *= (texture8_tmp.rgb * texture8_tmp.rgb);\n    o.a *= texture8_tmp.a;\n  #else\n    o *= texture8_tmp;\n  #endif\n      }\n    #else\n  vec4 texture_tmp = texture2D(texture, v_uv0);\n  #if CC_USE_ALPHA_ATLAS_texture\n      texture_tmp.a *= texture2D(texture, v_uv0 + vec2(0, 0.5)).r;\n  #endif\n  #if INPUT_IS_GAMMA\n    o.rgb *= (texture_tmp.rgb * texture_tmp.rgb);\n    o.a *= texture_tmp.a;\n  #else\n    o *= texture_tmp;\n  #endif\n    #endif\n  #endif\n  o *= v_color;\n  ALPHA_TEST(o);\n  float circle = radius * radius;\n  float rx = center.x * wh_ratio;\n  float ry = center.y;\n  float dis = (v_uv0.x * wh_ratio - rx) * (v_uv0.x * wh_ratio - rx) + (v_uv0.y  - ry) * (v_uv0.y - ry);\n  o.a = smoothstep(circle, circle - blur, dis);\n  gl_FragColor = o;\n}" | ||||||
|  |       }, | ||||||
|  |       "glsl3": { | ||||||
|  |         "vert": "\nprecision highp float;\nuniform CCGlobal {\n  mat4 cc_matView;\n  mat4 cc_matViewInv;\n  mat4 cc_matProj;\n  mat4 cc_matProjInv;\n  mat4 cc_matViewProj;\n  mat4 cc_matViewProjInv;\n  vec4 cc_cameraPos;\n  vec4 cc_time;\n  mediump vec4 cc_screenSize;\n  mediump vec4 cc_screenScale;\n};\nuniform CCLocal {\n  mat4 cc_matWorld;\n  mat4 cc_matWorldIT;\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#if USE_MULTI_TEXTURE\nin float a_texId;\nout float v_texId;\n#endif\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  #if USE_MULTI_TEXTURE\n  v_texId = a_texId;\n  #endif\n  #endif\n  v_color = a_color;\n  gl_Position = pos;\n}", | ||||||
|  |         "frag": "\nprecision highp float;\n#if USE_ALPHA_TEST\n  uniform ALPHA_TEST {\n    float alphaThreshold;\n  };\n#endif\nvoid ALPHA_TEST (in vec4 color) {\n  #if USE_ALPHA_TEST\n      if (color.a < alphaThreshold) discard;\n  #endif\n}\nvoid ALPHA_TEST (in float alpha) {\n  #if USE_ALPHA_TEST\n      if (alpha < alphaThreshold) discard;\n  #endif\n}\nin vec4 v_color;\n#if USE_TEXTURE\nin vec2 v_uv0;\nuniform sampler2D texture;\n#if USE_MULTI_TEXTURE\nin float v_texId;\nuniform sampler2D texture2;\nuniform sampler2D texture3;\nuniform sampler2D texture4;\nuniform sampler2D texture5;\nuniform sampler2D texture6;\nuniform sampler2D texture7;\nuniform sampler2D texture8;\n#endif\n#endif\nuniform ARGS{\n  float radius;\n  float blur;\n  vec2 center;\n  float wh_ratio;\n};\nvoid main () {\n  vec4 o = vec4(1, 1, 1, 1);\n  #if USE_TEXTURE\n    #if USE_MULTI_TEXTURE\n      if(v_texId < 1.0){\n  vec4 texture_tmp = texture(texture, v_uv0);\n  #if CC_USE_ALPHA_ATLAS_texture\n      texture_tmp.a *= texture(texture, v_uv0 + vec2(0, 0.5)).r;\n  #endif\n  #if INPUT_IS_GAMMA\n    o.rgb *= (texture_tmp.rgb * texture_tmp.rgb);\n    o.a *= texture_tmp.a;\n  #else\n    o *= texture_tmp;\n  #endif\n      } else if(v_texId < 2.0){\n  vec4 texture2_tmp = texture(texture2, v_uv0);\n  #if CC_USE_ALPHA_ATLAS_texture2\n      texture2_tmp.a *= texture(texture2, v_uv0 + vec2(0, 0.5)).r;\n  #endif\n  #if INPUT_IS_GAMMA\n    o.rgb *= (texture2_tmp.rgb * texture2_tmp.rgb);\n    o.a *= texture2_tmp.a;\n  #else\n    o *= texture2_tmp;\n  #endif\n      } else if(v_texId < 3.0){\n  vec4 texture3_tmp = texture(texture3, v_uv0);\n  #if CC_USE_ALPHA_ATLAS_texture3\n      texture3_tmp.a *= texture(texture3, v_uv0 + vec2(0, 0.5)).r;\n  #endif\n  #if INPUT_IS_GAMMA\n    o.rgb *= (texture3_tmp.rgb * texture3_tmp.rgb);\n    o.a *= texture3_tmp.a;\n  #else\n    o *= texture3_tmp;\n  #endif\n      } else if(v_texId < 4.0){\n  vec4 texture4_tmp = texture(texture4, v_uv0);\n  #if CC_USE_ALPHA_ATLAS_texture4\n      texture4_tmp.a *= texture(texture4, v_uv0 + vec2(0, 0.5)).r;\n  #endif\n  #if INPUT_IS_GAMMA\n    o.rgb *= (texture4_tmp.rgb * texture4_tmp.rgb);\n    o.a *= texture4_tmp.a;\n  #else\n    o *= texture4_tmp;\n  #endif\n      } else if(v_texId < 5.0){\n  vec4 texture5_tmp = texture(texture5, v_uv0);\n  #if CC_USE_ALPHA_ATLAS_texture5\n      texture5_tmp.a *= texture(texture5, v_uv0 + vec2(0, 0.5)).r;\n  #endif\n  #if INPUT_IS_GAMMA\n    o.rgb *= (texture5_tmp.rgb * texture5_tmp.rgb);\n    o.a *= texture5_tmp.a;\n  #else\n    o *= texture5_tmp;\n  #endif\n      } else if(v_texId < 6.0){\n  vec4 texture6_tmp = texture(texture6, v_uv0);\n  #if CC_USE_ALPHA_ATLAS_texture6\n      texture6_tmp.a *= texture(texture6, v_uv0 + vec2(0, 0.5)).r;\n  #endif\n  #if INPUT_IS_GAMMA\n    o.rgb *= (texture6_tmp.rgb * texture6_tmp.rgb);\n    o.a *= texture6_tmp.a;\n  #else\n    o *= texture6_tmp;\n  #endif\n      } else if(v_texId < 7.0){\n  vec4 texture7_tmp = texture(texture7, v_uv0);\n  #if CC_USE_ALPHA_ATLAS_texture7\n      texture7_tmp.a *= texture(texture7, v_uv0 + vec2(0, 0.5)).r;\n  #endif\n  #if INPUT_IS_GAMMA\n    o.rgb *= (texture7_tmp.rgb * texture7_tmp.rgb);\n    o.a *= texture7_tmp.a;\n  #else\n    o *= texture7_tmp;\n  #endif\n      } else {\n  vec4 texture8_tmp = texture(texture8, v_uv0);\n  #if CC_USE_ALPHA_ATLAS_texture8\n      texture8_tmp.a *= texture(texture8, v_uv0 + vec2(0, 0.5)).r;\n  #endif\n  #if INPUT_IS_GAMMA\n    o.rgb *= (texture8_tmp.rgb * texture8_tmp.rgb);\n    o.a *= texture8_tmp.a;\n  #else\n    o *= texture8_tmp;\n  #endif\n      }\n    #else\n  vec4 texture_tmp = texture(texture, v_uv0);\n  #if CC_USE_ALPHA_ATLAS_texture\n      texture_tmp.a *= texture(texture, v_uv0 + vec2(0, 0.5)).r;\n  #endif\n  #if INPUT_IS_GAMMA\n    o.rgb *= (texture_tmp.rgb * texture_tmp.rgb);\n    o.a *= texture_tmp.a;\n  #else\n    o *= texture_tmp;\n  #endif\n    #endif\n  #endif\n  o *= v_color;\n  ALPHA_TEST(o);\n  float circle = radius * radius;\n  float rx = center.x * wh_ratio;\n  float ry = center.y;\n  float dis = (v_uv0.x * wh_ratio - rx) * (v_uv0.x * wh_ratio - rx) + (v_uv0.y  - ry) * (v_uv0.y - ry);\n  o.a = smoothstep(circle, circle - blur, dis);\n  gl_FragColor = o;\n}" | ||||||
|  |       } | ||||||
|  |     } | ||||||
|  |   ], | ||||||
|  |   "subMetas": {} | ||||||
|  | } | ||||||
							
								
								
									
										12
									
								
								demo/assets/common/fonts.meta
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								demo/assets/common/fonts.meta
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,12 @@ | |||||||
|  | { | ||||||
|  |   "ver": "1.1.2", | ||||||
|  |   "uuid": "cbc55b3e-df40-4e8f-9499-8ee247cdbf84", | ||||||
|  |   "isBundle": false, | ||||||
|  |   "bundleName": "", | ||||||
|  |   "priority": 1, | ||||||
|  |   "compressionType": {}, | ||||||
|  |   "optimizeHotUpdate": {}, | ||||||
|  |   "inlineSpriteFrames": {}, | ||||||
|  |   "isRemoteBundle": {}, | ||||||
|  |   "subMetas": {} | ||||||
|  | } | ||||||
							
								
								
									
										
											BIN
										
									
								
								demo/assets/common/fonts/SFNSMonoItalic.ttf
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								demo/assets/common/fonts/SFNSMonoItalic.ttf
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										5
									
								
								demo/assets/common/fonts/SFNSMonoItalic.ttf.meta
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								demo/assets/common/fonts/SFNSMonoItalic.ttf.meta
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,5 @@ | |||||||
|  | { | ||||||
|  |   "ver": "1.1.0", | ||||||
|  |   "uuid": "e8aa5e1c-0730-4ebe-81a1-e7fa0db9be7d", | ||||||
|  |   "subMetas": {} | ||||||
|  | } | ||||||
							
								
								
									
										296
									
								
								demo/assets/common/fonts/normalFont.fnt
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										296
									
								
								demo/assets/common/fonts/normalFont.fnt
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,296 @@ | |||||||
|  | info face="Arial" size=64 bold=0 italic=0 charset="" unicode=0 stretchH=100 smooth=1 aa=1 padding=0,0,0,0 spacing=2,2 | ||||||
|  | common lineHeight=72 base=60 scaleW=742 scaleH=786 pages=1 packed=0 | ||||||
|  | page id=0 file="normalFont.png" | ||||||
|  | chars count=196 | ||||||
|  | char id=32     x=446   y=710   width=0     height=0     xoffset=0     yoffset=58    xadvance=18    page=0  chnl=0  letter="space" | ||||||
|  | char id=33     x=328   y=661   width=8     height=47    xoffset=6     yoffset=11    xadvance=18    page=0  chnl=0  letter="!" | ||||||
|  | char id=34     x=284   y=710   width=18    height=18    xoffset=3     yoffset=10    xadvance=23    page=0  chnl=0  letter=""" | ||||||
|  | char id=35     x=221   y=560   width=36    height=49    xoffset=1     yoffset=10    xadvance=36    page=0  chnl=0  letter="#" | ||||||
|  | char id=36     x=59    y=500   width=32    height=58    xoffset=2     yoffset=7     xadvance=36    page=0  chnl=0  letter="$" | ||||||
|  | char id=37     x=661   y=500   width=51    height=50    xoffset=4     yoffset=10    xadvance=57    page=0  chnl=0  letter="%" | ||||||
|  | char id=38     x=139   y=560   width=40    height=49    xoffset=3     yoffset=10    xadvance=43    page=0  chnl=0  letter="&" | ||||||
|  | char id=39     x=304   y=710   width=8     height=18    xoffset=3     yoffset=10    xadvance=12    page=0  chnl=0  letter="'" | ||||||
|  | char id=40     x=109   y=2     width=17    height=62    xoffset=4     yoffset=9     xadvance=21    page=0  chnl=0  letter="(" | ||||||
|  | char id=41     x=128   y=2     width=17    height=62    xoffset=4     yoffset=9     xadvance=21    page=0  chnl=0  letter=")" | ||||||
|  | char id=42     x=260   y=710   width=22    height=21    xoffset=2     yoffset=10    xadvance=25    page=0  chnl=0  letter="*" | ||||||
|  | char id=43     x=162   y=710   width=32    height=32    xoffset=4     yoffset=19    xadvance=37    page=0  chnl=0  letter="+" | ||||||
|  | char id=44     x=314   y=710   width=8     height=17    xoffset=5     yoffset=50    xadvance=18    page=0  chnl=0  letter="," | ||||||
|  | char id=45     x=384   y=710   width=19    height=7     xoffset=2     yoffset=37    xadvance=21    page=0  chnl=0  letter="-" | ||||||
|  | char id=46     x=374   y=710   width=8     height=8     xoffset=6     yoffset=50    xadvance=18    page=0  chnl=0  letter="." | ||||||
|  | char id=47     x=292   y=560   width=19    height=49    xoffset=0     yoffset=10    xadvance=18    page=0  chnl=0  letter="/" | ||||||
|  | char id=48     x=578   y=560   width=31    height=48    xoffset=3     yoffset=11    xadvance=36    page=0  chnl=0  letter="0" | ||||||
|  | char id=49     x=86    y=611   width=18    height=48    xoffset=7     yoffset=10    xadvance=36    page=0  chnl=0  letter="1" | ||||||
|  | char id=50     x=374   y=560   width=32    height=48    xoffset=2     yoffset=10    xadvance=36    page=0  chnl=0  letter="2" | ||||||
|  | char id=51     x=408   y=560   width=32    height=48    xoffset=3     yoffset=11    xadvance=36    page=0  chnl=0  letter="3" | ||||||
|  | char id=52     x=78    y=661   width=33    height=47    xoffset=1     yoffset=11    xadvance=36    page=0  chnl=0  letter="4" | ||||||
|  | char id=53     x=113   y=661   width=32    height=47    xoffset=3     yoffset=12    xadvance=36    page=0  chnl=0  letter="5" | ||||||
|  | char id=54     x=442   y=560   width=32    height=48    xoffset=2     yoffset=11    xadvance=36    page=0  chnl=0  letter="6" | ||||||
|  | char id=55     x=181   y=661   width=31    height=47    xoffset=3     yoffset=11    xadvance=36    page=0  chnl=0  letter="7" | ||||||
|  | char id=56     x=476   y=560   width=32    height=48    xoffset=3     yoffset=11    xadvance=36    page=0  chnl=0  letter="8" | ||||||
|  | char id=57     x=510   y=560   width=32    height=48    xoffset=3     yoffset=11    xadvance=36    page=0  chnl=0  letter="9" | ||||||
|  | char id=58     x=84    y=710   width=8     height=35    xoffset=6     yoffset=23    xadvance=18    page=0  chnl=0  letter=":" | ||||||
|  | char id=59     x=366   y=661   width=8     height=44    xoffset=5     yoffset=23    xadvance=18    page=0  chnl=0  letter=";" | ||||||
|  | char id=60     x=94    y=710   width=32    height=33    xoffset=4     yoffset=18    xadvance=37    page=0  chnl=0  letter="<" | ||||||
|  | char id=61     x=226   y=710   width=32    height=21    xoffset=4     yoffset=24    xadvance=37    page=0  chnl=0  letter="=" | ||||||
|  | char id=62     x=128   y=710   width=32    height=33    xoffset=4     yoffset=18    xadvance=37    page=0  chnl=0  letter=">" | ||||||
|  | char id=63     x=611   y=560   width=31    height=48    xoffset=3     yoffset=10    xadvance=36    page=0  chnl=0  letter="?" | ||||||
|  | char id=64     x=2     y=2     width=61    height=62    xoffset=3     yoffset=9     xadvance=65    page=0  chnl=0  letter="@" | ||||||
|  | char id=65     x=215   y=611   width=44    height=47    xoffset=0     yoffset=11    xadvance=43    page=0  chnl=0  letter="A" | ||||||
|  | char id=66     x=683   y=611   width=36    height=47    xoffset=5     yoffset=11    xadvance=43    page=0  chnl=0  letter="B" | ||||||
|  | char id=67     x=95    y=560   width=42    height=49    xoffset=3     yoffset=10    xadvance=46    page=0  chnl=0  letter="C" | ||||||
|  | char id=68     x=442   y=611   width=39    height=47    xoffset=5     yoffset=11    xadvance=46    page=0  chnl=0  letter="D" | ||||||
|  | char id=69     x=2     y=661   width=36    height=47    xoffset=5     yoffset=11    xadvance=43    page=0  chnl=0  letter="E" | ||||||
|  | char id=70     x=147   y=661   width=32    height=47    xoffset=5     yoffset=11    xadvance=39    page=0  chnl=0  letter="F" | ||||||
|  | char id=71     x=49    y=560   width=44    height=49    xoffset=3     yoffset=10    xadvance=50    page=0  chnl=0  letter="G" | ||||||
|  | char id=72     x=644   y=611   width=37    height=47    xoffset=5     yoffset=11    xadvance=46    page=0  chnl=0  letter="H" | ||||||
|  | char id=73     x=338   y=661   width=8     height=47    xoffset=6     yoffset=11    xadvance=18    page=0  chnl=0  letter="I" | ||||||
|  | char id=74     x=34    y=611   width=27    height=48    xoffset=2     yoffset=11    xadvance=32    page=0  chnl=0  letter="J" | ||||||
|  | char id=75     x=483   y=611   width=39    height=47    xoffset=5     yoffset=11    xadvance=43    page=0  chnl=0  letter="K" | ||||||
|  | char id=76     x=214   y=661   width=30    height=47    xoffset=5     yoffset=11    xadvance=36    page=0  chnl=0  letter="L" | ||||||
|  | char id=77     x=168   y=611   width=45    height=47    xoffset=5     yoffset=11    xadvance=53    page=0  chnl=0  letter="M" | ||||||
|  | char id=78     x=524   y=611   width=38    height=47    xoffset=5     yoffset=11    xadvance=46    page=0  chnl=0  letter="N" | ||||||
|  | char id=79     x=2     y=560   width=45    height=49    xoffset=3     yoffset=10    xadvance=50    page=0  chnl=0  letter="O" | ||||||
|  | char id=80     x=40    y=661   width=36    height=47    xoffset=5     yoffset=11    xadvance=43    page=0  chnl=0  letter="P" | ||||||
|  | char id=81     x=613   y=500   width=46    height=52    xoffset=3     yoffset=10    xadvance=50    page=0  chnl=0  letter="Q" | ||||||
|  | char id=82     x=398   y=611   width=42    height=47    xoffset=5     yoffset=11    xadvance=46    page=0  chnl=0  letter="R" | ||||||
|  | char id=83     x=181   y=560   width=38    height=49    xoffset=3     yoffset=10    xadvance=43    page=0  chnl=0  letter="S" | ||||||
|  | char id=84     x=564   y=611   width=38    height=47    xoffset=2     yoffset=11    xadvance=39    page=0  chnl=0  letter="T" | ||||||
|  | char id=85     x=334   y=560   width=38    height=48    xoffset=5     yoffset=11    xadvance=46    page=0  chnl=0  letter="U" | ||||||
|  | char id=86     x=353   y=611   width=43    height=47    xoffset=0     yoffset=11    xadvance=43    page=0  chnl=0  letter="V" | ||||||
|  | char id=87     x=106   y=611   width=60    height=47    xoffset=1     yoffset=11    xadvance=60    page=0  chnl=0  letter="W" | ||||||
|  | char id=88     x=261   y=611   width=44    height=47    xoffset=0     yoffset=11    xadvance=43    page=0  chnl=0  letter="X" | ||||||
|  | char id=89     x=307   y=611   width=44    height=47    xoffset=0     yoffset=11    xadvance=43    page=0  chnl=0  letter="Y" | ||||||
|  | char id=90     x=604   y=611   width=38    height=47    xoffset=1     yoffset=11    xadvance=39    page=0  chnl=0  letter="Z" | ||||||
|  | char id=91     x=330   y=377   width=14    height=60    xoffset=4     yoffset=11    xadvance=18    page=0  chnl=0  letter="[" | ||||||
|  | char id=92     x=313   y=560   width=19    height=49    xoffset=0     yoffset=10    xadvance=18    page=0  chnl=0  letter="\" | ||||||
|  | char id=93     x=346   y=377   width=14    height=60    xoffset=1     yoffset=11    xadvance=18    page=0  chnl=0  letter="]" | ||||||
|  | char id=94     x=196   y=710   width=28    height=27    xoffset=2     yoffset=9     xadvance=30    page=0  chnl=0  letter="^" | ||||||
|  | char id=95     x=405   y=710   width=39    height=6     xoffset=-1    yoffset=65    xadvance=36    page=0  chnl=0  letter="_" | ||||||
|  | char id=96     x=359   y=710   width=13    height=10    xoffset=3     yoffset=11    xadvance=21    page=0  chnl=0  letter="`" | ||||||
|  | char id=97     x=411   y=661   width=32    height=36    xoffset=2     yoffset=23    xadvance=36    page=0  chnl=0  letter="a" | ||||||
|  | char id=98     x=644   y=560   width=30    height=48    xoffset=4     yoffset=11    xadvance=36    page=0  chnl=0  letter="b" | ||||||
|  | char id=99     x=479   y=661   width=30    height=36    xoffset=3     yoffset=23    xadvance=32    page=0  chnl=0  letter="c" | ||||||
|  | char id=100    x=676   y=560   width=30    height=48    xoffset=2     yoffset=11    xadvance=36    page=0  chnl=0  letter="d" | ||||||
|  | char id=101    x=445   y=661   width=32    height=36    xoffset=2     yoffset=23    xadvance=36    page=0  chnl=0  letter="e" | ||||||
|  | char id=102    x=63    y=611   width=21    height=48    xoffset=1     yoffset=10    xadvance=18    page=0  chnl=0  letter="f" | ||||||
|  | char id=103    x=259   y=560   width=31    height=49    xoffset=2     yoffset=22    xadvance=36    page=0  chnl=0  letter="g" | ||||||
|  | char id=104    x=246   y=661   width=29    height=47    xoffset=4     yoffset=11    xadvance=36    page=0  chnl=0  letter="h" | ||||||
|  | char id=105    x=348   y=661   width=7     height=47    xoffset=4     yoffset=11    xadvance=14    page=0  chnl=0  letter="i" | ||||||
|  | char id=106    x=660   y=66    width=14    height=61    xoffset=-3    yoffset=10    xadvance=14    page=0  chnl=0  letter="j" | ||||||
|  | char id=107    x=277   y=661   width=29    height=47    xoffset=4     yoffset=11    xadvance=32    page=0  chnl=0  letter="k" | ||||||
|  | char id=108    x=357   y=661   width=7     height=47    xoffset=4     yoffset=11    xadvance=14    page=0  chnl=0  letter="l" | ||||||
|  | char id=109    x=591   y=661   width=46    height=35    xoffset=4     yoffset=23    xadvance=53    page=0  chnl=0  letter="m" | ||||||
|  | char id=110    x=2     y=710   width=28    height=35    xoffset=4     yoffset=23    xadvance=36    page=0  chnl=0  letter="n" | ||||||
|  | char id=111    x=376   y=661   width=33    height=36    xoffset=2     yoffset=23    xadvance=36    page=0  chnl=0  letter="o" | ||||||
|  | char id=112    x=708   y=560   width=30    height=48    xoffset=4     yoffset=23    xadvance=36    page=0  chnl=0  letter="p" | ||||||
|  | char id=113    x=2     y=611   width=30    height=48    xoffset=2     yoffset=23    xadvance=36    page=0  chnl=0  letter="q" | ||||||
|  | char id=114    x=62    y=710   width=20    height=35    xoffset=4     yoffset=23    xadvance=21    page=0  chnl=0  letter="r" | ||||||
|  | char id=115    x=511   y=661   width=29    height=36    xoffset=2     yoffset=23    xadvance=32    page=0  chnl=0  letter="s" | ||||||
|  | char id=116    x=308   y=661   width=18    height=47    xoffset=1     yoffset=11    xadvance=18    page=0  chnl=0  letter="t" | ||||||
|  | char id=117    x=32    y=710   width=28    height=35    xoffset=4     yoffset=24    xadvance=36    page=0  chnl=0  letter="u" | ||||||
|  | char id=118    x=674   y=661   width=32    height=35    xoffset=1     yoffset=23    xadvance=32    page=0  chnl=0  letter="v" | ||||||
|  | char id=119    x=542   y=661   width=47    height=35    xoffset=0     yoffset=23    xadvance=46    page=0  chnl=0  letter="w" | ||||||
|  | char id=120    x=639   y=661   width=33    height=35    xoffset=0     yoffset=23    xadvance=32    page=0  chnl=0  letter="x" | ||||||
|  | char id=121    x=544   y=560   width=32    height=48    xoffset=1     yoffset=23    xadvance=32    page=0  chnl=0  letter="y" | ||||||
|  | char id=122    x=708   y=661   width=31    height=35    xoffset=1     yoffset=23    xadvance=32    page=0  chnl=0  letter="z" | ||||||
|  | char id=123    x=65    y=2     width=20    height=62    xoffset=2     yoffset=9     xadvance=21    page=0  chnl=0  letter="{" | ||||||
|  | char id=124    x=147   y=2     width=6     height=62    xoffset=6     yoffset=9     xadvance=17    page=0  chnl=0  letter="|" | ||||||
|  | char id=125    x=87    y=2     width=20    height=62    xoffset=1     yoffset=9     xadvance=21    page=0  chnl=0  letter="}" | ||||||
|  | char id=126    x=324   y=710   width=33    height=12    xoffset=3     yoffset=29    xadvance=37    page=0  chnl=0  letter="~" | ||||||
|  | char id=19978  x=476   y=439   width=58    height=58    xoffset=4     yoffset=4     xadvance=64    page=0  chnl=0  letter="上" | ||||||
|  | char id=20010  x=676   y=66    width=61    height=60    xoffset=2     yoffset=4     xadvance=64    page=0  chnl=0  letter="个" | ||||||
|  | char id=20026  x=118   y=377   width=55    height=60    xoffset=3     yoffset=4     xadvance=64    page=0  chnl=0  letter="为" | ||||||
|  | char id=20080  x=277   y=500   width=57    height=57    xoffset=5     yoffset=8     xadvance=64    page=0  chnl=0  letter="买符" | ||||||
|  | char id=20154  x=2     y=129   width=61    height=60    xoffset=2     yoffset=4     xadvance=64    page=0  chnl=0  letter="人口威望绿料箱金红紫步兵骑弓军曹官武卒" | ||||||
|  | char id=20215  x=65    y=129   width=61    height=60    xoffset=2     yoffset=5     xadvance=64    page=0  chnl=0  letter="价元宝" | ||||||
|  | char id=20302  x=128   y=129   width=61    height=60    xoffset=2     yoffset=5     xadvance=64    page=0  chnl=0  letter="低" | ||||||
|  | char id=20313  x=362   y=377   width=61    height=59    xoffset=2     yoffset=5     xadvance=64    page=0  chnl=0  letter="余时效小" | ||||||
|  | char id=20323  x=307   y=66    width=58    height=61    xoffset=2     yoffset=4     xadvance=64    page=0  chnl=0  letter="佣天" | ||||||
|  | char id=20803  x=155   y=500   width=59    height=57    xoffset=3     yoffset=8     xadvance=64    page=0  chnl=0  letter="元宝" | ||||||
|  | char id=20805  x=490   y=253   width=58    height=60    xoffset=4     yoffset=4     xadvance=64    page=0  chnl=0  letter="充城防人口威望绿料箱金红紫步兵骑弓军曹官武卒" | ||||||
|  | char id=20813  x=2     y=66    width=59    height=61    xoffset=3     yoffset=3     xadvance=64    page=0  chnl=0  letter="免费" | ||||||
|  | char id=20853  x=2     y=253   width=59    height=60    xoffset=3     yoffset=5     xadvance=64    page=0  chnl=0  letter="兵骑弓军曹官武卒" | ||||||
|  | char id=20869  x=175   y=377   width=52    height=60    xoffset=7     yoffset=4     xadvance=64    page=0  chnl=0  letter="内" | ||||||
|  | char id=20891  x=656   y=439   width=57    height=58    xoffset=4     yoffset=7     xadvance=64    page=0  chnl=0  letter="军曹官武卒" | ||||||
|  | char id=20986  x=229   y=377   width=52    height=60    xoffset=7     yoffset=4     xadvance=64    page=0  chnl=0  letter="出" | ||||||
|  | char id=20998  x=632   y=129   width=60    height=60    xoffset=3     yoffset=5     xadvance=64    page=0  chnl=0  letter="分" | ||||||
|  | char id=21015  x=2     y=439   width=57    height=59    xoffset=3     yoffset=5     xadvance=64    page=0  chnl=0  letter="列" | ||||||
|  | char id=21040  x=61    y=439   width=57    height=59    xoffset=3     yoffset=5     xadvance=64    page=0  chnl=0  letter="到" | ||||||
|  | char id=21069  x=63    y=66    width=59    height=61    xoffset=3     yoffset=4     xadvance=64    page=0  chnl=0  letter="前" | ||||||
|  | char id=21097  x=542   y=315   width=57    height=60    xoffset=3     yoffset=5     xadvance=64    page=0  chnl=0  letter="剩余时效小" | ||||||
|  | char id=21160  x=550   y=253   width=58    height=60    xoffset=3     yoffset=5     xadvance=64    page=0  chnl=0  letter="动建造补充城防人口威望绿料箱金红紫步兵骑弓军曹官武卒" | ||||||
|  | char id=21215  x=407   y=2     width=60    height=61    xoffset=3     yoffset=4     xadvance=64    page=0  chnl=0  letter="募" | ||||||
|  | char id=21319  x=610   y=253   width=58    height=60    xoffset=4     yoffset=4     xadvance=64    page=0  chnl=0  letter="升" | ||||||
|  | char id=21330  x=670   y=253   width=58    height=60    xoffset=4     yoffset=4     xadvance=64    page=0  chnl=0  letter="卒" | ||||||
|  | char id=21407  x=216   y=500   width=59    height=57    xoffset=3     yoffset=7     xadvance=64    page=0  chnl=0  letter="原价元宝" | ||||||
|  | char id=21475  x=563   y=500   width=48    height=52    xoffset=9     yoffset=11    xadvance=64    page=0  chnl=0  letter="口威望绿料箱金红紫步兵骑弓军曹官武卒" | ||||||
|  | char id=21487  x=336   y=500   width=59    height=56    xoffset=4     yoffset=8     xadvance=64    page=0  chnl=0  letter="可" | ||||||
|  | char id=21518  x=2     y=191   width=60    height=60    xoffset=2     yoffset=4     xadvance=64    page=0  chnl=0  letter="后" | ||||||
|  | char id=22478  x=191   y=129   width=61    height=60    xoffset=2     yoffset=4     xadvance=64    page=0  chnl=0  letter="城防人口威望绿料箱金红紫步兵骑弓军曹官武卒" | ||||||
|  | char id=22681  x=64    y=191   width=60    height=60    xoffset=3     yoffset=4     xadvance=64    page=0  chnl=0  letter="墙" | ||||||
|  | char id=22823  x=126   y=191   width=60    height=60    xoffset=3     yoffset=5     xadvance=64    page=0  chnl=0  letter="大" | ||||||
|  | char id=22825  x=93    y=500   width=60    height=57    xoffset=3     yoffset=8     xadvance=64    page=0  chnl=0  letter="天" | ||||||
|  | char id=23041  x=488   y=377   width=60    height=59    xoffset=3     yoffset=5     xadvance=64    page=0  chnl=0  letter="威望绿料箱金红紫步兵骑弓军曹官武卒" | ||||||
|  | char id=23432  x=2     y=377   width=56    height=60    xoffset=5     yoffset=4     xadvance=64    page=0  chnl=0  letter="守" | ||||||
|  | char id=23448  x=546   y=66    width=55    height=61    xoffset=5     yoffset=3     xadvance=64    page=0  chnl=0  letter="官武卒" | ||||||
|  | char id=23453  x=2     y=500   width=55    height=58    xoffset=5     yoffset=5     xadvance=64    page=0  chnl=0  letter="宝" | ||||||
|  | char id=23567  x=425   y=377   width=61    height=59    xoffset=2     yoffset=5     xadvance=64    page=0  chnl=0  letter="小" | ||||||
|  | char id=24050  x=505   y=500   width=56    height=55    xoffset=6     yoffset=7     xadvance=64    page=0  chnl=0  letter="已激活" | ||||||
|  | char id=24065  x=60    y=377   width=56    height=60    xoffset=4     yoffset=5     xadvance=64    page=0  chnl=0  letter="币木材镔铁自动建造补充城防人口威望绿料箱金红紫步兵骑弓军曹官武卒" | ||||||
|  | char id=24182  x=124   y=66    width=59    height=61    xoffset=4     yoffset=4     xadvance=64    page=0  chnl=0  letter="并" | ||||||
|  | char id=24314  x=63    y=253   width=59    height=60    xoffset=4     yoffset=4     xadvance=64    page=0  chnl=0  letter="建造补充城防人口威望绿料箱金红紫步兵骑弓军曹官武卒" | ||||||
|  | char id=24320  x=397   y=500   width=58    height=56    xoffset=4     yoffset=8     xadvance=64    page=0  chnl=0  letter="开" | ||||||
|  | char id=24339  x=457   y=500   width=46    height=56    xoffset=11    yoffset=8     xadvance=64    page=0  chnl=0  letter="弓军曹官武卒" | ||||||
|  | char id=24403  x=178   y=439   width=50    height=59    xoffset=7     yoffset=5     xadvance=64    page=0  chnl=0  letter="当" | ||||||
|  | char id=24449  x=254   y=129   width=61    height=60    xoffset=3     yoffset=4     xadvance=64    page=0  chnl=0  letter="征" | ||||||
|  | char id=24471  x=188   y=191   width=60    height=60    xoffset=2     yoffset=4     xadvance=64    page=0  chnl=0  letter="得" | ||||||
|  | char id=25552  x=250   y=191   width=60    height=60    xoffset=3     yoffset=4     xadvance=64    page=0  chnl=0  letter="提" | ||||||
|  | char id=25910  x=185   y=66    width=59    height=61    xoffset=4     yoffset=4     xadvance=64    page=0  chnl=0  letter="收" | ||||||
|  | char id=25928  x=155   y=2     width=61    height=61    xoffset=2     yoffset=4     xadvance=64    page=0  chnl=0  letter="效果已激活" | ||||||
|  | char id=26009  x=317   y=129   width=61    height=60    xoffset=3     yoffset=4     xadvance=64    page=0  chnl=0  letter="料箱金红紫步兵骑弓军曹官武卒" | ||||||
|  | char id=26102  x=673   y=377   width=58    height=59    xoffset=5     yoffset=5     xadvance=64    page=0  chnl=0  letter="时效小" | ||||||
|  | char id=26361  x=2     y=315   width=58    height=60    xoffset=4     yoffset=4     xadvance=64    page=0  chnl=0  letter="曹官武卒" | ||||||
|  | char id=26368  x=536   y=439   width=58    height=58    xoffset=4     yoffset=7     xadvance=64    page=0  chnl=0  letter="最" | ||||||
|  | char id=26395  x=120   y=439   width=56    height=59    xoffset=4     yoffset=4     xadvance=64    page=0  chnl=0  letter="望绿料箱金红紫步兵骑弓军曹官武卒" | ||||||
|  | char id=26408  x=62    y=315   width=58    height=60    xoffset=4     yoffset=4     xadvance=64    page=0  chnl=0  letter="木材镔铁自动建造补充城防人口威望绿料箱金红紫步兵骑弓军曹官武卒" | ||||||
|  | char id=26426  x=380   y=129   width=61    height=60    xoffset=2     yoffset=5     xadvance=64    page=0  chnl=0  letter="机" | ||||||
|  | char id=26448  x=124   y=253   width=59    height=60    xoffset=2     yoffset=4     xadvance=64    page=0  chnl=0  letter="材镔铁自动建造补充城防人口威望绿料箱金红紫步兵骑弓军曹官武卒" | ||||||
|  | char id=26524  x=230   y=439   width=60    height=58    xoffset=3     yoffset=6     xadvance=64    page=0  chnl=0  letter="果已激活" | ||||||
|  | char id=27425  x=218   y=2     width=61    height=61    xoffset=2     yoffset=4     xadvance=64    page=0  chnl=0  letter="次" | ||||||
|  | char id=27493  x=367   y=66    width=58    height=61    xoffset=4     yoffset=4     xadvance=64    page=0  chnl=0  letter="步兵骑弓军曹官武卒" | ||||||
|  | char id=27494  x=550   y=377   width=60    height=59    xoffset=3     yoffset=5     xadvance=64    page=0  chnl=0  letter="武卒" | ||||||
|  | char id=27599  x=281   y=2     width=61    height=61    xoffset=3     yoffset=3     xadvance=64    page=0  chnl=0  letter="每" | ||||||
|  | char id=27963  x=185   y=253   width=59    height=60    xoffset=3     yoffset=4     xadvance=64    page=0  chnl=0  letter="活" | ||||||
|  | char id=28608  x=443   y=129   width=61    height=60    xoffset=2     yoffset=4     xadvance=64    page=0  chnl=0  letter="激活" | ||||||
|  | char id=28857  x=312   y=191   width=60    height=60    xoffset=3     yoffset=5     xadvance=64    page=0  chnl=0  letter="点" | ||||||
|  | char id=31181  x=122   y=315   width=58    height=60    xoffset=2     yoffset=5     xadvance=64    page=0  chnl=0  letter="种" | ||||||
|  | char id=31526  x=246   y=253   width=59    height=60    xoffset=3     yoffset=4     xadvance=64    page=0  chnl=0  letter="符" | ||||||
|  | char id=31569  x=307   y=253   width=59    height=60    xoffset=3     yoffset=4     xadvance=64    page=0  chnl=0  letter="筑" | ||||||
|  | char id=31574  x=469   y=2     width=60    height=61    xoffset=3     yoffset=4     xadvance=64    page=0  chnl=0  letter="策" | ||||||
|  | char id=31665  x=531   y=2     width=60    height=61    xoffset=2     yoffset=3     xadvance=64    page=0  chnl=0  letter="箱金红紫步兵骑弓军曹官武卒" | ||||||
|  | char id=31918  x=344   y=2     width=61    height=61    xoffset=2     yoffset=3     xadvance=64    page=0  chnl=0  letter="粮草银币木材镔铁自动建造补充城防人口威望绿料箱金红紫步兵骑弓军曹官武卒" | ||||||
|  | char id=32043  x=182   y=315   width=58    height=60    xoffset=3     yoffset=4     xadvance=64    page=0  chnl=0  letter="紫步兵骑弓军曹官武卒" | ||||||
|  | char id=32418  x=354   y=439   width=59    height=58    xoffset=3     yoffset=4     xadvance=64    page=0  chnl=0  letter="红紫步兵骑弓军曹官武卒" | ||||||
|  | char id=32493  x=593   y=2     width=60    height=61    xoffset=3     yoffset=4     xadvance=64    page=0  chnl=0  letter="续费" | ||||||
|  | char id=32511  x=374   y=191   width=60    height=60    xoffset=3     yoffset=4     xadvance=64    page=0  chnl=0  letter="绿料箱金红紫步兵骑弓军曹官武卒" | ||||||
|  | char id=32791  x=436   y=191   width=60    height=60    xoffset=2     yoffset=4     xadvance=64    page=0  chnl=0  letter="耗" | ||||||
|  | char id=33258  x=283   y=377   width=45    height=60    xoffset=10    yoffset=4     xadvance=64    page=0  chnl=0  letter="自动建造补充城防人口威望绿料箱金红紫步兵骑弓军曹官武卒" | ||||||
|  | char id=33457  x=246   y=66    width=59    height=61    xoffset=3     yoffset=4     xadvance=64    page=0  chnl=0  letter="花" | ||||||
|  | char id=33609  x=242   y=315   width=58    height=60    xoffset=4     yoffset=5     xadvance=64    page=0  chnl=0  letter="草银币木材镔铁自动建造补充城防人口威望绿料箱金红紫步兵骑弓军曹官武卒" | ||||||
|  | char id=33719  x=368   y=253   width=59    height=60    xoffset=3     yoffset=4     xadvance=64    page=0  chnl=0  letter="获" | ||||||
|  | char id=33829  x=601   y=315   width=57    height=60    xoffset=4     yoffset=4     xadvance=64    page=0  chnl=0  letter="营" | ||||||
|  | char id=34917  x=498   y=191   width=60    height=60    xoffset=2     yoffset=4     xadvance=64    page=0  chnl=0  letter="补充城防人口威望绿料箱金红紫步兵骑弓军曹官武卒" | ||||||
|  | char id=35745  x=560   y=191   width=60    height=60    xoffset=3     yoffset=5     xadvance=64    page=0  chnl=0  letter="计" | ||||||
|  | char id=36141  x=302   y=315   width=58    height=60    xoffset=3     yoffset=4     xadvance=64    page=0  chnl=0  letter="购买符" | ||||||
|  | char id=36153  x=603   y=66    width=55    height=61    xoffset=5     yoffset=4     xadvance=64    page=0  chnl=0  letter="费" | ||||||
|  | char id=36824  x=612   y=377   width=59    height=59    xoffset=4     yoffset=6     xadvance=64    page=0  chnl=0  letter="还" | ||||||
|  | char id=36896  x=429   y=253   width=59    height=60    xoffset=3     yoffset=5     xadvance=64    page=0  chnl=0  letter="造补充城防人口威望绿料箱金红紫步兵骑弓军曹官武卒" | ||||||
|  | char id=37327  x=415   y=439   width=59    height=58    xoffset=3     yoffset=5     xadvance=64    page=0  chnl=0  letter="量" | ||||||
|  | char id=37329  x=292   y=439   width=60    height=58    xoffset=3     yoffset=5     xadvance=64    page=0  chnl=0  letter="金红紫步兵骑弓军曹官武卒" | ||||||
|  | char id=38047  x=362   y=315   width=58    height=60    xoffset=2     yoffset=5     xadvance=64    page=0  chnl=0  letter="钟" | ||||||
|  | char id=38081  x=506   y=129   width=61    height=60    xoffset=2     yoffset=5     xadvance=64    page=0  chnl=0  letter="铁自动建造补充城防人口威望绿料箱金红紫步兵骑弓军曹官武卒" | ||||||
|  | char id=38134  x=622   y=191   width=60    height=60    xoffset=3     yoffset=4     xadvance=64    page=0  chnl=0  letter="银币木材镔铁自动建造补充城防人口威望绿料箱金红紫步兵骑弓军曹官武卒" | ||||||
|  | char id=38228  x=655   y=2     width=60    height=61    xoffset=2     yoffset=4     xadvance=64    page=0  chnl=0  letter="镔铁自动建造补充城防人口威望绿料箱金红紫步兵骑弓军曹官武卒" | ||||||
|  | char id=38431  x=422   y=315   width=58    height=60    xoffset=6     yoffset=4     xadvance=64    page=0  chnl=0  letter="队" | ||||||
|  | char id=38450  x=487   y=66    width=57    height=61    xoffset=5     yoffset=4     xadvance=64    page=0  chnl=0  letter="防人口威望绿料箱金红紫步兵骑弓军曹官武卒" | ||||||
|  | char id=38477  x=482   y=315   width=58    height=60    xoffset=5     yoffset=4     xadvance=64    page=0  chnl=0  letter="降" | ||||||
|  | char id=38480  x=596   y=439   width=58    height=58    xoffset=5     yoffset=6     xadvance=64    page=0  chnl=0  letter="限" | ||||||
|  | char id=38543  x=660   y=315   width=57    height=60    xoffset=5     yoffset=4     xadvance=64    page=0  chnl=0  letter="随" | ||||||
|  | char id=38599  x=427   y=66    width=58    height=61    xoffset=3     yoffset=3     xadvance=64    page=0  chnl=0  letter="雇佣天" | ||||||
|  | char id=39569  x=569   y=129   width=61    height=60    xoffset=2     yoffset=4     xadvance=64    page=0  chnl=0  letter="骑弓军曹官武卒" | ||||||
|  | kernings count=95 | ||||||
|  | kerning first=84 second=65 amount=-4 | ||||||
|  | kerning first=87 second=58 amount=-1 | ||||||
|  | kerning first=76 second=89 amount=-4 | ||||||
|  | kerning first=89 second=105 amount=-2 | ||||||
|  | kerning first=82 second=87 amount=-1 | ||||||
|  | kerning first=86 second=46 amount=-5 | ||||||
|  | kerning first=86 second=65 amount=-4 | ||||||
|  | kerning first=89 second=59 amount=-4 | ||||||
|  | kerning first=87 second=46 amount=-3 | ||||||
|  | kerning first=87 second=65 amount=-2 | ||||||
|  | kerning first=89 second=112 amount=-4 | ||||||
|  | kerning first=65 second=119 amount=-1 | ||||||
|  | kerning first=80 second=44 amount=-8 | ||||||
|  | kerning first=84 second=79 amount=-1 | ||||||
|  | kerning first=32 second=89 amount=-1 | ||||||
|  | kerning first=49 second=49 amount=-4 | ||||||
|  | kerning first=65 second=84 amount=-4 | ||||||
|  | kerning first=89 second=58 amount=-3 | ||||||
|  | kerning first=80 second=32 amount=-1 | ||||||
|  | kerning first=65 second=118 amount=-1 | ||||||
|  | kerning first=84 second=44 amount=-7 | ||||||
|  | kerning first=89 second=46 amount=-8 | ||||||
|  | kerning first=89 second=65 amount=-4 | ||||||
|  | kerning first=114 second=46 amount=-3 | ||||||
|  | kerning first=84 second=101 amount=-7 | ||||||
|  | kerning first=65 second=87 amount=-2 | ||||||
|  | kerning first=84 second=97 amount=-7 | ||||||
|  | kerning first=82 second=89 amount=-1 | ||||||
|  | kerning first=89 second=118 amount=-3 | ||||||
|  | kerning first=76 second=121 amount=-2 | ||||||
|  | kerning first=86 second=44 amount=-5 | ||||||
|  | kerning first=84 second=32 amount=-1 | ||||||
|  | kerning first=86 second=101 amount=-3 | ||||||
|  | kerning first=87 second=44 amount=-3 | ||||||
|  | kerning first=86 second=97 amount=-4 | ||||||
|  | kerning first=76 second=86 amount=-4 | ||||||
|  | kerning first=87 second=101 amount=-1 | ||||||
|  | kerning first=87 second=97 amount=-2 | ||||||
|  | kerning first=118 second=46 amount=-4 | ||||||
|  | kerning first=70 second=46 amount=-7 | ||||||
|  | kerning first=102 second=102 amount=-1 | ||||||
|  | kerning first=70 second=65 amount=-3 | ||||||
|  | kerning first=84 second=111 amount=-7 | ||||||
|  | kerning first=89 second=113 amount=-5 | ||||||
|  | kerning first=65 second=32 amount=-3 | ||||||
|  | kerning first=89 second=44 amount=-8 | ||||||
|  | kerning first=114 second=44 amount=-3 | ||||||
|  | kerning first=119 second=46 amount=-3 | ||||||
|  | kerning first=86 second=111 amount=-3 | ||||||
|  | kerning first=65 second=89 amount=-4 | ||||||
|  | kerning first=89 second=101 amount=-5 | ||||||
|  | kerning first=84 second=99 amount=-7 | ||||||
|  | kerning first=89 second=97 amount=-4 | ||||||
|  | kerning first=87 second=111 amount=-1 | ||||||
|  | kerning first=84 second=114 amount=-2 | ||||||
|  | kerning first=121 second=46 amount=-4 | ||||||
|  | kerning first=89 second=32 amount=-1 | ||||||
|  | kerning first=84 second=45 amount=-3 | ||||||
|  | kerning first=86 second=114 amount=-2 | ||||||
|  | kerning first=76 second=84 amount=-4 | ||||||
|  | kerning first=118 second=44 amount=-4 | ||||||
|  | kerning first=84 second=121 amount=-3 | ||||||
|  | kerning first=87 second=114 amount=-1 | ||||||
|  | kerning first=84 second=117 amount=-2 | ||||||
|  | kerning first=82 second=86 amount=-1 | ||||||
|  | kerning first=86 second=45 amount=-3 | ||||||
|  | kerning first=70 second=44 amount=-7 | ||||||
|  | kerning first=87 second=45 amount=-1 | ||||||
|  | kerning first=86 second=121 amount=-2 | ||||||
|  | kerning first=86 second=117 amount=-2 | ||||||
|  | kerning first=89 second=111 amount=-5 | ||||||
|  | kerning first=76 second=87 amount=-4 | ||||||
|  | kerning first=84 second=105 amount=-2 | ||||||
|  | kerning first=87 second=117 amount=-1 | ||||||
|  | kerning first=119 second=44 amount=-3 | ||||||
|  | kerning first=84 second=59 amount=-7 | ||||||
|  | kerning first=32 second=65 amount=-3 | ||||||
|  | kerning first=86 second=105 amount=-1 | ||||||
|  | kerning first=32 second=84 amount=-1 | ||||||
|  | kerning first=65 second=121 amount=-1 | ||||||
|  | kerning first=121 second=44 amount=-4 | ||||||
|  | kerning first=80 second=46 amount=-8 | ||||||
|  | kerning first=86 second=59 amount=-2 | ||||||
|  | kerning first=80 second=65 amount=-4 | ||||||
|  | kerning first=89 second=45 amount=-5 | ||||||
|  | kerning first=87 second=59 amount=-1 | ||||||
|  | kerning first=84 second=58 amount=-7 | ||||||
|  | kerning first=65 second=86 amount=-4 | ||||||
|  | kerning first=84 second=119 amount=-3 | ||||||
|  | kerning first=89 second=117 amount=-3 | ||||||
|  | kerning first=82 second=84 amount=-1 | ||||||
|  | kerning first=84 second=115 amount=-7 | ||||||
|  | kerning first=86 second=58 amount=-2 | ||||||
|  | kerning first=76 second=32 amount=-2 | ||||||
|  | kerning first=84 second=46 amount=-7 | ||||||
							
								
								
									
										7
									
								
								demo/assets/common/fonts/normalFont.fnt.meta
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								demo/assets/common/fonts/normalFont.fnt.meta
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,7 @@ | |||||||
|  | { | ||||||
|  |   "ver": "2.1.0", | ||||||
|  |   "uuid": "80011fce-9411-4ea1-a8d3-f7d86d2d8789", | ||||||
|  |   "textureUuid": "45be59f3-5655-4369-9e9f-455c81d2ddd9", | ||||||
|  |   "fontSize": 64, | ||||||
|  |   "subMetas": {} | ||||||
|  | } | ||||||
							
								
								
									
										
											BIN
										
									
								
								demo/assets/common/fonts/normalFont.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								demo/assets/common/fonts/normalFont.png
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| After Width: | Height: | Size: 199 KiB | 
							
								
								
									
										36
									
								
								demo/assets/common/fonts/normalFont.png.meta
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										36
									
								
								demo/assets/common/fonts/normalFont.png.meta
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,36 @@ | |||||||
|  | { | ||||||
|  |   "ver": "2.3.5", | ||||||
|  |   "uuid": "45be59f3-5655-4369-9e9f-455c81d2ddd9", | ||||||
|  |   "type": "sprite", | ||||||
|  |   "wrapMode": "clamp", | ||||||
|  |   "filterMode": "bilinear", | ||||||
|  |   "premultiplyAlpha": false, | ||||||
|  |   "genMipmaps": false, | ||||||
|  |   "packable": true, | ||||||
|  |   "width": 742, | ||||||
|  |   "height": 786, | ||||||
|  |   "platformSettings": {}, | ||||||
|  |   "subMetas": { | ||||||
|  |     "normalFont": { | ||||||
|  |       "ver": "1.0.4", | ||||||
|  |       "uuid": "926aac08-9aad-4893-b1ab-052167293176", | ||||||
|  |       "rawTextureUuid": "45be59f3-5655-4369-9e9f-455c81d2ddd9", | ||||||
|  |       "trimType": "auto", | ||||||
|  |       "trimThreshold": 1, | ||||||
|  |       "rotated": false, | ||||||
|  |       "offsetX": -0.5, | ||||||
|  |       "offsetY": 20, | ||||||
|  |       "trimX": 2, | ||||||
|  |       "trimY": 2, | ||||||
|  |       "width": 737, | ||||||
|  |       "height": 742, | ||||||
|  |       "rawWidth": 742, | ||||||
|  |       "rawHeight": 786, | ||||||
|  |       "borderTop": 0, | ||||||
|  |       "borderBottom": 0, | ||||||
|  |       "borderLeft": 0, | ||||||
|  |       "borderRight": 0, | ||||||
|  |       "subMetas": {} | ||||||
|  |     } | ||||||
|  |   } | ||||||
|  | } | ||||||
							
								
								
									
										12
									
								
								demo/assets/common/materials.meta
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								demo/assets/common/materials.meta
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,12 @@ | |||||||
|  | { | ||||||
|  |   "ver": "1.1.2", | ||||||
|  |   "uuid": "5a439075-0bd8-494f-8742-e6398c12d1b7", | ||||||
|  |   "isBundle": false, | ||||||
|  |   "bundleName": "", | ||||||
|  |   "priority": 1, | ||||||
|  |   "compressionType": {}, | ||||||
|  |   "optimizeHotUpdate": {}, | ||||||
|  |   "inlineSpriteFrames": {}, | ||||||
|  |   "isRemoteBundle": {}, | ||||||
|  |   "subMetas": {} | ||||||
|  | } | ||||||
							
								
								
									
										29
									
								
								demo/assets/common/materials/custom-2d-sprite.mtl
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										29
									
								
								demo/assets/common/materials/custom-2d-sprite.mtl
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,29 @@ | |||||||
|  | { | ||||||
|  |   "__type__": "cc.Material", | ||||||
|  |   "_name": "custom-2d-sprite", | ||||||
|  |   "_objFlags": 0, | ||||||
|  |   "_native": "", | ||||||
|  |   "_effectAsset": { | ||||||
|  |     "__uuid__": "3edf42b2-00b8-4d91-9b6d-cae5b403a114" | ||||||
|  |   }, | ||||||
|  |   "_techniqueIndex": 0, | ||||||
|  |   "_techniqueData": { | ||||||
|  |     "0": { | ||||||
|  |       "defines": { | ||||||
|  |         "USE_TEXTURE": true, | ||||||
|  |         "USE_MULTI_TEXTURE": true | ||||||
|  |       }, | ||||||
|  |       "props": { | ||||||
|  |         "texture": { | ||||||
|  |           "__uuid__": "6231041a-75a5-4af2-a40d-f27e9498901a" | ||||||
|  |         }, | ||||||
|  |         "blur": 0.01, | ||||||
|  |         "wh_ratio": 1, | ||||||
|  |         "radius": 0.45, | ||||||
|  |         "texture2": { | ||||||
|  |           "__uuid__": "6e056173-d285-473c-b206-40a7fff5386e" | ||||||
|  |         } | ||||||
|  |       } | ||||||
|  |     } | ||||||
|  |   } | ||||||
|  | } | ||||||
							
								
								
									
										6
									
								
								demo/assets/common/materials/custom-2d-sprite.mtl.meta
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								demo/assets/common/materials/custom-2d-sprite.mtl.meta
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,6 @@ | |||||||
|  | { | ||||||
|  |   "ver": "1.0.3", | ||||||
|  |   "uuid": "2c0c62f8-3805-4dd1-96c4-977c36bab4fc", | ||||||
|  |   "dataAsSubAsset": null, | ||||||
|  |   "subMetas": {} | ||||||
|  | } | ||||||
							
								
								
									
										12
									
								
								demo/assets/common/spines.meta
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								demo/assets/common/spines.meta
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,12 @@ | |||||||
|  | { | ||||||
|  |   "ver": "1.1.2", | ||||||
|  |   "uuid": "d791af13-cba7-4b15-a4e6-9d2b72b5ba01", | ||||||
|  |   "isBundle": false, | ||||||
|  |   "bundleName": "", | ||||||
|  |   "priority": 1, | ||||||
|  |   "compressionType": {}, | ||||||
|  |   "optimizeHotUpdate": {}, | ||||||
|  |   "inlineSpriteFrames": {}, | ||||||
|  |   "isRemoteBundle": {}, | ||||||
|  |   "subMetas": {} | ||||||
|  | } | ||||||
							
								
								
									
										2412
									
								
								demo/assets/common/spines/spineboy.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										2412
									
								
								demo/assets/common/spines/spineboy.json
									
									
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										9
									
								
								demo/assets/common/spines/spineboy.json.meta
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								demo/assets/common/spines/spineboy.json.meta
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,9 @@ | |||||||
|  | { | ||||||
|  |   "ver": "1.2.3", | ||||||
|  |   "uuid": "bcd99389-a393-426e-b234-157c62b44bc4", | ||||||
|  |   "textures": [ | ||||||
|  |     "d9c4530a-ef05-45c1-b012-eb4686f4c70f" | ||||||
|  |   ], | ||||||
|  |   "scale": 1, | ||||||
|  |   "subMetas": {} | ||||||
|  | } | ||||||
							
								
								
									
										
											BIN
										
									
								
								demo/assets/common/spines/spineboy.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								demo/assets/common/spines/spineboy.png
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| After Width: | Height: | Size: 215 KiB | 
							
								
								
									
										36
									
								
								demo/assets/common/spines/spineboy.png.meta
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										36
									
								
								demo/assets/common/spines/spineboy.png.meta
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,36 @@ | |||||||
|  | { | ||||||
|  |   "ver": "2.3.5", | ||||||
|  |   "uuid": "d9c4530a-ef05-45c1-b012-eb4686f4c70f", | ||||||
|  |   "type": "sprite", | ||||||
|  |   "wrapMode": "clamp", | ||||||
|  |   "filterMode": "bilinear", | ||||||
|  |   "premultiplyAlpha": false, | ||||||
|  |   "genMipmaps": false, | ||||||
|  |   "packable": true, | ||||||
|  |   "width": 1024, | ||||||
|  |   "height": 256, | ||||||
|  |   "platformSettings": {}, | ||||||
|  |   "subMetas": { | ||||||
|  |     "spineboy": { | ||||||
|  |       "ver": "1.0.4", | ||||||
|  |       "uuid": "f23f461c-0a3b-470e-a79b-9ee329e02319", | ||||||
|  |       "rawTextureUuid": "d9c4530a-ef05-45c1-b012-eb4686f4c70f", | ||||||
|  |       "trimType": "auto", | ||||||
|  |       "trimThreshold": 1, | ||||||
|  |       "rotated": false, | ||||||
|  |       "offsetX": -11, | ||||||
|  |       "offsetY": 6, | ||||||
|  |       "trimX": 2, | ||||||
|  |       "trimY": 2, | ||||||
|  |       "width": 998, | ||||||
|  |       "height": 240, | ||||||
|  |       "rawWidth": 1024, | ||||||
|  |       "rawHeight": 256, | ||||||
|  |       "borderTop": 0, | ||||||
|  |       "borderBottom": 0, | ||||||
|  |       "borderLeft": 0, | ||||||
|  |       "borderRight": 0, | ||||||
|  |       "subMetas": {} | ||||||
|  |     } | ||||||
|  |   } | ||||||
|  | } | ||||||
							
								
								
									
										195
									
								
								demo/assets/common/spines/spineboy.txt
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										195
									
								
								demo/assets/common/spines/spineboy.txt
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,195 @@ | |||||||
|  |  | ||||||
|  | spineboy.png | ||||||
|  | size:1024,256 | ||||||
|  | format: RGBA8888 | ||||||
|  | filter: Linear,Linear | ||||||
|  | repeat: none | ||||||
|  | eye_indifferent | ||||||
|  |   rotate: true | ||||||
|  |   xy: 389, 5 | ||||||
|  |   size: 56, 53 | ||||||
|  |   orig: 56, 53 | ||||||
|  |   offset: 0, 0 | ||||||
|  |   index: -1 | ||||||
|  | eye_surprised | ||||||
|  |   rotate: false | ||||||
|  |   xy: 580, 34 | ||||||
|  |   size: 56, 53 | ||||||
|  |   orig: 56, 53 | ||||||
|  |   offset: 0, 0 | ||||||
|  |   index: -1 | ||||||
|  | front_bracer | ||||||
|  |   rotate: false | ||||||
|  |   xy: 732, 85 | ||||||
|  |   size: 35, 48 | ||||||
|  |   orig: 35, 48 | ||||||
|  |   offset: 0, 0 | ||||||
|  |   index: -1 | ||||||
|  | front_fist_closed | ||||||
|  |   rotate: false | ||||||
|  |   xy: 556, 91 | ||||||
|  |   size: 45, 49 | ||||||
|  |   orig: 45, 49 | ||||||
|  |   offset: 0, 0 | ||||||
|  |   index: -1 | ||||||
|  | front_fist_open | ||||||
|  |   rotate: false | ||||||
|  |   xy: 668, 32 | ||||||
|  |   size: 52, 52 | ||||||
|  |   orig: 52, 52 | ||||||
|  |   offset: 0, 0 | ||||||
|  |   index: -1 | ||||||
|  | front_foot | ||||||
|  |   rotate: false | ||||||
|  |   xy: 924, 201 | ||||||
|  |   size: 76, 41 | ||||||
|  |   orig: 76, 41 | ||||||
|  |   offset: 0, 0 | ||||||
|  |   index: -1 | ||||||
|  | front_foot_bend1 | ||||||
|  |   rotate: false | ||||||
|  |   xy: 845, 200 | ||||||
|  |   size: 77, 42 | ||||||
|  |   orig: 77, 42 | ||||||
|  |   offset: 0, 0 | ||||||
|  |   index: -1 | ||||||
|  | front_foot_bend2 | ||||||
|  |   rotate: false | ||||||
|  |   xy: 778, 186 | ||||||
|  |   size: 65, 56 | ||||||
|  |   orig: 65, 56 | ||||||
|  |   offset: 0, 0 | ||||||
|  |   index: -1 | ||||||
|  | front_shin | ||||||
|  |   rotate: true | ||||||
|  |   xy: 444, 91 | ||||||
|  |   size: 49, 110 | ||||||
|  |   orig: 49, 110 | ||||||
|  |   offset: 0, 0 | ||||||
|  |   index: -1 | ||||||
|  | front_thigh | ||||||
|  |   rotate: true | ||||||
|  |   xy: 603, 89 | ||||||
|  |   size: 29, 67 | ||||||
|  |   orig: 29, 67 | ||||||
|  |   offset: 0, 0 | ||||||
|  |   index: -1 | ||||||
|  | front_upper_arm | ||||||
|  |   rotate: true | ||||||
|  |   xy: 672, 86 | ||||||
|  |   size: 32, 58 | ||||||
|  |   orig: 32, 58 | ||||||
|  |   offset: 0, 0 | ||||||
|  |   index: -1 | ||||||
|  | goggles | ||||||
|  |   rotate: false | ||||||
|  |   xy: 444, 142 | ||||||
|  |   size: 157, 100 | ||||||
|  |   orig: 157, 100 | ||||||
|  |   offset: 0, 0 | ||||||
|  |   index: -1 | ||||||
|  | gun | ||||||
|  |   rotate: false | ||||||
|  |   xy: 603, 120 | ||||||
|  |   size: 126, 122 | ||||||
|  |   orig: 126, 122 | ||||||
|  |   offset: 0, 0 | ||||||
|  |   index: -1 | ||||||
|  | head | ||||||
|  |   rotate: false | ||||||
|  |   xy: 279, 63 | ||||||
|  |   size: 163, 179 | ||||||
|  |   orig: 163, 179 | ||||||
|  |   offset: 0, 0 | ||||||
|  |   index: -1 | ||||||
|  | mouth_grind | ||||||
|  |   rotate: false | ||||||
|  |   xy: 845, 163 | ||||||
|  |   size: 56, 35 | ||||||
|  |   orig: 56, 35 | ||||||
|  |   offset: 0, 0 | ||||||
|  |   index: -1 | ||||||
|  | mouth_oooo | ||||||
|  |   rotate: false | ||||||
|  |   xy: 842, 126 | ||||||
|  |   size: 56, 35 | ||||||
|  |   orig: 56, 35 | ||||||
|  |   offset: 0, 0 | ||||||
|  |   index: -1 | ||||||
|  | mouth_smile | ||||||
|  |   rotate: false | ||||||
|  |   xy: 769, 97 | ||||||
|  |   size: 56, 35 | ||||||
|  |   orig: 56, 35 | ||||||
|  |   offset: 0, 0 | ||||||
|  |   index: -1 | ||||||
|  | muzzle | ||||||
|  |   rotate: false | ||||||
|  |   xy: 2, 2 | ||||||
|  |   size: 275, 240 | ||||||
|  |   orig: 277, 240 | ||||||
|  |   offset: 0, 0 | ||||||
|  |   index: -1 | ||||||
|  | neck | ||||||
|  |   rotate: false | ||||||
|  |   xy: 903, 173 | ||||||
|  |   size: 22, 25 | ||||||
|  |   orig: 22, 25 | ||||||
|  |   offset: 0, 0 | ||||||
|  |   index: -1 | ||||||
|  | rear_bracer | ||||||
|  |   rotate: false | ||||||
|  |   xy: 722, 40 | ||||||
|  |   size: 34, 43 | ||||||
|  |   orig: 34, 43 | ||||||
|  |   offset: 0, 0 | ||||||
|  |   index: -1 | ||||||
|  | rear_foot | ||||||
|  |   rotate: false | ||||||
|  |   xy: 444, 11 | ||||||
|  |   size: 68, 36 | ||||||
|  |   orig: 68, 36 | ||||||
|  |   offset: 0, 0 | ||||||
|  |   index: -1 | ||||||
|  | rear_foot_bend1 | ||||||
|  |   rotate: false | ||||||
|  |   xy: 444, 49 | ||||||
|  |   size: 70, 40 | ||||||
|  |   orig: 70, 40 | ||||||
|  |   offset: 0, 0 | ||||||
|  |   index: -1 | ||||||
|  | rear_foot_bend2 | ||||||
|  |   rotate: false | ||||||
|  |   xy: 778, 134 | ||||||
|  |   size: 62, 50 | ||||||
|  |   orig: 62, 50 | ||||||
|  |   offset: 0, 0 | ||||||
|  |   index: -1 | ||||||
|  | rear_shin | ||||||
|  |   rotate: false | ||||||
|  |   xy: 731, 135 | ||||||
|  |   size: 45, 107 | ||||||
|  |   orig: 45, 107 | ||||||
|  |   offset: 0, 0 | ||||||
|  |   index: -1 | ||||||
|  | rear_thigh | ||||||
|  |   rotate: true | ||||||
|  |   xy: 516, 50 | ||||||
|  |   size: 39, 62 | ||||||
|  |   orig: 39, 62 | ||||||
|  |   offset: 0, 0 | ||||||
|  |   index: -1 | ||||||
|  | rear_upper_arm | ||||||
|  |   rotate: false | ||||||
|  |   xy: 638, 35 | ||||||
|  |   size: 28, 52 | ||||||
|  |   orig: 28, 52 | ||||||
|  |   offset: 0, 0 | ||||||
|  |   index: -1 | ||||||
|  | torso | ||||||
|  |   rotate: true | ||||||
|  |   xy: 279, 2 | ||||||
|  |   size: 59, 108 | ||||||
|  |   orig: 59, 108 | ||||||
|  |   offset: 0, 0 | ||||||
|  |   index: -1 | ||||||
							
								
								
									
										5
									
								
								demo/assets/common/spines/spineboy.txt.meta
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								demo/assets/common/spines/spineboy.txt.meta
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,5 @@ | |||||||
|  | { | ||||||
|  |   "ver": "2.0.0", | ||||||
|  |   "uuid": "b63a4c13-b26d-4b2b-972f-453c057a18b2", | ||||||
|  |   "subMetas": {} | ||||||
|  | } | ||||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| @@ -10,7 +10,8 @@ | |||||||
|   "_techniqueData": { |   "_techniqueData": { | ||||||
|     "0": { |     "0": { | ||||||
|       "defines": { |       "defines": { | ||||||
|         "USE_TEXTURE": true |         "USE_TEXTURE": true, | ||||||
|  |         "USE_MULTI_TEXTURE": true | ||||||
|       }, |       }, | ||||||
|       "props": { |       "props": { | ||||||
|         "texture": { |         "texture": { | ||||||
| @@ -21,6 +22,12 @@ | |||||||
|         }, |         }, | ||||||
|         "texture3": { |         "texture3": { | ||||||
|           "__uuid__": "6e056173-d285-473c-b206-40a7fff5386e" |           "__uuid__": "6e056173-d285-473c-b206-40a7fff5386e" | ||||||
|  |         }, | ||||||
|  |         "texture4": { | ||||||
|  |           "__uuid__": "45be59f3-5655-4369-9e9f-455c81d2ddd9" | ||||||
|  |         }, | ||||||
|  |         "texture5": { | ||||||
|  |           "__uuid__": "d9c4530a-ef05-45c1-b012-eb4686f4c70f" | ||||||
|         } |         } | ||||||
|       } |       } | ||||||
|     } |     } | ||||||
|   | |||||||
| @@ -5,9 +5,9 @@ description: "在游戏开发中享受不用关注 Draw Call 的快乐。" | |||||||
|  |  | ||||||
| # 新 UI 渲染批次合并指南 | # 新 UI 渲染批次合并指南 | ||||||
|  |  | ||||||
| 在官方文档的进阶主题中,有一个 [UI 渲染批次合并指南](https://docs.cocos.com/creator/2.4/manual/zh/advanced-topics/ui-auto-batch.html),而由于服务包的 **多纹理渲染**、**重构动态图集** 等新特性的出现,有一些内容可能已经过期。 | 在官方文档的进阶主题中,有一个 [UI 渲染批次合并指南](https://docs.cocos.com/creator/2.4/manual/zh/advanced-topics/ui-auto-batch.html),在服务包的 **多纹理渲染**、**重构动态图集** 等新特性的出现后,对如何合并渲染批次需要有全新的理解。 | ||||||
|  |  | ||||||
| 如果你未阅读过官方的指南,可以先看一看里面的知识科普部分,而我们将直接从如何实践开始! | 如果你未阅读过官方的指南,可以先阅读一遍。 | ||||||
|  |  | ||||||
| --- | --- | ||||||
| ## 什么是多纹理渲染? | ## 什么是多纹理渲染? | ||||||
| @@ -16,19 +16,19 @@ description: "在游戏开发中享受不用关注 Draw Call 的快乐。" | |||||||
|  |  | ||||||
| 其根本原因是纹理是使用 uniform 变量传给着色器的,而需要合并批次的话不允许每次渲染都拥有不同的 uniform 变量值。 | 其根本原因是纹理是使用 uniform 变量传给着色器的,而需要合并批次的话不允许每次渲染都拥有不同的 uniform 变量值。 | ||||||
|  |  | ||||||
| 服务包实现的合批方法是先设置好多个 uniform 变量,比如将 8 张纹理写入到 "texture1" "texture2" "texture3"... 的 8 个 uniform 变量中,然后编写一个着色器判断应该在渲染时使用哪个 uniform 变量。 | 服务包实现的合批方法是先设置好多个 uniform 变量,比如将 8 张纹理写入到 "texture1" "texture2" "texture3"... 的 8 个 uniform 变量中,然后在着色器里再判断应该在渲染时使用哪个 uniform 变量。 | ||||||
|  |  | ||||||
| 这样的话如果所有渲染都只用这 8 张纹理的话,就都能合并为 1 个批次。 | 这样的话如果所有渲染都只用这 8 张纹理的话,就都能合并为 1 个批次。 | ||||||
|  |  | ||||||
| 这种做法要求设备需要支持采样多个纹理,而在现代绝大多数设备中这不是问题,至少都支持采样 8 张纹理。 | 这种做法要求设备需要支持采样多个纹理,而在现代绝大多数设备中这不是问题,至少都支持采样 8 张纹理。 | ||||||
|  |  | ||||||
| 当然除了这种方法,还有另外的一些进行多纹理合批的方法,例如 "Texture Array"、"Bindless",但都有实用性与兼容性的问题。 | 当然除了这种方法,还有另外几种进行多纹理合批的方法,例如 "Texture Array"、"Bindless",但都有实用性与兼容性的问题。 | ||||||
|  |  | ||||||
| :::info 提示 | :::info 提示 | ||||||
|  |  | ||||||
| 以这种方式实现的多纹理渲染并不是没有弊端的: | 以这种方式实现的多纹理渲染并不是没有弊端的: | ||||||
|  |  | ||||||
| 因为会多传递一个顶点属性,并且需要在着色器中去判断该使用哪个纹理,这可能也会造成性能下降,毕竟**合并批次并不一定会提升性能**。 | 因为会多传递一个顶点属性,并且需要在着色器中去判断该使用哪个纹理,导致**合并批次并不一定会提升性能**。 | ||||||
|  |  | ||||||
| 所以我们建议在多个档次设备中实际测试项目是否使用多纹理渲染的性能差距。 | 所以我们建议在多个档次设备中实际测试项目是否使用多纹理渲染的性能差距。 | ||||||
|  |  | ||||||
| @@ -43,13 +43,13 @@ description: "在游戏开发中享受不用关注 Draw Call 的快乐。" | |||||||
| --- | --- | ||||||
| ## 为你的项目启用动态合图 | ## 为你的项目启用动态合图 | ||||||
|  |  | ||||||
| 在项目之前的开发中,我们可能会关闭动态图集,更倾向于靠静态图集或者自动图集达到降低 Draw Call 的目的。 | 在项目之前的开发中,我们通常会关闭动态图集,更倾向于靠静态图集或者自动图集达到降低 Draw Call 的目的。 | ||||||
|  |  | ||||||
| 这种选择除了与动态合图存在会占用更多内存的缺点有关之外,更多的是在引擎原来的动态合图中,并不能复用图集的废弃区域,这个重要特性的缺失只能靠在切换场景(Scene)后重置所有图集来解决。 | 导致这个情况最重要的问题是不能复用图集的废弃区域,随着游戏的运行图集会完全用完,引擎只提供了在切换场景(Scene)后重置所有图集的机制来解决这个问题。 | ||||||
|  |  | ||||||
| 但对于大部分项目来说,这种治标不治本的机制基本等于没有解决这个问题。 | 但对于大部分项目来说,这种治标不治本的机制基本等于没有解决这个问题。 | ||||||
|  |  | ||||||
| 而现在,**服务包几乎重构了整个动态合图系统,解决了以前存在的大部分问题**,你可以启用它了。 | 现在,服务包几乎重构了整个动态合图系统,你可以考虑启用它了。 | ||||||
|  |  | ||||||
| :::note 提示 | :::note 提示 | ||||||
|  |  | ||||||
|   | |||||||
| @@ -20,7 +20,7 @@ description: "一般情况下都不需要了解。" | |||||||
|  |  | ||||||
| **大部分项目可以不用关心**。 | **大部分项目可以不用关心**。 | ||||||
|  |  | ||||||
| ``` | ```js | ||||||
| cc.macro.ENABLE_NATIVE_TTF_RENDERER = false; | cc.macro.ENABLE_NATIVE_TTF_RENDERER = false; | ||||||
| ``` | ``` | ||||||
|  |  | ||||||
|   | |||||||
| @@ -14,7 +14,7 @@ description: "了解并上手服务包提供的所有其他新特性。" | |||||||
|  |  | ||||||
| 而现在不需要了,高 DPI 文本渲染默认是关闭的,你可以通过 | 而现在不需要了,高 DPI 文本渲染默认是关闭的,你可以通过 | ||||||
|  |  | ||||||
| ``` | ```js | ||||||
| cc.sp.labelRetinaScale = 2;     // 渲染文本时纹理的缩放倍数,默认值为 1. | cc.sp.labelRetinaScale = 2;     // 渲染文本时纹理的缩放倍数,默认值为 1. | ||||||
| ``` | ``` | ||||||
|  |  | ||||||
| @@ -37,7 +37,7 @@ cc.sp.labelRetinaScale = 2;     // 渲染文本时纹理的缩放倍数,默认 | |||||||
|  |  | ||||||
| 只需要一句代码即可使用 cc.SpriteFrame 替换指定 attachment 的 region 对象: | 只需要一句代码即可使用 cc.SpriteFrame 替换指定 attachment 的 region 对象: | ||||||
|  |  | ||||||
| ``` | ```js | ||||||
| this.skel.setRegion('head', 'head', sp.SkeletonData.createRegion(spriteFrame)); | this.skel.setRegion('head', 'head', sp.SkeletonData.createRegion(spriteFrame)); | ||||||
| ``` | ``` | ||||||
|  |  | ||||||
|   | |||||||
| @@ -13,7 +13,7 @@ description: "随心所欲地控制动态合图的使用。" | |||||||
|  |  | ||||||
| 你可以通过该接口添加 SpriteFrame 的 Texture 到图集中,内部也是使用该接口。 | 你可以通过该接口添加 SpriteFrame 的 Texture 到图集中,内部也是使用该接口。 | ||||||
|  |  | ||||||
| ``` | ```js | ||||||
| cc.dynamicAtlasManager.insertSpriteFrame(spriteFrame); | cc.dynamicAtlasManager.insertSpriteFrame(spriteFrame); | ||||||
| ``` | ``` | ||||||
|  |  | ||||||
|   | |||||||
										
											Binary file not shown.
										
									
								
							| Before Width: | Height: | Size: 120 KiB After Width: | Height: | Size: 93 KiB | 
| @@ -5,4 +5,5 @@ description: "了解如何手动进行多纹理合批。" | |||||||
|  |  | ||||||
| # 多纹理合批 | # 多纹理合批 | ||||||
|  |  | ||||||
|  |  | ||||||
| 着重介绍管理器。 | 着重介绍管理器。 | ||||||
|   | |||||||
| @@ -1,6 +1,7 @@ | |||||||
| --- | --- | ||||||
| sidebar_position: 1 | sidebar_position: 1 | ||||||
| description: "了解实现多纹理渲染的基础。" | description: "了解如何手动管理多纹理材质。" | ||||||
|  | toc_max_heading_level: 5 | ||||||
| --- | --- | ||||||
|  |  | ||||||
| # 多纹理材质 | # 多纹理材质 | ||||||
| @@ -11,7 +12,7 @@ description: "了解实现多纹理渲染的基础。" | |||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
| 可以看到上面有 `texture` - `texture8` 一共 8 个纹理插槽,将需要使用的纹理拖到上面的插槽即可完成多纹理材质的配置。 | 勾选 `USE_MULTI_TEXTURE` 后可以看到上面有 `texture` - `texture8` 一共 8 个纹理插槽,将需要使用的纹理拖到上面的插槽即可完成多纹理材质的配置。 | ||||||
|  |  | ||||||
| ## 在组件中使用多纹理材质 | ## 在组件中使用多纹理材质 | ||||||
|  |  | ||||||
| @@ -37,30 +38,84 @@ description: "了解实现多纹理渲染的基础。" | |||||||
|  |  | ||||||
| ## 自定义多纹理材质 | ## 自定义多纹理材质 | ||||||
|  |  | ||||||
| 上面介绍的多纹理材质都是使用的内置的多纹理 Effect 着色器,**如果你也创建了一个拥有多个纹理插槽的 Effect 着色器,直接使用并不会被直接识别为多纹理材质。** | 上面介绍的多纹理材质都是使用的内置的多纹理 Effect 着色器,你可以直接在内置多纹理 Effect 着色器的基础上修改。 | ||||||
|  |  | ||||||
|  | 除了直接在内置着色器的基础上修改之外,任何着色器中如果存在一个宏 `USE_MULTI_TEXTURE = true`,则会被认为是多纹理材质。 | ||||||
|  |  | ||||||
|  | [演示项目](TODO) 中有自定义材质的示范代码。 | ||||||
|  |  | ||||||
| ## MultiHandler | :::tip 提示 | ||||||
|  |  | ||||||
| 这个是服务包新增的一个工具类,其主要用处是便捷、高性能地管理多纹理材质上面的所有纹理。 | 是否为多纹理材质的判断逻辑流程: | ||||||
|  |  | ||||||
| 虽然你可以直接通过 `cc.Material` 上的接口来设置纹理插槽,但是出于性能考虑,**多纹理材质必须使用该类实例来进行纹理增删改的相关操作,否则可能导致不能正确渲染。** | 1. 获取材质当前使用的 Technique 中的第一个 Pass | ||||||
|  | 2. 判断这个 Pass 是否 `USE_MULTI_TEXTURE = true` | ||||||
|  | 3. 是的话,这个材质即为多纹理材质 | ||||||
|  |  | ||||||
| 它有以下接口: | 在某些情况下通过代码修改材质可能需要调用 `material.updateMultiSupport()` 来触发这个流程。 | ||||||
|  |  | ||||||
| ### `setTexture(index: number, texture: cc.Texture2D): void` | ::: | ||||||
|  |  | ||||||
| 设置纹理插槽上的纹理, | ## 通过代码设置纹理插槽 | ||||||
|  |  | ||||||
|  | 每个多纹理材质都对应着一个多纹理材质管理器,这是服务包新增的一个工具类,其主要用处是便捷、高性能地管理多纹理材质上面的纹理插槽。 | ||||||
|  |  | ||||||
| 当我们说 “多纹理材质” 时,指的是持有 `cc.sp.MultiHandler` 实例的材质。 | 通过 `material.getMultiHandler()` 可以获取到管理器实例,请使用这个实例来操作多纹理材质的纹理插槽。 | ||||||
|  |  | ||||||
| 并且使用内置多纹理 Effect 着色器的材质会自动持有一个 `cc.sp.MultiHandler` 实例。 | 比如: | ||||||
|  |  | ||||||
| 也就是说**使用自行创建的有多个纹理插槽着色器的材质不会被直接识别为多纹理材质。** | ```js | ||||||
|  | // 获取管理器实例 | ||||||
|  | const handler = material.getMultiHandler(); | ||||||
|  |  | ||||||
| :::tip | // 设置 `texture` 纹理插槽 | ||||||
|  | handler.setTexture(0, texture); | ||||||
|  |  | ||||||
|  | // 置空 `texture2` 纹理插槽 | ||||||
|  | handler.setTexture(1, null); | ||||||
|  |  | ||||||
| ## | // 直接移除指定纹理 | ||||||
|  | handler.removeTexture(texture.getImpl()); | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | 从上面的代码中可以看出操作纹理插槽的时候并不是传入插槽的名称,而是需要提供下标。 | ||||||
|  |  | ||||||
|  | 下标 `0` - `7` 分别对应着名称为 `texture` - `texture8` 的插槽。 | ||||||
|  |  | ||||||
|  | 可以使用这两个函数进行转换: | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | // index to name | ||||||
|  | cc.sp.propertyIndex2Name(0);    // return: "texture" | ||||||
|  |  | ||||||
|  | // name to index | ||||||
|  | cc.sp.propertyName2Index("texture");    // return: 0 | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | :::caution 注意 | ||||||
|  |  | ||||||
|  | 注意区分材质 `cc.Material` 与材质变体 `cc.MaterialVariant`。 | ||||||
|  |  | ||||||
|  | ::: | ||||||
|  |  | ||||||
|  | :::caution 警告 | ||||||
|  |  | ||||||
|  | 请勿直接通过 `setProperty` 接口修改多纹理材质的纹理插槽。 | ||||||
|  |  | ||||||
|  | 如果你必须这么做,需要调用 `material.getMultiHandler().syncTextures()` 来同步插槽数据到 `MultiHandler` 上。 | ||||||
|  |  | ||||||
|  | ::: | ||||||
|  |  | ||||||
|  | ## 强制设置材质的类型 | ||||||
|  |  | ||||||
|  | 如果你想将某个材质强制视为多纹理材质或非多纹理材质,可以: | ||||||
|  |  | ||||||
|  | ```js | ||||||
|  | // 视为多纹理材质 | ||||||
|  | material.setMultiSupport(true); | ||||||
|  |  | ||||||
|  | // 视为非多纹理材质 | ||||||
|  | material.setMultiSupport(false); | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | 但是这么做好像没有什么意义。 | ||||||
|   | |||||||
| @@ -13,7 +13,7 @@ | |||||||
|   --ifm-color-primary-light: #6440b1; |   --ifm-color-primary-light: #6440b1; | ||||||
|   --ifm-color-primary-lighter: #6943b9; |   --ifm-color-primary-lighter: #6943b9; | ||||||
|   --ifm-color-primary-lightest: #7b59c3; |   --ifm-color-primary-lightest: #7b59c3; | ||||||
|   --ifm-code-font-size: 80%; |   --ifm-code-font-size: 85%; | ||||||
|   --ifm-code-padding-horizontal: 0.3rem; |   --ifm-code-padding-horizontal: 0.3rem; | ||||||
|   --ifm-global-radius: 0.3rem; |   --ifm-global-radius: 0.3rem; | ||||||
|   --ifm-code-border-radius: 0.2rem; |   --ifm-code-border-radius: 0.2rem; | ||||||
|   | |||||||
| @@ -36,10 +36,14 @@ CCProgram vs %{ | |||||||
|   #if USE_TEXTURE |   #if USE_TEXTURE | ||||||
|   in vec2 a_uv0; |   in vec2 a_uv0; | ||||||
|   out vec2 v_uv0; |   out vec2 v_uv0; | ||||||
|  |  | ||||||
|  |   #if USE_MULTI_TEXTURE | ||||||
|   in float a_texId; |   in float a_texId; | ||||||
|   out float v_texId; |   out float v_texId; | ||||||
|   #endif |   #endif | ||||||
|  |  | ||||||
|  |   #endif | ||||||
|  |  | ||||||
|   void main () { |   void main () { | ||||||
|     vec4 pos = vec4(a_position, 1); |     vec4 pos = vec4(a_position, 1); | ||||||
|  |  | ||||||
| @@ -51,9 +55,13 @@ CCProgram vs %{ | |||||||
|  |  | ||||||
|     #if USE_TEXTURE |     #if USE_TEXTURE | ||||||
|     v_uv0 = a_uv0; |     v_uv0 = a_uv0; | ||||||
|  |      | ||||||
|  |     #if USE_MULTI_TEXTURE | ||||||
|     v_texId = a_texId; |     v_texId = a_texId; | ||||||
|     #endif |     #endif | ||||||
|  |  | ||||||
|  |     #endif | ||||||
|  |  | ||||||
|     v_color = a_color; |     v_color = a_color; | ||||||
|  |  | ||||||
|     gl_Position = pos; |     gl_Position = pos; | ||||||
| @@ -71,8 +79,10 @@ CCProgram fs %{ | |||||||
|  |  | ||||||
|   #if USE_TEXTURE |   #if USE_TEXTURE | ||||||
|   in vec2 v_uv0; |   in vec2 v_uv0; | ||||||
|   in float v_texId; |  | ||||||
|   uniform sampler2D texture; |   uniform sampler2D texture; | ||||||
|  |  | ||||||
|  |   #if USE_MULTI_TEXTURE  | ||||||
|  |   in float v_texId; | ||||||
|   uniform sampler2D texture2; |   uniform sampler2D texture2; | ||||||
|   uniform sampler2D texture3; |   uniform sampler2D texture3; | ||||||
|   uniform sampler2D texture4; |   uniform sampler2D texture4; | ||||||
| @@ -81,28 +91,34 @@ CCProgram fs %{ | |||||||
|   uniform sampler2D texture7; |   uniform sampler2D texture7; | ||||||
|   uniform sampler2D texture8; |   uniform sampler2D texture8; | ||||||
|   #endif |   #endif | ||||||
|  |    | ||||||
|  |   #endif | ||||||
|  |  | ||||||
|   void main () { |   void main () { | ||||||
|     vec4 o = vec4(1, 1, 1, 1); |     vec4 o = vec4(1, 1, 1, 1); | ||||||
|  |  | ||||||
|     #if USE_TEXTURE |     #if USE_TEXTURE | ||||||
|       if(v_texId < 1.0){ |       #if USE_MULTI_TEXTURE  | ||||||
|  |         if(v_texId < 1.0){ | ||||||
|  |           CCTexture(texture, v_uv0, o); | ||||||
|  |         } else if(v_texId < 2.0){ | ||||||
|  |           CCTexture(texture2, v_uv0, o); | ||||||
|  |         } else if(v_texId < 3.0){ | ||||||
|  |           CCTexture(texture3, v_uv0, o); | ||||||
|  |         } else if(v_texId < 4.0){ | ||||||
|  |           CCTexture(texture4, v_uv0, o); | ||||||
|  |         } else if(v_texId < 5.0){ | ||||||
|  |           CCTexture(texture5, v_uv0, o); | ||||||
|  |         } else if(v_texId < 6.0){ | ||||||
|  |           CCTexture(texture6, v_uv0, o); | ||||||
|  |         } else if(v_texId < 7.0){ | ||||||
|  |           CCTexture(texture7, v_uv0, o); | ||||||
|  |         } else { | ||||||
|  |           CCTexture(texture8, v_uv0, o); | ||||||
|  |         } | ||||||
|  |       #else | ||||||
|         CCTexture(texture, v_uv0, o); |         CCTexture(texture, v_uv0, o); | ||||||
|       } else if(v_texId < 2.0){ |       #endif | ||||||
|         CCTexture(texture2, v_uv0, o); |  | ||||||
|       } else if(v_texId < 3.0){ |  | ||||||
|         CCTexture(texture3, v_uv0, o); |  | ||||||
|       } else if(v_texId < 4.0){ |  | ||||||
|         CCTexture(texture4, v_uv0, o); |  | ||||||
|       } else if(v_texId < 5.0){ |  | ||||||
|         CCTexture(texture5, v_uv0, o); |  | ||||||
|       } else if(v_texId < 6.0){ |  | ||||||
|         CCTexture(texture6, v_uv0, o); |  | ||||||
|       } else if(v_texId < 7.0){ |  | ||||||
|         CCTexture(texture7, v_uv0, o); |  | ||||||
|       } else { |  | ||||||
|         CCTexture(texture8, v_uv0, o); |  | ||||||
|       } |  | ||||||
|     #endif |     #endif | ||||||
|  |  | ||||||
|     o *= v_color; |     o *= v_color; | ||||||
|   | |||||||
							
								
								
									
										5
									
								
								src/creator-sp.d.ts
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										5
									
								
								src/creator-sp.d.ts
									
									
									
									
										vendored
									
									
								
							| @@ -484,6 +484,11 @@ declare module cc { | |||||||
|          */ |          */ | ||||||
|         _multiHandler?: cc.sp.MultiHandler; |         _multiHandler?: cc.sp.MultiHandler; | ||||||
|  |  | ||||||
|  |         /** | ||||||
|  |          * 根据材质的 `USE_MULTI_TEXTURE` 宏来更新材质是否支持多纹理 | ||||||
|  |          */ | ||||||
|  |         updateMultiSupport(): boolean; | ||||||
|  |  | ||||||
|         /** |         /** | ||||||
|          * 判断该材质是否有 MultiHandler 实例 |          * 判断该材质是否有 MultiHandler 实例 | ||||||
|          */ |          */ | ||||||
|   | |||||||
										
											Binary file not shown.
										
									
								
							
		Reference in New Issue
	
	Block a user