mirror of
https://github.com/smallmain/cocos-enhance-kit.git
synced 2024-12-26 11:48:29 +00:00
1 line
5.7 KiB
JavaScript
1 line
5.7 KiB
JavaScript
"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[1846],{3905:function(e,t,n){n.d(t,{Zo:function(){return s},kt:function(){return f}});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 u=r.createContext({}),l=function(e){var t=r.useContext(u),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},s=function(e){var t=l(e.components);return r.createElement(u.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,i=e.mdxType,a=e.originalType,u=e.parentName,s=c(e,["components","mdxType","originalType","parentName"]),d=l(n),f=i,m=d["".concat(u,".").concat(f)]||d[f]||p[f]||a;return n?r.createElement(m,o(o({ref:t},s),{},{components:n})):r.createElement(m,o({ref:t},s))}));function f(e,t){var n=arguments,i=t&&t.mdxType;if("string"==typeof e||i){var a=n.length,o=new Array(a);o[0]=d;var c={};for(var u in t)hasOwnProperty.call(t,u)&&(c[u]=t[u]);c.originalType=e,c.mdxType="string"==typeof e?e:i,o[1]=c;for(var l=2;l<a;l++)o[l]=n[l];return r.createElement.apply(null,o)}return r.createElement.apply(null,n)}d.displayName="MDXCreateElement"},46963:function(e,t,n){n.r(t),n.d(t,{assets:function(){return s},contentTitle:function(){return u},default:function(){return f},frontMatter:function(){return c},metadata:function(){return l},toc:function(){return p}});var r=n(87462),i=n(63366),a=(n(67294),n(3905)),o=["components"],c={sidebar_position:2,description:"\u4e00\u884c\u4ee3\u7801\u5f00\u542f\u9ad8\u6e05\u6587\u672c\u6e32\u67d3\u3002"},u="\u9ad8 DPI \u652f\u6301",l={unversionedId:"user-guide/text-render/text-high-dpi",id:"version-2.2.0/user-guide/text-render/text-high-dpi",title:"\u9ad8 DPI \u652f\u6301",description:"\u4e00\u884c\u4ee3\u7801\u5f00\u542f\u9ad8\u6e05\u6587\u672c\u6e32\u67d3\u3002",source:"@site/versioned_docs/version-2.2.0/user-guide/text-render/text-high-dpi.md",sourceDirName:"user-guide/text-render",slug:"/user-guide/text-render/text-high-dpi",permalink:"/cocos-enhance-kit/docs/2.2.0/user-guide/text-render/text-high-dpi",draft:!1,tags:[],version:"2.2.0",sidebarPosition:2,frontMatter:{sidebar_position:2,description:"\u4e00\u884c\u4ee3\u7801\u5f00\u542f\u9ad8\u6e05\u6587\u672c\u6e32\u67d3\u3002"},sidebar:"tutorialSidebar",previous:{title:"Char \u7f13\u5b58\u6a21\u5f0f",permalink:"/cocos-enhance-kit/docs/2.2.0/user-guide/text-render/text-char-mode"},next:{title:"RichText \u81ea\u5b9a\u4e49\u6750\u8d28",permalink:"/cocos-enhance-kit/docs/2.2.0/user-guide/text-render/text-richtext"}},s={},p=[{value:"\u8c03\u6574\u5168\u5c40\u5f00\u5173",id:"\u8c03\u6574\u5168\u5c40\u5f00\u5173",level:2},{value:"\u8c03\u6574\u6e32\u67d3\u7f29\u653e\u6bd4\u4f8b",id:"\u8c03\u6574\u6e32\u67d3\u7f29\u653e\u6bd4\u4f8b",level:2},{value:"\u63a7\u5236\u5355\u4e2a\u7ec4\u4ef6\u5f00\u5173",id:"\u63a7\u5236\u5355\u4e2a\u7ec4\u4ef6\u5f00\u5173",level:2}],d={toc:p};function f(e){var t=e.components,c=(0,i.Z)(e,o);return(0,a.kt)("wrapper",(0,r.Z)({},d,c,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("h1",{id:"\u9ad8-dpi-\u652f\u6301"},"\u9ad8 DPI \u652f\u6301"),(0,a.kt)("p",null,"\u53ef\u9605\u8bfb ",(0,a.kt)("a",{parentName:"p",href:"../../best-practices/quality-guide"},"\u63d0\u5347\u6e38\u620f\u8d28\u91cf")," \u4e86\u89e3\u57fa\u672c\u7684\u4f7f\u7528\u65b9\u6cd5\u3002"),(0,a.kt)("h2",{id:"\u8c03\u6574\u5168\u5c40\u5f00\u5173"},"\u8c03\u6574\u5168\u5c40\u5f00\u5173"),(0,a.kt)("p",null,"\u4f7f\u7528\u4e0b\u9762\u7684\u4ee3\u7801\u63a7\u5236\u6240\u6709\u7ec4\u4ef6\u662f\u5426\u9ed8\u8ba4\u5f00\u542f\u9ad8 DPI \u652f\u6301\uff1a"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-js"},"cc.sp.enableLabelRetina = false;\n")),(0,a.kt)("h2",{id:"\u8c03\u6574\u6e32\u67d3\u7f29\u653e\u6bd4\u4f8b"},"\u8c03\u6574\u6e32\u67d3\u7f29\u653e\u6bd4\u4f8b"),(0,a.kt)("p",null,"\u4f7f\u7528\u4e0b\u9762\u7684\u4ee3\u7801\u8c03\u6574\u5185\u90e8\u6e32\u67d3\u7684\u7f29\u653e\u500d\u6570\uff1a"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-js"},"cc.sp.labelRetinaScale = 2;\n")),(0,a.kt)("h2",{id:"\u63a7\u5236\u5355\u4e2a\u7ec4\u4ef6\u5f00\u5173"},"\u63a7\u5236\u5355\u4e2a\u7ec4\u4ef6\u5f00\u5173"),(0,a.kt)("p",null,(0,a.kt)("img",{alt:"reinasettings",src:n(93752).Z,width:"770",height:"1176"})),(0,a.kt)("p",null,"\u9664\u4e86\u5728\u7f16\u8f91\u5668\u8c03\u6574\uff0c\u4e5f\u53ef\u4ee5\u901a\u8fc7\u4ee3\u7801\u63a7\u5236\uff1a"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-js"},"// cc.RenderComponent.EnableType\n// GLOBAL: \u5168\u5c40\u9ed8\u8ba4\u503c\n// ENABLE: \u5f00\u542f\n// DISABLE: \u5173\u95ed\nlabel.enableRetina = cc.RenderComponent.EnableType.ENABLE;\n")))}f.isMDXComponent=!0},93752:function(e,t,n){t.Z=n.p+"assets/images/reina-settings-f11478266ad50ec3a9cfaec5d5171d3b.png"}}]); |