U3D UGUI学习2 - Canvas
Canvas
Render Mode - UGUI不像NGUI,它没有UI摄像机。但有时候需要做相机动画就要调出来。
在Canvas里设置第二个选项即可调出。
Pixel Perferct - 这个似乎是可以得到更好的像素显示但牺牲宽度高度,就是以前对齐的UI,现在显示效果更好但对不齐。NGUI里UI如果有小数点会模糊,我不知道和这个有没有关,但我在Unity试了,有小数点和没小数点都一样。和开不开这个选项没关系
论坛了看下,官方是这么说的:(LINK)
Hi, I just investigated your bug with Runes help. And we have bad news and good news. Let's start with the bad one: What you describe is by design. When pixel snapping elements that don't have a integer sizes, you have two options, either you guaranteed that their sizes will be constant, but the spacing between elements can vary, or you guarantee that their sizes can vary but the spacing between elements will remain constant. We have chosen to make the spacing constant, this guarantees for instance that if you put two elements besides each other without a gap, if you move or resize them, there will be no gap between them. Now let's go to the good news: There is a simple workaround you can use to make sure your elements do not resize while moving. Instead of moving the element directly, create an empty GameObject and make it the elements parent, and use the parent to move it instead. This should fix your issues. Hope this helps
Canvas Scaler
这个和NGUI差不多,其实是设置宽高比。这里摘自某位朋友博客:
Constant Pixel Size:保持UI元素大小不变,无论屏幕尺寸如何变化。
Scale Factor:保持大小的比例 。原图100x100 原始大小1=100x100 原来的2倍大 2=200x200
Reference Pixels Per Unity 100 Unity里的1单位大小代表100像素
Scale With Screen Size:UI元素大小跟随屏幕分辨率的大小变化而变化。
Reference Resolution:参考分辨率,该分辨率越大,Canvas Scale越小。
Screen Match Mode:
Match Width Or Height:根据参考分辨率的高或宽,来缩放UI元素。
Expland:分辨率设置不会小于Canvas设置的分辨率。
Shrink:分辨率不会大于Canvas设置的分辨率。
Match: Width缩放参考Width。 此时拉伸Reference Resolution Y是无效的。
Constant Physical Size:UI元素保持 Physical Size,无论屏幕大小如何变化。
Physical Unit:物理单位
Fallback Screen DPI:
Default Sprite DPI:
U3D UGUI学习2 - Canvas的更多相关文章
- U3D UGUI学习1 - 层级环境
就像主动碰撞检测需要刚体,刚体需要Mesh Filter.Unity的一些组件都需要基础配置. UGUI的基础配置和NGUI差不多,把NGUI的那些中间件全部削减干净,甚至连快捷键也没有. 1.基础层 ...
- U3D UGUI学习3 - RectTransform
总的来说整合了NGUI很多零散功能,比如NGUI2.X处理拉伸要额外套脚本,NGUI3.X开始引入新的锚点.再加上依赖BoxCollider使得整个HUD显示非常乱 而UGUI很清晰明了,你也能看清楚 ...
- U3D UGUI学习4 - Text
1.对应NGUI的四种文字显示模式 Shrink Content 对应NGUI第一种模式 勾选Best Fit 但似乎有一个Bug,文字过多的时候会爆框.解决方法是改变Line Spacing ...
- U3D UGUI学习5 - Layout和文字适配
Layout这部分UGUI算是比NGUI做的到位 之前遇到了一个问题,NGUI做文字和背景框适配和容易,绑定一下就好了.UGUI你得弄Layout才可以,而且还需要配置. 但这个Layout使用场合是 ...
- Unity3D UGUI学习系列索引(暂未完成)
U3D UGUI学习1 - 层级环境 U3D UGUI学习2 - Canvas U3D UGUI学习3 - RectTransform U3D UGUI学习4 - Text U3D UGUI学习5 - ...
- UGUI学习——Canvas基础组件
UGUI的分辨率自适应的机制 UGUI中,Canvas(画布)可以看成电脑屏幕,其功能和属性都是一样的.游戏中的分辨率自适应主要包括两部分: 1. 缩放适应:是在不同尺寸的屏幕下,整体缩放比例的计算方 ...
- HTML5学习总结——canvas绘制象棋(canvas绘图)
一.HTML5学习总结——canvas绘制象棋 1.第一次:canvas绘制象棋(笨方法)示例代码: <!DOCTYPE html> <html> <head> & ...
- 学习HTML5 canvas遇到的问题
学习HTML5 canvas遇到的问题 1. 非零环绕原则(nonzZero rule) 非零环绕原则是canvas在进行填充的时候是否要进行填充的判断依据. 在判断填充的区域拉一条线出来,拉到图形的 ...
- 转载《学习HTML5 canvas遇到的问题》
学习HTML5 canvas遇到的问题 1. 非零环绕原则(nonzZero rule) 非零环绕原则是canvas在进行填充的时候是否要进行填充的判断依据. 在判断填充的区域拉一条线出来,拉到图形的 ...
随机推荐
- Lintcode: Segment Tree Query
For an integer array (index from 0 to n-1, where n is the size of this array), in the corresponding ...
- sdutoj 2154 Shopping
http://acm.sdut.edu.cn/sdutoj/problem.php?action=showproblem&problemid=2154 Shopping Time Limit: ...
- [原创]java WEB学习笔记90:Hibernate学习之路-- -HQL检索方式,分页查询,命名查询语句,投影查询,报表查询
本博客的目的:①总结自己的学习过程,相当于学习笔记 ②将自己的经验分享给大家,相互学习,互相交流,不可商用 内容难免出现问题,欢迎指正,交流,探讨,可以留言,也可以通过以下方式联系. 本人互联网技术爱 ...
- [原创] 在spring 中使用quarts
1.使用maven加载 quarts 的jar <dependency> <groupId>org.quartz-scheduler</groupId> <a ...
- c++之路进阶——hdu3507(Print Article)
参考博文:http://www.cnblogs.com/ka200812/archive/2012/08/03/2621345.html//讲的真的很好,有个小错误,博客里的num全为sum,像我这种 ...
- POJ 3243 Clever Y(离散对数-拓展小步大步算法)
Description Little Y finds there is a very interesting formula in mathematics: XY mod Z = K Given X, ...
- 一天弹出一次广告cookie
function setCookie(name, value, expire) { window.document.cookie = name + "=" + escape(val ...
- linux-统计一个文件中出现的单词数
#!/bin/bash ] then echo "Usage: $0 filename"; exit - fi filename=$ egrep -o "\b[[:alp ...
- Script to set the Purchase Order Status to ‘OPEN’(将采购订单重新打开)
Business Requirement: The finance user requests the IT team to change the PO status to OPEN as they ...
- Bishop的大作《模式识别与机器学习》Ready to read!
久仰Bishop的大作“Pattern Recognition and Machine Learning”已久,在我的硬盘里已经驻扎一年有余,怎奈惧其页数浩瀚,始终未敢入手.近日看文献,屡屡引用之.不 ...