Unity3D NGUI ATLAS制作

来源:互联网 发布:全景图生成软件 编辑:程序博客网 时间:2024/04/30 02:51

atlas是NGUI使用的图集。使用该内容可以实现图片显示还有通过切换实现动画效果。这里主要记录一下atlas的制作过程。


首先了解atlas的参数内容。


Material: 该内容包含了图籍的图片,还有Shade信息
TP Import: 在使用TexturePacker到处类型为unity3d时。直接使用.txt数据即可。立即可以实现sprite的划分和实现。后续的参数都自动生成。如果不是倒入就忽略。
Coordinates:坐标格式。使用pixels吧。好算一点。
New Sprite:创建图片信息。其实就是sprite名字,在大图片中的位置。
Sprite drop-down list lets you choose the sprite you’re working with.
Edit Name field allows you to rename your sprite to something more appropriate.
Dimensions is used to specify where your sprite begins as well as its size.
Border is used for 9-sliced sprites, allowing you to specify the part of the sprite that should not get scaled or scaled in only one direction. It’s used by sliced sprites.
Padding is the amount of pixel offset applied to all 4 sides. It’s used to adjust the pivot point, and is mainly a feature used by Texture Packer and the Atlas Maker when sprites get trimmed.
Show field lets you examine your sprite and its location in the atlas.


然后就是建立一个atlas的步骤。我使用了texturePacker打包图片。


1.使用texturePacker打包图片输出文件atlas.png、atlas.txt.让如unity3d资源中。后续所有操作都在untiy3d中
2.在project中创建一个atlasmaterial。shade选择 unlit-Transparent Colored,图片选择atlas.png
3.在hierarchy创建一个空对象。把对象拖到project,重命名为atlas,删除hierarchy中的对象。
4.给atlas添加一个atlas组件 componet->NGUI->UI->Atlas
5.把atlasmaterial拖入material
6.把atlas.txt拖入TP。
7.atlas制作完毕。所有的sprite是以原来的图片名命名的。


另外发现发现使用NGUI自带的Fantasy Atlas作为背景,在其上使用自己制作的Atlas的Sprite的时候,Sprite必须要旋转一定角度才能显示。把Fantasy的material换成重新生成的material就解决问题了。目前不知道问题原因。我使用的unity3d 3.4.2 pro

原创粉丝点击