mirror of
https://github.com/smallmain/cocos-enhance-kit.git
synced 2024-12-26 03:38:29 +00:00
1 line
13 KiB
JavaScript
1 line
13 KiB
JavaScript
"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[6110],{3905:function(e,t,n){n.d(t,{Zo:function(){return c},kt:function(){return d}});var r=n(67294);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){a(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function o(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},l=Object.keys(e);for(r=0;r<l.length;r++)n=l[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(r=0;r<l.length;r++)n=l[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var u=r.createContext({}),p=function(e){var t=r.useContext(u),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},c=function(e){var t=p(e.components);return r.createElement(u.Provider,{value:t},e.children)},s={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},k=r.forwardRef((function(e,t){var n=e.components,a=e.mdxType,l=e.originalType,u=e.parentName,c=o(e,["components","mdxType","originalType","parentName"]),k=p(n),d=a,m=k["".concat(u,".").concat(d)]||k[d]||s[d]||l;return n?r.createElement(m,i(i({ref:t},c),{},{components:n})):r.createElement(m,i({ref:t},c))}));function d(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var l=n.length,i=new Array(l);i[0]=k;var o={};for(var u in t)hasOwnProperty.call(t,u)&&(o[u]=t[u]);o.originalType=e,o.mdxType="string"==typeof e?e:a,i[1]=o;for(var p=2;p<l;p++)i[p]=n[p];return r.createElement.apply(null,i)}return r.createElement.apply(null,n)}k.displayName="MDXCreateElement"},47909:function(e,t,n){n.r(t),n.d(t,{assets:function(){return c},contentTitle:function(){return u},default:function(){return d},frontMatter:function(){return o},metadata:function(){return p},toc:function(){return s}});var r=n(87462),a=n(63366),l=(n(67294),n(3905)),i=["components"],o={sidebar_position:4,description:"\u4e00\u822c\u60c5\u51b5\u4e0b\u90fd\u4e0d\u9700\u8981\u4e86\u89e3\u3002"},u="\u7834\u574f\u6027\u53d8\u66f4",p={unversionedId:"start-guide/breaking-change",id:"version-1.1.0/start-guide/breaking-change",title:"\u7834\u574f\u6027\u53d8\u66f4",description:"\u4e00\u822c\u60c5\u51b5\u4e0b\u90fd\u4e0d\u9700\u8981\u4e86\u89e3\u3002",source:"@site/versioned_docs/version-1.1.0/start-guide/breaking-change.md",sourceDirName:"start-guide",slug:"/start-guide/breaking-change",permalink:"/cocos-enhance-kit/docs/1.1.0/start-guide/breaking-change",draft:!1,tags:[],version:"1.1.0",sidebarPosition:4,frontMatter:{sidebar_position:4,description:"\u4e00\u822c\u60c5\u51b5\u4e0b\u90fd\u4e0d\u9700\u8981\u4e86\u89e3\u3002"},sidebar:"tutorialSidebar",previous:{title:"\u4e0a\u624b\u5176\u5b83\u65b0\u7279\u6027",permalink:"/cocos-enhance-kit/docs/1.1.0/start-guide/new-features"},next:{title:"\u4f7f\u7528\u6307\u5357",permalink:"/cocos-enhance-kit/docs/1.1.0/user-guide/user-guide-intro"}},c={},s=[{value:"\u9ed8\u8ba4\u7981\u7528\u539f\u751f TTF \u6e32\u67d3\u5668",id:"\u9ed8\u8ba4\u7981\u7528\u539f\u751f-ttf-\u6e32\u67d3\u5668",level:3},{value:"\u52a8\u6001\u56fe\u96c6\u7684\u4e00\u4e9b\u53d8\u5316",id:"\u52a8\u6001\u56fe\u96c6\u7684\u4e00\u4e9b\u53d8\u5316",level:3},{value:"Char \u7f13\u5b58\u6a21\u5f0f\u7684\u4e00\u4e9b\u53d8\u5316",id:"char-\u7f13\u5b58\u6a21\u5f0f\u7684\u4e00\u4e9b\u53d8\u5316",level:3},{value:"\u6750\u8d28 Hash \u8ba1\u7b97\u7684\u53d8\u5316",id:"\u6750\u8d28-hash-\u8ba1\u7b97\u7684\u53d8\u5316",level:3}],k={toc:s};function d(e){var t=e.components,n=(0,a.Z)(e,i);return(0,l.kt)("wrapper",(0,r.Z)({},k,n,{components:t,mdxType:"MDXLayout"}),(0,l.kt)("h1",{id:"\u7834\u574f\u6027\u53d8\u66f4"},"\u7834\u574f\u6027\u53d8\u66f4"),(0,l.kt)("p",null,"\u5728\u6dfb\u52a0\u65b0\u7279\u6027\u7684\u8fc7\u7a0b\u4e2d\uff0c\u5c31\u50cf\u5f15\u64ce\u5347\u7ea7\u4e00\u6837\uff0c\u6709\u4e9b\u53d8\u5316\u5728\u6240\u96be\u514d\uff0c\u5728\u8fd9\u91cc\u4f60\u53ef\u4ee5\u5bf9\u53d8\u66f4\u8fdb\u884c\u8bc4\u4f30\u662f\u5426\u4f1a\u5bf9\u9879\u76ee\u9020\u6210\u5de8\u5927\u7684\u5f71\u54cd\u3002"),(0,l.kt)("hr",null),(0,l.kt)("h3",{id:"\u9ed8\u8ba4\u7981\u7528\u539f\u751f-ttf-\u6e32\u67d3\u5668"},"\u9ed8\u8ba4\u7981\u7528\u539f\u751f TTF \u6e32\u67d3\u5668"),(0,l.kt)("p",null,"\u5f15\u64ce\u7684 Label \u5728\u4f7f\u7528 Char \u7f13\u5b58\u6a21\u5f0f\u5e76\u4e14\u4f7f\u7528 TTF \u5b57\u4f53\u65f6\uff0c\u4f1a\u4f7f\u7528\u4e00\u4e2a\u539f\u751f TTF \u6e32\u67d3\u5668\u3002"),(0,l.kt)("p",null,"\u8fd9\u4e2a\u6e32\u67d3\u5668\u7406\u8bba\u4e0a\u80fd\u63d0\u5347\u539f\u751f\u5e73\u53f0\u7684 Label \u6027\u80fd\uff0c\u4f46\u4ec5\u5728 Char \u7f13\u5b58\u6a21\u5f0f\u5e76\u4e14\u8fd8\u8981\u4f7f\u7528 TTF \u5b57\u4f53\u65f6\u624d\u751f\u6548\uff0c\u8fd9\u4e5f\u5bfc\u81f4\u4e86\u5728\u539f\u751f\u5e73\u53f0\u4e0a\u5b57\u4f53\u6837\u5f0f\u53ef\u80fd\u4e0e\u5176\u5b83\u5e73\u53f0\u4e0d\u4e00\u81f4\u7684\u95ee\u9898\u3002"),(0,l.kt)("p",null,"\u5728\u91cd\u6784 CHAR \u7f13\u5b58\u6a21\u5f0f\u65f6\u8003\u8651\u5230\u8fd9\u4e9b\u56e0\u7d20\u548c\u4eba\u529b\u6709\u9650\u7684\u539f\u56e0\uff0c\u6211\u4eec\u6682\u65f6\u4e0d\u6253\u7b97\u9002\u914d\u8fd9\u4e2a\u539f\u751f TTF \u6e32\u67d3\u5668\uff0c\u6240\u4ee5\u76f4\u63a5\u9ed8\u8ba4\u7981\u7528\u4e86\u539f\u751f TTF \u6e32\u67d3\u5668\uff0c\u8fd9\u4e2a\u7981\u7528\u662f\u5b98\u65b9\u63d0\u4f9b\u7684\u63a5\u53e3\uff0c\u4e0d\u4f1a\u9020\u6210\u5176\u5b83\u95ee\u9898\u3002"),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"\u5927\u90e8\u5206\u9879\u76ee\u53ef\u4ee5\u4e0d\u7528\u5173\u5fc3"),"\u3002"),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-js"},"cc.macro.ENABLE_NATIVE_TTF_RENDERER = false;\n")),(0,l.kt)("hr",null),(0,l.kt)("h3",{id:"\u52a8\u6001\u56fe\u96c6\u7684\u4e00\u4e9b\u53d8\u5316"},"\u52a8\u6001\u56fe\u96c6\u7684\u4e00\u4e9b\u53d8\u5316"),(0,l.kt)("p",null,"\u5bf9\u52a8\u6001\u56fe\u96c6\u7684\u91cd\u6784\u867d\u7136\u4fdd\u7559\u4e86\u6240\u6709\u539f\u6709\u7684\u516c\u5f00\u63a5\u53e3\uff0c\u4f46\u5b9e\u73b0\u7ec6\u8282\u4e0e\u4ee5\u524d\u4e0d\u540c\u4e86\u3002"),(0,l.kt)("p",null,"\u5982\u679c\u4f60\u7684\u9879\u76ee\u6709\u5728\u7ec6\u81f4\u5730\u7ba1\u7406\u52a8\u6001\u56fe\u96c6\uff0c\u8bf7\u6ce8\u610f\u4ee5\u4e0b\u51e0\u70b9\uff1a"),(0,l.kt)("ul",null,(0,l.kt)("li",{parentName:"ul"},(0,l.kt)("strong",{parentName:"li"},"\u5982\u679c\u4f60\u6709\u624b\u52a8\u4fee\u6539 ",(0,l.kt)("inlineCode",{parentName:"strong"},"cc.dynamicAtlasManager.maxAtlasCount")," \u5c5e\u6027\uff0c\u8bf7\u8003\u8651\u5220\u9664"))),(0,l.kt)("p",null,"\u589e\u5f3a\u5305\u4f1a\u6839\u636e\u8bbe\u5907\u6700\u5927\u7eb9\u7406\u6570\u548c Char \u7f13\u5b58\u6a21\u5f0f\u5b57\u7b26\u56fe\u96c6\u7684\u76f8\u5173\u8bbe\u7f6e\u81ea\u52a8\u8c03\u6574\u52a8\u6001\u5408\u56fe\u7684\u6700\u5927\u56fe\u96c6\u6570\u91cf\u3002"),(0,l.kt)("p",null,"\u8fd9\u4e0d\u610f\u5473\u7740\u4f60\u4e0d\u80fd\u624b\u52a8\u8c03\u6574\u4e86\uff0c\u800c\u662f\u5efa\u8bae\u4f60\u9605\u8bfb\u65b0\u52a8\u6001\u56fe\u96c6\u548c\u65b0 Char \u7f13\u5b58\u6a21\u5f0f\u76f8\u5173\u7684\u6587\u6863\u540e\u518d\u8003\u8651\u662f\u5426\u6709\u5fc5\u8981\u8fdb\u884c\u8c03\u6574\u3002"),(0,l.kt)("p",null,"\u5173\u4e8e\u8fd9\u4e2a\u4f60\u53ef\u4ee5\u4ece ",(0,l.kt)("a",{parentName:"p",href:"/cocos-enhance-kit/docs/1.1.0/start-guide/batcher-guide"},"\u65b0 UI \u6e32\u67d3\u6279\u6b21\u5408\u5e76\u6307\u5357")," \u8fdb\u884c\u4e86\u89e3\u3002"),(0,l.kt)("ul",null,(0,l.kt)("li",{parentName:"ul"},(0,l.kt)("strong",{parentName:"li"},"\u52a8\u6001\u56fe\u96c6\u91cd\u590d\u7eb9\u7406\u7684\u5224\u65ad\u4ece ",(0,l.kt)("inlineCode",{parentName:"strong"},"texture._id")," \u6539\u4e3a\u4f7f\u7528 ",(0,l.kt)("inlineCode",{parentName:"strong"},"texture._uuid")))),(0,l.kt)("p",null,"\u5177\u4f53\u7684\u8bbe\u8ba1\u539f\u56e0\u548c\u539f\u7406\u53ef\u67e5\u770b\u52a8\u6001\u5408\u56fe\u7684\u539f\u7406\u6587\u6863\u3002"),(0,l.kt)("ul",null,(0,l.kt)("li",{parentName:"ul"},(0,l.kt)("strong",{parentName:"li"},(0,l.kt)("inlineCode",{parentName:"strong"},"cc.dynamicAtlasManager.insertSpriteFrame(spriteFrame)")," \u4e0d\u518d\u68c0\u67e5\u7eb9\u7406\u7684 ",(0,l.kt)("inlineCode",{parentName:"strong"},"packable")," \u5c5e\u6027"))),(0,l.kt)("p",null,"\u5e76\u4e0d\u662f\u8bf4 ",(0,l.kt)("inlineCode",{parentName:"p"},"packable")," \u5c5e\u6027\u65e0\u6548\u4e86\uff0c\u800c\u662f ",(0,l.kt)("inlineCode",{parentName:"p"},"insertSpriteFrame")," \u73b0\u5728\u4f5c\u4e3a\u5c06\u7eb9\u7406\u5f3a\u5236\u52a0\u5165\u52a8\u6001\u56fe\u96c6\u7684\u63a5\u53e3\u4f7f\u7528\u3002"),(0,l.kt)("ul",null,(0,l.kt)("li",{parentName:"ul"},(0,l.kt)("strong",{parentName:"li"},"\u5982\u679c\u4f60\u7684\u9879\u76ee\u4f9d\u8d56\u52a8\u6001\u56fe\u96c6\u7684\u5185\u90e8\u5b9e\u73b0\u7ec6\u8282\uff0c\u8bf7\u91cd\u65b0\u68c0\u67e5\u76f8\u5173\u4ee3\u7801"))),(0,l.kt)("p",null,"\u6bd4\u5982\u4f60\u7684\u9879\u76ee\u4f9d\u8d56\u4e00\u4e9b\u52a8\u6001\u56fe\u96c6\u672a\u516c\u5f00\u7684\u7c7b\u6216\u8005\u63a5\u53e3\uff08\u5f15\u64ce\u5728 ",(0,l.kt)("inlineCode",{parentName:"p"},"creator.d.ts")," \u58f0\u660e\u4e86\u7684\u5219\u662f\u5df2\u7ecf\u516c\u5f00\u7684\uff09\uff0c\u5219\u53ef\u80fd\u9700\u8981\u91cd\u65b0\u7f16\u5199\u3002"),(0,l.kt)("hr",null),(0,l.kt)("h3",{id:"char-\u7f13\u5b58\u6a21\u5f0f\u7684\u4e00\u4e9b\u53d8\u5316"},"Char \u7f13\u5b58\u6a21\u5f0f\u7684\u4e00\u4e9b\u53d8\u5316"),(0,l.kt)("p",null,"\u5bf9 Char \u7f13\u5b58\u6a21\u5f0f\u4e5f\u8fdb\u884c\u4e86\u91cd\u6784\uff0c\u5185\u90e8\u53d8\u5316\u6bd4\u8f83\u5927\u3002"),(0,l.kt)("ul",null,(0,l.kt)("li",{parentName:"ul"},(0,l.kt)("strong",{parentName:"li"},"\u6682\u4e0d\u652f\u6301\u81ea\u5b9a\u4e49\u6750\u8d28"))),(0,l.kt)("p",null,"\u5982\u679c\u9879\u76ee\u4e2d\u6709\u7ec4\u4ef6\u5728\u4f7f\u7528 Char \u7f13\u5b58\u6a21\u5f0f\u5e76\u4e14\u8bbe\u7f6e\u4e86\u81ea\u5b9a\u4e49\u6750\u8d28\u5219\u53ef\u80fd\u4f1a\u5931\u6548\uff0c\u5177\u4f53\u539f\u56e0\u53ef\u524d\u5f80 ",(0,l.kt)("a",{parentName:"p",href:"/cocos-enhance-kit/docs/1.1.0/user-guide/text-render/text-char-mode"},"\u65b0\u7684 Char \u7f13\u5b58\u6a21\u5f0f")," \u6587\u6863\u8fdb\u884c\u4e86\u89e3\u3002"),(0,l.kt)("ul",null,(0,l.kt)("li",{parentName:"ul"},(0,l.kt)("strong",{parentName:"li"},"\u5982\u679c\u4f60\u7684\u9879\u76ee\u4f9d\u8d56 Char \u7f13\u5b58\u6a21\u5f0f\u7684\u5185\u90e8\u5b9e\u73b0\u7ec6\u8282\uff0c\u8bf7\u91cd\u65b0\u68c0\u67e5\u76f8\u5173\u4ee3\u7801"))),(0,l.kt)("p",null,"\u6bd4\u5982\u4f60\u7684\u9879\u76ee\u4f9d\u8d56\u4e00\u4e9b Char \u7f13\u5b58\u6a21\u5f0f\u672a\u516c\u5f00\u7684\u7c7b\u6216\u8005\u63a5\u53e3\uff08\u5f15\u64ce\u5728 ",(0,l.kt)("inlineCode",{parentName:"p"},"creator.d.ts")," \u58f0\u660e\u4e86\u7684\u5219\u662f\u5df2\u7ecf\u516c\u5f00\u7684\uff09\uff0c\u5219\u53ef\u80fd\u9700\u8981\u91cd\u65b0\u7f16\u5199\u3002"),(0,l.kt)("hr",null),(0,l.kt)("h3",{id:"\u6750\u8d28-hash-\u8ba1\u7b97\u7684\u53d8\u5316"},"\u6750\u8d28 Hash \u8ba1\u7b97\u7684\u53d8\u5316"),(0,l.kt)("p",null,"\u5728\u89e3\u51b3\u6750\u8d28\u672c\u8eab Hash \u53d8\u5316\u4e0d\u4f1a\u66f4\u65b0\u6750\u8d28\u53d8\u4f53\u7684 Hash \u7684\u95ee\u9898\u65f6\uff0c\u4e3a\u4e86\u517c\u987e\u539f\u751f\u5e73\u53f0\u4e0e Web \u5e73\u53f0\uff0c\u6211\u4eec\u91c7\u53d6\u4e86\u4f7f\u6750\u8d28\u672c\u8eab\u7684 Hash \u503c\u4e0d\u53d8\u5e76\u4e14\u4fee\u6539\u53d8\u4f53 Hash \u8ba1\u7b97\u65b9\u5f0f\u7684\u65b9\u6cd5\u6765\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\u3002"),(0,l.kt)("p",null,"\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\u540e\uff0c\u5728\u4e24\u4e2a\u6750\u8d28\u53d8\u4f53\u4e00\u6837\u7684\u60c5\u51b5\u4e0b\uff0c\u65e0\u8bba\u600e\u4e48\u4fee\u6539\u6750\u8d28\uff0c\u90fd\u4e0d\u4f1a\u5f71\u54cd\u8be5\u6750\u8d28\u7684\u53d8\u4f53\u8fdb\u884c\u5408\u6279\uff08\u5728\u8fd9\u4e4b\u524d\uff0c\u4fee\u6539\u6750\u8d28\u540e\u751f\u6210\u7684\u53d8\u4f53\u65e0\u6cd5\u548c\u4e4b\u524d\u7684\u53d8\u4f53\u5408\u6279\uff0c\u56e0\u4e3a Hash \u503c\u95ee\u9898\uff09\u3002"),(0,l.kt)("p",null,"\u4f46\u8fd9\u5f15\u5165\u4e86\u65b0\u7684\u95ee\u9898\uff0c\u8fd9\u4f1a\u5bfc\u81f4\u5b8c\u5168\u76f8\u540c\u7684\u4e24\u4e2a\u6750\u8d28\u4e0d\u80fd\u5408\u6279\uff0c\u6bd4\u5982\u4f60\u590d\u5236\u4e86\u4e00\u4e2a ",(0,l.kt)("inlineCode",{parentName:"p"},"multi-2d-sprite")," \u6750\u8d28\uff0c\u5206\u522b\u4f7f\u7528\u8fd9\u4e24\u4e2a\u6750\u8d28\u7684\u7ec4\u4ef6\u4e0d\u518d\u4f1a\u8fdb\u884c\u5408\u6279\u3002"),(0,l.kt)("p",null,"\u6211\u4eec\u8003\u8651\u4e86\u6027\u80fd\u3001\u5f71\u54cd\u7a0b\u5ea6\u7b49\u591a\u65b9\u9762\u56e0\u7d20\u4e4b\u540e\u91c7\u53d6\u4e86\u8fd9\u4e2a\u5b9e\u73b0\uff0c\u56e0\u4e3a\u540e\u8005\u6bd4\u8f83\u5c11\u89c1\uff0c\u5e76\u4e14\u53ef\u4ee5\u624b\u52a8\u89e3\u51b3\uff1a"),(0,l.kt)("p",null,"\u4f60\u53ea\u9700\u8981\u624b\u52a8\u8bbe\u7f6e\u8be5\u6750\u8d28\u7684 Hash \u503c\u4e3a ",(0,l.kt)("inlineCode",{parentName:"p"},"multi-2d-sprite")," \u6750\u8d28\u7684 Hash \u503c\u5373\u53ef\u4f7f\u4e24\u4e2a\u6750\u8d28\u5408\u6279\u3002"))}d.isMDXComponent=!0}}]); |