UGUI 学习笔记 4 Image
来源:互联网 发布:免费下载音乐的软件 编辑:程序博客网 时间:2024/05/19 03:22
- 属性详解
Source Image: The texture that represents the image to display(which must be imported as a Sprite). 图片,纹理格式必须是Sprite.
Color: The Color to apply to the image. 颜色
Material :The Material to use for rendering the image. 材质球
Raycast Target : Should this be considered a target for raycasting? 射线目标
Preserve Aspect : Ensure image remains existing dimension. 保持比例
Set Native Size : Button to set the dimensions of the image bos to the original pixel size of the texture. 设置原图大小
2. Image Type详解
Simple,根据Image的长宽,拉伸图片。如果勾选了Preserve Aspect,会保持图片的长宽比拉伸。
Sliced,选中图片在Sprite Editor编辑拉伸区域,绿色线划分出来的四个角不做拉伸,蓝色圈区域会横向拉伸,红色圈区域会纵向拉伸。中间区域既有横向拉伸,也有纵向拉伸。如果不勾选 Fill Center ,中间区域将不会显示。
Tiled 如果图片没有编辑拉伸区域,则图片会保持原有的大小,平铺整个Image。如果图片有编辑拉区域,则四个角不变,横向用蓝色圈区域平铺,纵向用红色圈区域平铺,中间部分用绿色线划分的中间区域平铺。如果不勾选 Fill Center ,中间区域将不会显示。
Filled 中有4个参数Fill Method, Fill Origin, Fill Amount, Clock wise
Fill Method是填充方法,Horizontal 是水平方向,Vertical 是垂直方向,Radial 90 是90° Radial 180是 180° Radial 360是 360°
Fill Origin 是填充开始位置 Bottom 底,Top 顶,Left 左,Right 右。
Fill Amount 是填充值,范围0~1;
Clock wise 是顺时针方向填充。
3. 代码控制
脚本添加引用 using UnityEngine.UI; 才能使用UGUI的控件。
将图片绑定到预制体上,通过预制体来引用图片。
编写工具代码
引用代码示例
- UGUI 学习笔记 4 Image
- UGUI 学习笔记 5 Raw Image
- UGUI学习笔记
- UGUI学习笔记
- UGUI 学习笔记
- UGUI学习笔记
- Unity3D UGUI学习笔记
- UGUI学习笔记1
- 【Unity学习笔记】——基础篇:UGUI基础Image Type
- UGUI 学习笔记 1 图集
- UGUI 学习笔记 6 Button
- UGUI 学习笔记7 Toggle
- UGUI 学习笔记8 Slider
- UGUI 学习笔记10 InputField
- UGUI学习笔记4——UI Events,Event Triggers
- Unity3D 学习笔记4 —— UGUI+uLua游戏框架
- UGUI源码学习之初涉Image(一)
- ugui Image控件介绍
- K:线性表的实现—链表
- IEDN中:war exploded: Error during artifact deployment. See server log for details.
- Hive 笔记异常java.sql.SQLException: Unable to open a test connection to the given database.
- 专业术语翻译
- winform 控件中显示实时时间
- UGUI 学习笔记 4 Image
- Monkey脚本检测内存泄漏学习小记
- The Water Problem RMQ区间最大值
- Fragment
- “天鸽”袭港遇天鸽被沽空,最有力的证据还是业绩
- mysql 使用CONCAT函数、group_concat函数,查询的结果为bolob类型解决办法
- linux打补丁和git打patch方法
- Android 检测应用中的UI卡顿的工具
- 网狐棋牌6603棋牌商业源码+详细架设教程!