mirror of
https://github.com/smallmain/cocos-enhance-kit.git
synced 2024-12-26 11:48:29 +00:00
1 line
6.0 KiB
JavaScript
1 line
6.0 KiB
JavaScript
"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[3475],{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 o(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?o(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(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={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[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):a(a({},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,o=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]||o;return n?r.createElement(m,a(a({ref:t},s),{},{components:n})):r.createElement(m,a({ref:t},s))}));function f(e,t){var n=arguments,i=t&&t.mdxType;if("string"==typeof e||i){var o=n.length,a=new Array(o);a[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,a[1]=c;for(var l=2;l<o;l++)a[l]=n[l];return r.createElement.apply(null,a)}return r.createElement.apply(null,n)}d.displayName="MDXCreateElement"},19062: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),o=(n(67294),n(3905)),a=["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-1.1.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-1.1.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/1.1.0/user-guide/text-render/text-high-dpi",draft:!1,tags:[],version:"1.1.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:"\u65b0\u7684 Char \u7f13\u5b58\u6a21\u5f0f",permalink:"/cocos-enhance-kit/docs/1.1.0/user-guide/text-render/text-char-mode"},next:{title:"RichText \u81ea\u5b9a\u4e49\u6750\u8d28",permalink:"/cocos-enhance-kit/docs/1.1.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,a);return(0,o.kt)("wrapper",(0,r.Z)({},d,c,{components:t,mdxType:"MDXLayout"}),(0,o.kt)("h1",{id:"\u9ad8-dpi-\u652f\u6301"},"\u9ad8 DPI \u652f\u6301"),(0,o.kt)("p",null,"\u53ef\u9605\u8bfb ",(0,o.kt)("a",{parentName:"p",href:"/cocos-enhance-kit/docs/1.1.0/start-guide/new-features#%E9%AB%98-dpi-%E6%96%87%E6%9C%AC%E6%B8%B2%E6%9F%93"},"\u4e0a\u624b\u5176\u5b83\u65b0\u7279\u6027")," \u4e86\u89e3\u57fa\u672c\u7684\u4f7f\u7528\u65b9\u6cd5\uff0c\u9664\u4e86\u6ce8\u610f\u6027\u80fd\u4ee5\u5916\uff0c\u6ca1\u6709\u5176\u5b83\u7684\u6ce8\u610f\u4e8b\u9879\u3002"),(0,o.kt)("hr",null),(0,o.kt)("h2",{id:"\u8c03\u6574\u5168\u5c40\u5f00\u5173"},"\u8c03\u6574\u5168\u5c40\u5f00\u5173"),(0,o.kt)("p",null,"\u4f7f\u7528\u4e0b\u9762\u7684\u4ee3\u7801\u63a7\u5236\u7ec4\u4ef6\u662f\u5426\u9ed8\u8ba4\u5f00\u542f\u9ad8 DPI \u652f\u6301\uff1a"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-js"},"cc.sp.enableLabelRetina = false;\n")),(0,o.kt)("hr",null),(0,o.kt)("h2",{id:"\u8c03\u6574\u6e32\u67d3\u7f29\u653e\u6bd4\u4f8b"},"\u8c03\u6574\u6e32\u67d3\u7f29\u653e\u6bd4\u4f8b"),(0,o.kt)("p",null,"\u4f7f\u7528\u4e0b\u9762\u7684\u4ee3\u7801\u8c03\u6574\u5185\u90e8\u6e32\u67d3\u7684\u7f29\u653e\u500d\u6570\uff1a"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-js"},"cc.sp.labelRetinaScale = 2;\n")),(0,o.kt)("hr",null),(0,o.kt)("h2",{id:"\u63a7\u5236\u5355\u4e2a\u7ec4\u4ef6\u5f00\u5173"},"\u63a7\u5236\u5355\u4e2a\u7ec4\u4ef6\u5f00\u5173"),(0,o.kt)("p",null,(0,o.kt)("img",{alt:"reinasettings",src:n(9639).Z,width:"770",height:"1176"})),(0,o.kt)("p",null,"\u9664\u4e86\u5728\u7f16\u8f91\u5668\u8c03\u6574\uff0c\u4e5f\u53ef\u4ee5\u901a\u8fc7\u4ee3\u7801\u63a7\u5236\uff1a"),(0,o.kt)("pre",null,(0,o.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},9639:function(e,t,n){t.Z=n.p+"assets/images/reina-settings-f11478266ad50ec3a9cfaec5d5171d3b.png"}}]); |