cocos-enhance-kit/assets/js/d9ba00fb.447c9017.js
2024-12-20 14:47:15 +08:00

1 line
5.7 KiB
JavaScript

"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[6659],{3905:function(e,t,n){n.d(t,{Zo:function(){return s},kt:function(){return f}});var r=n(67294);function o(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 a(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){o(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,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(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)&&(o[n]=e[n])}return o}var l=r.createContext({}),u=function(e){var t=r.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):a(a({},t),e)),n},s=function(e){var t=u(e.components);return r.createElement(l.Provider,{value:t},e.children)},p={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,o=e.mdxType,i=e.originalType,l=e.parentName,s=c(e,["components","mdxType","originalType","parentName"]),d=u(n),f=o,b=d["".concat(l,".").concat(f)]||d[f]||p[f]||i;return n?r.createElement(b,a(a({ref:t},s),{},{components:n})):r.createElement(b,a({ref:t},s))}));function f(e,t){var n=arguments,o=t&&t.mdxType;if("string"==typeof e||o){var i=n.length,a=new Array(i);a[0]=d;var c={};for(var l in t)hasOwnProperty.call(t,l)&&(c[l]=t[l]);c.originalType=e,c.mdxType="string"==typeof e?e:o,a[1]=c;for(var u=2;u<i;u++)a[u]=n[u];return r.createElement.apply(null,a)}return r.createElement.apply(null,n)}d.displayName="MDXCreateElement"},86040:function(e,t,n){n.r(t),n.d(t,{assets:function(){return s},contentTitle:function(){return l},default:function(){return f},frontMatter:function(){return c},metadata:function(){return u},toc:function(){return p}});var r=n(87462),o=n(63366),i=(n(67294),n(3905)),a=["components"],c={sidebar_position:2,description:"\u63d0\u5347\u6e38\u620f\u7684\u8d28\u91cf\u3002"},l="\u63d0\u5347\u6e38\u620f\u8d28\u91cf",u={unversionedId:"best-practices/quality-guide",id:"version-3.0.0/best-practices/quality-guide",title:"\u63d0\u5347\u6e38\u620f\u8d28\u91cf",description:"\u63d0\u5347\u6e38\u620f\u7684\u8d28\u91cf\u3002",source:"@site/versioned_docs/version-3.0.0/best-practices/quality-guide.md",sourceDirName:"best-practices",slug:"/best-practices/quality-guide",permalink:"/cocos-enhance-kit/docs/best-practices/quality-guide",draft:!1,tags:[],version:"3.0.0",sidebarPosition:2,frontMatter:{sidebar_position:2,description:"\u63d0\u5347\u6e38\u620f\u7684\u8d28\u91cf\u3002"},sidebar:"tutorialSidebar",previous:{title:"\u63d0\u5347\u6e38\u620f\u6027\u80fd",permalink:"/cocos-enhance-kit/docs/best-practices/performance-guide"},next:{title:"\u65b0\u5f15\u64ce\u7279\u6027",permalink:"/cocos-enhance-kit/docs/best-practices/new-features"}},s={},p=[{value:"\u9ad8 DPI \u6587\u672c\u6e32\u67d3",id:"\u9ad8-dpi-\u6587\u672c\u6e32\u67d3",level:2}],d={toc:p};function f(e){var t=e.components,c=(0,o.Z)(e,a);return(0,i.kt)("wrapper",(0,r.Z)({},d,c,{components:t,mdxType:"MDXLayout"}),(0,i.kt)("h1",{id:"\u63d0\u5347\u6e38\u620f\u8d28\u91cf"},"\u63d0\u5347\u6e38\u620f\u8d28\u91cf"),(0,i.kt)("p",null,"\u793e\u533a\u7248\u52a0\u5165\u4e86\u4e00\u4e9b\u65b0\u7279\u6027\uff0c\u4f7f\u5f97\u4f60\u80fd\u63d0\u5347\u6e38\u620f\u5404\u65b9\u9762\u7684\u8d28\u91cf\u3002"),(0,i.kt)("h2",{id:"\u9ad8-dpi-\u6587\u672c\u6e32\u67d3"},"\u9ad8 DPI \u6587\u672c\u6e32\u67d3"),(0,i.kt)("p",null,"\u4ee5\u524d\u6211\u4eec\u4f1a\u4f7f\u7528\u5c06 Label \u5b57\u53f7\u653e\u5927\u4e00\u500d\uff0cLabel \u8282\u70b9\u7f29\u5c0f\u4e00\u500d\u7684\u65b9\u5f0f\u53bb\u89e3\u51b3\u5b57\u4f53\u6a21\u7cca\u7684\u95ee\u9898\u3002"),(0,i.kt)("p",null,"\u800c\u73b0\u5728\u4e0d\u9700\u8981\u4e86\uff0c\u4f60\u53ef\u4ee5\u901a\u8fc7\u4e00\u53e5\u4ee3\u7801\u8c03\u6574\u6e32\u67d3\u6bd4\u4f8b\uff1a"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-js"},"cc.sp.labelRetinaScale = 2; // \u6e32\u67d3\u6587\u672c\u65f6\u7eb9\u7406\u7684\u7f29\u653e\u500d\u6570\uff0c\u9ed8\u8ba4\u503c\u4e3a 1.\n")),(0,i.kt)("p",null,(0,i.kt)("img",{alt:"labelscaledemo",src:n(94132).Z,width:"2688",height:"1552"})),(0,i.kt)("blockquote",null,(0,i.kt)("p",{parentName:"blockquote"},"\u56fe\u7247\u4e2d\uff0c\u4e0a\u65b9\u7684\u662f\u5f00\u542f\u540e\u6548\u679c\uff0c\u4e0b\u9762\u662f\u672a\u5f00\u542f\u6548\u679c\u3002")),(0,i.kt)("p",null,(0,i.kt)("strong",{parentName:"p"},"\u63a8\u8350\u4f60\u6839\u636e\u8bbe\u5907\u50cf\u7d20\u6bd4\uff08devicePixelRatio\uff09\u6765\u52a8\u6001\u8bbe\u7f6e\u8be5\u503c\uff0c\u5e76\u4e14\u8be5\u503c\u4e0d\u8981\u5927\u4e8e ",(0,i.kt)("inlineCode",{parentName:"strong"},"2"),"\uff0c\u8fd9\u4e0d\u4f1a\u5e26\u6765\u66f4\u597d\u7684\u6548\u679c\uff0c\u4f46\u5374\u5c06\u5b57\u4f53\u7eb9\u7406\u653e\u5927\u4e86\u6570\u500d\uff0c\u4f1a\u5f71\u54cd\u5230\u6e38\u620f\u6574\u4f53\u6027\u80fd\u3002")),(0,i.kt)("p",null,"\u53ef\u524d\u5f80 ",(0,i.kt)("a",{parentName:"p",href:"/cocos-enhance-kit/docs/user-guide/text-render/text-high-dpi"},"\u9ad8 DPI \u652f\u6301")," \u6587\u6863\u4e86\u89e3\u66f4\u591a\u8be6\u60c5\u3002"))}f.isMDXComponent=!0},94132:function(e,t,n){t.Z=n.p+"assets/images/labelscaledemo-f3a6e3115a7fd1ab729cd37e6e4a0d95.png"}}]);