Unity-UI(UGUI详解)01基础概念、自动布局、动画集成、富文本

Canvas

Canvas应该包含全部UI元素,全部的UI元素应该时Canvas的子物体
调整元素的显示顺序可以从Hierarchy中直接拖拽他们,顺序从也可以被控制通过Scripting使用 SetAsFirstSibling, SetAsLastSibling, and SetSiblingIndex.这些方法。

RenderModes
  • Screen space - Overlay:
    这个模式,UI将渲染在screen的最上层
    This render mode places UI elements on the screen rendered on top of the scene. If the screen is resized or changes resolution, the Canvas will automatically change size to match this.
  • Screen Space - Camera :
    这个模式类似于Overlay,但是Canvas被放置在一个Camera前面一定距离,UI将通过camera进行渲染,相机的渲染效果将影响UI的表现,如果相机是透视视角,UI将被渲染成透视效果
    This is similar to Screen Space - Overlay, but in this render mode the Canvas is placed a given distance in front of a specified Camera. The UI elements are rendered by this camera, which means that the Camera settings affect the appearance of the UI. If the Camera is set to Perspective, the UI elements will be rendered with perspective, and the amount of perspective distortion can be controlled by the Camera Field of View. If the screen is resized, changes resolution, or the camera frustum changes, the Canvas will automatically change size to match as well.
  • World space:
    渲染规则将和世界坐标中的object相同。
    In this render mode, the C
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值