首页 > 代码库 > UIPanel
UIPanel
【UIPanel】
UIPanel is a component that collects and manages all widgets underneath it. UIPanel is responsible for creating the actual draw calls using the widget‘s geometry. Without panels, nothing can be drawn.
All panels have a Depth value which affects all widgets underneath.The depth value of panels carries a lot more weight than the depth value on individual widgets, so it‘s a good idea to ensure that your panels don‘t share depth values. If values get shared, draw calls will start to get split up frequently in order to preserve the draw order, resulting in a lot more draw calls than usual.
- Alpha 属性影响它下面的所有的挂件。用它来实现整个窗口的淡出是不错的方式。
- 如果你的UI受灯光影响,请确认你勾选了Normals复选框
- 如果你正在创建一个可滚动的panel,它里面有大量几何图形,你可能应该勾选Cull选项去减少三角形面数。注意这么做实际可能会降低性能,因为它会在每个update都检查挂件的可见性!
- 勾选Static复选框会告诉NGUI这个Panel下面的挂件不需要移动从而提高性能。NGUI会忽略检查position/rotation/scale的变化。注意这么做意味着在运行时移动挂件不会有任何效果——不过还是要注意。
裁剪功能(Clipping)
如果你正在寻找关于Anchors部分的文档,你能在他的基类 -- UIRect中找到。
参考:
1、http://www.tasharen.com/forum/index.php?topic=6705
2、http://blog.csdn.net/kakashi8841/article/details/20641375