在NGUI 中 sprite分为四种类型:simple、sliced、tiled、filled。
- simple 类型:使用simple类型时,sprite的显示和你做好的atlas 中的 sprite是一样的,不会有什么改变。
- sliced 类型: sliced 意思是 切片的意思,就是说它只是原图的一个部分。在sprite的创建如下:
sliced 使用的部分就是 中间的那部分。这中间的部分的设置由 Border 属性设置。
- tiled 类型:tiled指的是块的意思。当我们使用sprite的时候,最开始sprite在视图中显示的是sprite的原始大小,即这个时候widget的大小是刚好对齐(snap)的。但往往这个大小不是我们需要的,我们需要放大。我们就会修改widget下的,改变大小。
注意了,这个时候,区别就出来了。当widget的dimensions的大小大于 sprite的原始大小时,simple、sliced和 tiled 就会表现出不同了。
simple、sliced:拉伸自己,填充满widget的空间。
tiled:不拉伸自己,而是复制多个本身大小的sprite来填充widget空间
-
filled 类型:
-
filled 设置 选项如下:
-
我们可以选择从不同的方向对sprite做出改变,改变的大小有Fill Amount决定。 invert Fill 会镜像翻转。
-