mirror of
https://github.com/smallmain/cocos-enhance-kit.git
synced 2025-01-27 21:31:02 +00:00
1 line
11 KiB
JavaScript
1 line
11 KiB
JavaScript
"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[2264],{3905:function(e,t,r){r.d(t,{Zo:function(){return p},kt:function(){return k}});var n=r(7294);function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?l(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function o(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}var u=n.createContext({}),c=function(e){var t=n.useContext(u),r=t;return e&&(r="function"==typeof e?e(t):i(i({},t),e)),r},p=function(e){var t=c(e.components);return n.createElement(u.Provider,{value:t},e.children)},s={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},d=n.forwardRef((function(e,t){var r=e.components,a=e.mdxType,l=e.originalType,u=e.parentName,p=o(e,["components","mdxType","originalType","parentName"]),d=c(r),k=a,m=d["".concat(u,".").concat(k)]||d[k]||s[k]||l;return r?n.createElement(m,i(i({ref:t},p),{},{components:r})):n.createElement(m,i({ref:t},p))}));function k(e,t){var r=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var l=r.length,i=new Array(l);i[0]=d;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 c=2;c<l;c++)i[c]=r[c];return n.createElement.apply(null,i)}return n.createElement.apply(null,r)}d.displayName="MDXCreateElement"},3133:function(e,t,r){r.r(t),r.d(t,{assets:function(){return p},contentTitle:function(){return u},default:function(){return k},frontMatter:function(){return o},metadata:function(){return c},toc:function(){return s}});var n=r(7462),a=r(3366),l=(r(7294),r(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",c={unversionedId:"start-guide/breaking-change",id:"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/docs/start-guide/breaking-change.md",sourceDirName:"start-guide",slug:"/start-guide/breaking-change",permalink:"/cocos-service-pack/docs/start-guide/breaking-change",draft:!1,tags:[],version:"current",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-service-pack/docs/start-guide/new-features"},next:{title:"\u4f7f\u7528\u6307\u5357",permalink:"/cocos-service-pack/docs/user-guide/user-guide-intro"}},p={},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}],d={toc:s};function k(e){var t=e.components,r=(0,a.Z)(e,i);return(0,l.kt)("wrapper",(0,n.Z)({},d,r,{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\u8d21\u732e\u6307\u5357\u4e2d\u6211\u4eec\u63d0\u5230\u8fc7\u4f1a\u5c3d\u91cf\u4e0d\u5f15\u5165\u7834\u574f\u6027\u53d8\u66f4\uff0c\u6216\u4efb\u4f55\u4e0e\u539f\u7248\u5f15\u64ce\u6709\u4e0d\u540c\u7684\u5730\u65b9\u3002"),(0,l.kt)("p",null,"\u4f46\u6709\u4e9b\u53d8\u5316\u96be\u4ee5\u907f\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\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\u6301\u4e86\u6240\u6709\u539f\u6709\u63a5\u53e3\u4e0d\u53d8\uff0c\u4f46\u6709\u4e9b\u7ec6\u8282\u548c\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,"\u670d\u52a1\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-service-pack/docs/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-service-pack/docs/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"))}k.isMDXComponent=!0}}]); |