mirror of
https://github.com/smallmain/cocos-enhance-kit.git
synced 2024-12-26 03:38:29 +00:00
1 line
8.2 KiB
JavaScript
1 line
8.2 KiB
JavaScript
"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[8466],{3905:function(e,t,n){n.d(t,{Zo:function(){return p},kt:function(){return f}});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 i(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 o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){a(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function c(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var s=r.createContext({}),l=function(e){var t=r.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},p=function(e){var t=l(e.components);return r.createElement(s.Provider,{value:t},e.children)},u={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},d=r.forwardRef((function(e,t){var n=e.components,a=e.mdxType,i=e.originalType,s=e.parentName,p=c(e,["components","mdxType","originalType","parentName"]),d=l(n),f=a,m=d["".concat(s,".").concat(f)]||d[f]||u[f]||i;return n?r.createElement(m,o(o({ref:t},p),{},{components:n})):r.createElement(m,o({ref:t},p))}));function f(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var i=n.length,o=new Array(i);o[0]=d;var c={};for(var s in t)hasOwnProperty.call(t,s)&&(c[s]=t[s]);c.originalType=e,c.mdxType="string"==typeof e?e:a,o[1]=c;for(var l=2;l<i;l++)o[l]=n[l];return r.createElement.apply(null,o)}return r.createElement.apply(null,n)}d.displayName="MDXCreateElement"},95083:function(e,t,n){n.r(t),n.d(t,{assets:function(){return p},contentTitle:function(){return s},default:function(){return f},frontMatter:function(){return c},metadata:function(){return l},toc:function(){return u}});var r=n(87462),a=n(63366),i=(n(67294),n(3905)),o=["components"],c={sidebar_position:3,description:"\u4e86\u89e3\u5e76\u4e0a\u624b\u793e\u533a\u7248\u63d0\u4f9b\u7684\u65b0\u7279\u6027\u3002"},s="\u65b0\u5f15\u64ce\u7279\u6027",l={unversionedId:"best-practices/new-features",id:"version-3.0.0/best-practices/new-features",title:"\u65b0\u5f15\u64ce\u7279\u6027",description:"\u4e86\u89e3\u5e76\u4e0a\u624b\u793e\u533a\u7248\u63d0\u4f9b\u7684\u65b0\u7279\u6027\u3002",source:"@site/versioned_docs/version-3.0.0/best-practices/new-features.md",sourceDirName:"best-practices",slug:"/best-practices/new-features",permalink:"/cocos-enhance-kit/docs/best-practices/new-features",draft:!1,tags:[],version:"3.0.0",sidebarPosition:3,frontMatter:{sidebar_position:3,description:"\u4e86\u89e3\u5e76\u4e0a\u624b\u793e\u533a\u7248\u63d0\u4f9b\u7684\u65b0\u7279\u6027\u3002"},sidebar:"tutorialSidebar",previous:{title:"\u63d0\u5347\u6e38\u620f\u8d28\u91cf",permalink:"/cocos-enhance-kit/docs/best-practices/quality-guide"},next:{title:"\u591a\u7eb9\u7406\u6e32\u67d3",permalink:"/cocos-enhance-kit/docs/user-guide/multi-render/multi-render-intro"}},p={},u=[{value:"\u793e\u533a\u7248\u8bbe\u7f6e\u9762\u677f",id:"\u793e\u533a\u7248\u8bbe\u7f6e\u9762\u677f",level:2},{value:"\u652f\u6301 SpriteFrame \u7ed9 Spine \u6362\u88c5",id:"\u652f\u6301-spriteframe-\u7ed9-spine-\u6362\u88c5",level:2},{value:"\u652f\u6301 RichText \u81ea\u5b9a\u4e49\u6750\u8d28",id:"\u652f\u6301-richtext-\u81ea\u5b9a\u4e49\u6750\u8d28",level:2},{value:"\u6027\u80fd\u6307\u793a\u5668\u589e\u5f3a",id:"\u6027\u80fd\u6307\u793a\u5668\u589e\u5f3a",level:2}],d={toc:u};function f(e){var t=e.components,c=(0,a.Z)(e,o);return(0,i.kt)("wrapper",(0,r.Z)({},d,c,{components:t,mdxType:"MDXLayout"}),(0,i.kt)("h1",{id:"\u65b0\u5f15\u64ce\u7279\u6027"},"\u65b0\u5f15\u64ce\u7279\u6027"),(0,i.kt)("p",null,"\u793e\u533a\u7248\u6dfb\u52a0\u4e86\u4e00\u4e9b\u5b9e\u7528\u7684\u65b0\u7279\u6027\uff0c\u5e2e\u52a9\u4f60\u66f4\u597d\u5730\u5f00\u53d1\u6e38\u620f\u3002"),(0,i.kt)("h2",{id:"\u793e\u533a\u7248\u8bbe\u7f6e\u9762\u677f"},"\u793e\u533a\u7248\u8bbe\u7f6e\u9762\u677f"),(0,i.kt)("p",null,"\u7531\u4e8e v2.x \u6ca1\u6709\u63d0\u4f9b\u5b98\u65b9 API \u5f80\u5f15\u64ce\u539f\u6709\u7684\u8bbe\u7f6e\u9762\u677f\u4e0a\u6dfb\u52a0\u8bbe\u7f6e\u9879\uff0c\u6240\u4ee5\u6211\u4eec\u53e6\u5916\u589e\u52a0\u4e86\u4e00\u4e2a\u8bbe\u7f6e\u9762\u677f\u3002"),(0,i.kt)("p",null,"\u4f9d\u6b21\u70b9\u51fb\u7f16\u8f91\u5668\u83dc\u5355\u9879 ",(0,i.kt)("strong",{parentName:"p"},"\u9879\u76ee - \u793e\u533a\u7248\u8bbe\u7f6e")," \u6253\u5f00\u8bbe\u7f6e\u9762\u677f\uff1a"),(0,i.kt)("p",null,(0,i.kt)("img",{alt:"settings-panel",src:n(77515).Z,width:"586",height:"338"})),(0,i.kt)("h2",{id:"\u652f\u6301-spriteframe-\u7ed9-spine-\u6362\u88c5"},"\u652f\u6301 SpriteFrame \u7ed9 Spine \u6362\u88c5"),(0,i.kt)("p",null,"\u5b98\u65b9\u6587\u6863\u4e2d\u4ecb\u7ecd\u4e86\u66ff\u6362 attachment \u5bf9\u8c61\u8fdb\u884c\u6362\u88c5\u7684\u65b9\u6cd5\uff0c\u4f46\u5982\u679c\u52a8\u753b\u4e2d\u6709\u5207\u6362 attachment \u7684\u5173\u952e\u5e27\uff0c\u8fd9\u79cd\u65b9\u6cd5\u5c31\u5931\u6548\u4e86\u3002"),(0,i.kt)("p",null,"\u8fd8\u6709\u4e00\u79cd\u65b9\u6cd5\u662f\u4fee\u6539 attachment \u7684 region \u5bf9\u8c61\u6765\u8fdb\u884c\u6362\u88c5\uff0c\u4f46\u8fd9\u79cd\u65b9\u6cd5\u5f15\u64ce\u6ca1\u6709\u76f4\u63a5\u652f\u6301\uff0c\u6240\u4ee5\u793e\u533a\u7248\u5bf9\u5176\u8fdb\u884c\u4e86\u652f\u6301\u3002"),(0,i.kt)("p",null,"\u53ea\u9700\u8981\u4e00\u53e5\u4ee3\u7801\u5373\u53ef\u4f7f\u7528 cc.SpriteFrame \u7684\u6570\u636e\u4fee\u6539 attachment \u7684 region \u5bf9\u8c61\u6570\u636e\uff1a"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-js"},"skeletonComponent.setRegionData('Head', 'Head', new sp.RegionData(spriteFrame));\n")),(0,i.kt)("p",null,(0,i.kt)("img",{alt:"changespine",src:n(26909).Z,width:"812",height:"456"})),(0,i.kt)("blockquote",null,(0,i.kt)("p",{parentName:"blockquote"},"\u56fe\u7247\u4e2d\u662f\u88ab\u6362\u5934\u7684\u5c0f\u7537\u5b69\u3002")),(0,i.kt)("p",null,"\u8fd9\u6837\u505a\u662f\u76f4\u63a5\u4fee\u6539\u4e86 SkeletonData \u7684\u6570\u636e\uff0c\u6240\u6709\u4f7f\u7528\u8be5\u6570\u636e\u7684 Spine \u7ec4\u4ef6\u90fd\u4f1a\u53d7\u5230\u5f71\u54cd\uff08\u88ab\u6362\u5934\uff09\uff0c\u4f46\u6211\u4eec\u63d0\u4f9b\u4e86\u514b\u9686 SkeletonData \u6570\u636e\u7684\u63a5\u53e3\uff0c\u53ef\u524d\u5f80 ",(0,i.kt)("a",{parentName:"p",href:"/cocos-enhance-kit/docs/user-guide/spine/spine-intro"},"Spine")," \u6587\u6863\u4e86\u89e3\u66f4\u591a\u8be6\u60c5\u3002"),(0,i.kt)("h2",{id:"\u652f\u6301-richtext-\u81ea\u5b9a\u4e49\u6750\u8d28"},"\u652f\u6301 RichText \u81ea\u5b9a\u4e49\u6750\u8d28"),(0,i.kt)("p",null,"\u53ef\u524d\u5f80 ",(0,i.kt)("a",{parentName:"p",href:"/cocos-enhance-kit/docs/user-guide/text-render/text-richtext"},"RichText \u81ea\u5b9a\u4e49\u6750\u8d28")," \u6587\u6863\u4e86\u89e3\u66f4\u591a\u8be6\u60c5\u3002"),(0,i.kt)("h2",{id:"\u6027\u80fd\u6307\u793a\u5668\u589e\u5f3a"},"\u6027\u80fd\u6307\u793a\u5668\u589e\u5f3a"),(0,i.kt)("p",null,"\u4f18\u5316\u4e86\u5f15\u64ce\u81ea\u5e26\u7684\u6027\u80fd\u6307\u793a\u5668\uff0c\u589e\u52a0\u4e86\u4e09\u4e2a\u91cd\u8981\u7684\u6027\u80fd\u6307\u6807\uff1a"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Label Canvas\uff08Label \u7ec4\u4ef6\u7684 Canvas \u6570\u91cf\uff09"),(0,i.kt)("li",{parentName:"ul"},"Char Atlas\uff08Char \u5b57\u7b26\u56fe\u96c6\u4f7f\u7528\u60c5\u51b5\uff09"),(0,i.kt)("li",{parentName:"ul"},"Dynamic Atlas\uff08\u52a8\u6001\u56fe\u96c6\u4f7f\u7528\u60c5\u51b5\uff09")),(0,i.kt)("p",null,(0,i.kt)("img",{alt:"demo6",src:n(79890).Z,width:"350",height:"152"})))}f.isMDXComponent=!0},79890:function(e,t,n){t.Z=n.p+"assets/images/demo6-56d57634201f968039d2b7a3d76a8269.png"},26909:function(e,t,n){t.Z=n.p+"assets/images/changespine-07597b2bbccb77c69d37779189c496a7.png"},77515:function(e,t,n){t.Z=n.p+"assets/images/settings-panel-dd2e7db8f716bacf7f14119371643e10.png"}}]); |