- Mastering UI Development with Unity
- Ashley Godbold
- 213字
- 2021-08-27 18:43:12
Constant Pixel Size
When a Canvas has the UI Scale Mode set to Constant Pixel Size, every item in the UI will maintain its original pixel size regardless of the size of the screen. You'll note that this is the default setting, so by default UI does not scale; you must turn the setting on for it to scale with altering screen resolutions.

When you change the UI Scale Mode to Constant Pixel Size, you will see the following properties appear within the inspector:
- Scale Factor: This setting creates a scale multiple for all objects within the UI. For example, if you set this number to 2, everything within the UI will then double in size. If you set this number to 0.5, all items will have their size halved.
- Reference Pixels Per Unit: This setting determines how many pixels take up a single in-game unit. When this number is set to 100, that means two objects one game unit apart from each other will be 100 pixels apart. Put another way, if two objects are at the same y--coordinate, but one object has an x-coordinate of 1 and the other has an x-coordinate of 2, they are exactly 100 pixels apart. (This property works the same way in all other modes).
推薦閱讀
- JavaScript高效圖形編程
- C語言程序設計(第2 版)
- Python零基礎快樂學習之旅(K12實戰訓練)
- Mastering Unity Shaders and Effects
- TypeScript圖形渲染實戰:基于WebGL的3D架構與實現
- Java編程的邏輯
- Learning jQuery(Fourth Edition)
- HTML5秘籍(第2版)
- UNIX Linux程序設計教程
- Python程序設計開發寶典
- ABAQUS6.14中文版有限元分析與實例詳解
- Microsoft Exchange Server 2016 PowerShell Cookbook(Fourth Edition)
- Android開發權威指南(第二版)
- Puppet Cookbook(Third Edition)
- Node.js Web Development