cocos-enhance-kit/assets/js/c442849e.c2ce1379.js
2024-11-29 14:09:52 +08:00

1 line
7.4 KiB
JavaScript

"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[3951],{3905:function(e,t,n){n.d(t,{Zo:function(){return u},kt:function(){return d}});var r=n(67294);function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(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?a(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(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,i=function(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var s=r.createContext({}),p=function(e){var t=r.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},u=function(e){var t=p(e.components);return r.createElement(s.Provider,{value:t},e.children)},l={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},f=r.forwardRef((function(e,t){var n=e.components,i=e.mdxType,a=e.originalType,s=e.parentName,u=c(e,["components","mdxType","originalType","parentName"]),f=p(n),d=i,m=f["".concat(s,".").concat(d)]||f[d]||l[d]||a;return n?r.createElement(m,o(o({ref:t},u),{},{components:n})):r.createElement(m,o({ref:t},u))}));function d(e,t){var n=arguments,i=t&&t.mdxType;if("string"==typeof e||i){var a=n.length,o=new Array(a);o[0]=f;var c={};for(var s in t)hasOwnProperty.call(t,s)&&(c[s]=t[s]);c.originalType=e,c.mdxType="string"==typeof e?e:i,o[1]=c;for(var p=2;p<a;p++)o[p]=n[p];return r.createElement.apply(null,o)}return r.createElement.apply(null,n)}f.displayName="MDXCreateElement"},73833:function(e,t,n){n.r(t),n.d(t,{assets:function(){return u},contentTitle:function(){return s},default:function(){return d},frontMatter:function(){return c},metadata:function(){return p},toc:function(){return l}});var r=n(87462),i=n(63366),a=(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",p={unversionedId:"best-practices/new-features",id:"version-2.3.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-2.3.0/best-practices/new-features.md",sourceDirName:"best-practices",slug:"/best-practices/new-features",permalink:"/cocos-enhance-kit/docs/2.3.0/best-practices/new-features",draft:!1,tags:[],version:"2.3.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/2.3.0/best-practices/quality-guide"},next:{title:"\u591a\u7eb9\u7406\u6e32\u67d3",permalink:"/cocos-enhance-kit/docs/2.3.0/user-guide/multi-render/multi-render-intro"}},u={},l=[{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}],f={toc:l};function d(e){var t=e.components,c=(0,i.Z)(e,o);return(0,a.kt)("wrapper",(0,r.Z)({},f,c,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("h1",{id:"\u65b0\u5f15\u64ce\u7279\u6027"},"\u65b0\u5f15\u64ce\u7279\u6027"),(0,a.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,a.kt)("h2",{id:"\u793e\u533a\u7248\u8bbe\u7f6e\u9762\u677f"},"\u793e\u533a\u7248\u8bbe\u7f6e\u9762\u677f"),(0,a.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,a.kt)("p",null,"\u4f9d\u6b21\u70b9\u51fb\u7f16\u8f91\u5668\u83dc\u5355\u9879 ",(0,a.kt)("strong",{parentName:"p"},"\u9879\u76ee - \u793e\u533a\u7248\u8bbe\u7f6e")," \u6253\u5f00\u8bbe\u7f6e\u9762\u677f\uff1a"),(0,a.kt)("p",null,(0,a.kt)("img",{alt:"settings-panel",src:n(2255).Z,width:"586",height:"338"})),(0,a.kt)("h2",{id:"\u652f\u6301-spriteframe-\u7ed9-spine-\u6362\u88c5"},"\u652f\u6301 SpriteFrame \u7ed9 Spine \u6362\u88c5"),(0,a.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,a.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,a.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,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-js"},"skeletonComponent.setRegionData('Head', 'Head', new sp.RegionData(spriteFrame));\n")),(0,a.kt)("p",null,(0,a.kt)("img",{alt:"changespine",src:n(32083).Z,width:"812",height:"456"})),(0,a.kt)("blockquote",null,(0,a.kt)("p",{parentName:"blockquote"},"\u56fe\u7247\u4e2d\u662f\u88ab\u6362\u5934\u7684\u5c0f\u7537\u5b69\u3002")),(0,a.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,a.kt)("a",{parentName:"p",href:"/cocos-enhance-kit/docs/2.3.0/user-guide/spine/spine-intro"},"Spine")," \u6587\u6863\u4e86\u89e3\u66f4\u591a\u8be6\u60c5\u3002"),(0,a.kt)("h2",{id:"\u652f\u6301-richtext-\u81ea\u5b9a\u4e49\u6750\u8d28"},"\u652f\u6301 RichText \u81ea\u5b9a\u4e49\u6750\u8d28"),(0,a.kt)("p",null,"\u53ef\u524d\u5f80 ",(0,a.kt)("a",{parentName:"p",href:"/cocos-enhance-kit/docs/2.3.0/user-guide/text-render/text-richtext"},"RichText \u81ea\u5b9a\u4e49\u6750\u8d28")," \u6587\u6863\u4e86\u89e3\u66f4\u591a\u8be6\u60c5\u3002"))}d.isMDXComponent=!0},32083:function(e,t,n){t.Z=n.p+"assets/images/changespine-07597b2bbccb77c69d37779189c496a7.png"},2255:function(e,t,n){t.Z=n.p+"assets/images/settings-panel-dd2e7db8f716bacf7f14119371643e10.png"}}]);