找回密码
 立即注册

[NGUI]NGUI图集Atlas制作简介

已有 1259 次阅读2013-8-12 10:58 | border, 图片, 制作, 标签, 命名

此教程属于NGUI的具体操作,主要描述怎么制作一个游戏中的UI,相对来说比较简单,熟能生巧哇,动手操作一遍就可以完全掌握的。
1,在PS里面设计好要做的UI,然后切片成很多个png的图片(这属于美工的活啦,所以会描述的的比较简单点哈)
2,在Unity Project下新建一个Folder,F2重命名为ResUI,以后就用来存放所有的UI,在ResUI里面重新新建一个Folder,我们这次以开始界面为例,因此F2重命名这个FolderStartUI,这个StartUI用来存储关于开始界面的所有资源。
<img style="max-height: 700px; max-width: 726px;" title="转载 [NGUI]NGUI图集Atlas制作简介" border="0" alt="转载 [NGUI]NGUI图集Atlas制作简介" src="http://game.ceeger.com/forum/attachment/Mon_1210/16_7487_8bcaf989c3a24c8.jpg?3" real_src="http://game.ceeger.com/forum/attachment/Mon_1210/16_7487_8bcaf989c3a24c8.jpg?3">
3,找到工程文件的根目录,把刚刚切好的png图片拷贝到StartUI文件夹里面(也可以在Unity里面用Import New Asset的方式导入,但是这种导入方式只能一张一张进行,比较慢),再打开Unity,鼠标选中StartUI文件夹,在Unity上方点击NGUI中的Atlas Maker选项(快捷键为Shift_Alt_M),出现如图所示窗口:
<img style="max-height: 700px; max-width: 726px;" title="转载 [NGUI]NGUI图集Atlas制作简介" border="0" alt="转载 [NGUI]NGUI图集Atlas制作简介" src="http://game.ceeger.com/forum/attachment/Mon_1210/16_7487_c1e9f8e9d4c0ad4.png?27" action-type="show-slide" action-data="http%3A%2F%2Fgame.ceeger.com%2Fforum%2Fattachment%2FMon_1210%2F16_7487_c1e9f8e9d4c0ad4.png%3F27" real_src="http://game.ceeger.com/forum/attachment/Mon_1210/16_7487_c1e9f8e9d4c0ad4.png?27">
给图集命名为StartUI-Atlas,如图:
<img style="max-height: 700px; max-width: 726px;" title="转载 [NGUI]NGUI图集Atlas制作简介" border="0" alt="转载 [NGUI]NGUI图集Atlas制作简介" src="http://game.ceeger.com/forum/attachment/Mon_1210/16_7487_9f485a82175c43f.jpg?5" action-type="show-slide" action-data="http%3A%2F%2Fgame.ceeger.com%2Fforum%2Fattachment%2FMon_1210%2F16_7487_9f485a82175c43f.jpg%3F5" real_src="http://game.ceeger.com/forum/attachment/Mon_1210/16_7487_9f485a82175c43f.jpg?5">
然后鼠标选中StatUI文件夹下的所有png图片(这个就不用说怎么做了吧,哈哈),会在窗口中显示选中的图片,点击Create按钮,那么这个图集开始界面的图集就制作好了······
4,制作图集会自动生成一张图集,一个prefab,一个material,点击这个prefab,在Inspector窗口会显示图集信息,刚刚有几个png图片,图集里面就会有几个sprite,在这里可以调节sprite的大小和位置,widthlength用来调节大小(宽度和长度),Border是用来制作Slice Sprite时才会用到的,除Slice Sprite外四个值都调为0.
Slice Sprite是一个可以拉伸的sprite,通过border中设置的值,它扩大的时候只会扩大中间的部分,边缘的不会有变化,因此对于有发光边缘的但内部无渐变无图片的背景,可以将发光部分设置为边缘,可以无限的扩大也没有任何视觉影响,这样极大的节省了资源。

5,在show里可以选择显示整张图集还是只显示一个sprite
<img style="max-height: 700px; max-width: 726px;" title="转载 [NGUI]NGUI图集Atlas制作简介" border="0" alt="转载 [NGUI]NGUI图集Atlas制作简介" src="http://game.ceeger.com/forum/attachment/Mon_1210/16_7487_568c43c99496c2c.jpg?4" action-type="show-slide" action-data="http%3A%2F%2Fgame.ceeger.com%2Fforum%2Fattachment%2FMon_1210%2F16_7487_568c43c99496c2c.jpg%3F4" real_src="http://game.ceeger.com/forum/attachment/Mon_1210/16_7487_568c43c99496c2c.jpg?4">
同时在这里也可以删除或者添加sprite,
<img style="max-height: 700px; max-width: 726px;" title="转载 [NGUI]NGUI图集Atlas制作简介" border="0" alt="转载 [NGUI]NGUI图集Atlas制作简介" src="http://game.ceeger.com/forum/attachment/Mon_1210/16_7487_9ee16b05d0486cb.jpg?8" action-type="show-slide" action-data="http%3A%2F%2Fgame.ceeger.com%2Fforum%2Fattachment%2FMon_1210%2F16_7487_9ee16b05d0486cb.jpg%3F8" real_src="http://game.ceeger.com/forum/attachment/Mon_1210/16_7487_9ee16b05d0486cb.jpg?8">
也可以给Sprite改名字,

<img style="max-height: 700px; max-width: 726px;" title="转载 [NGUI]NGUI图集Atlas制作简介" border="0" alt="转载 [NGUI]NGUI图集Atlas制作简介" src="http://game.ceeger.com/forum/attachment/Mon_1210/16_7487_6e84b17b75c4523.jpg?6" action-type="show-slide" action-data="http%3A%2F%2Fgame.ceeger.com%2Fforum%2Fattachment%2FMon_1210%2F16_7487_6e84b17b75c4523.jpg%3F6" real_src="http://game.ceeger.com/forum/attachment/Mon_1210/16_7487_6e84b17b75c4523.jpg?6">

原文链接 http://game.ceeger.com/forum/read.php?tid=4708&page=1
同时在这里也可以删除或者添加sprite,
<img style="max-height: 700px; max-width: 726px;" title="转载 [NGUI]NGUI图集Atlas制作简介" border="0" alt="转载 [NGUI]NGUI图集Atlas制作简介" src="http://game.ceeger.com/forum/attachment/Mon_1210/16_7487_9ee16b05d0486cb.jpg?8" action-type="show-slide" action-data="http%3A%2F%2Fgame.ceeger.com%2Fforum%2Fattachment%2FMon_1210%2F16_7487_9ee16b05d0486cb.jpg%3F8" real_src="http://game.ceeger.com/forum/attachment/Mon_1210/16_7487_9ee16b05d0486cb.jpg?8">
也可以给Sprite改名字,

<img style="max-height: 700px; max-width: 726px;" title="转载 [NGUI]NGUI图集Atlas制作简介" border="0" alt="转载 [NGUI]NGUI图集Atlas制作简介" src="http://game.ceeger.com/forum/attachment/Mon_1210/16_7487_6e84b17b75c4523.jpg?6" action-type="show-slide" action-data="http%3A%2F%2Fgame.ceeger.com%2Fforum%2Fattachment%2FMon_1210%2F16_7487_6e84b17b75c4523.jpg%3F6" real_src="http://game.ceeger.com/forum/attachment/Mon_1210/16_7487_6e84b17b75c4523.jpg?6">

原文链接 http://game.ceeger.com/forum/read.php?tid=4708&page=1

路过

雷人

握手

鲜花

鸡蛋

评论 (0 个评论)

facelist doodle 涂鸦板

您需要登录后才可以评论 登录 | 立即注册

小黑屋|手机版|Unity开发者联盟 ( 粤ICP备20003399号 )

GMT+8, 2024-5-3 17:49 , Processed in 0.089275 second(s), 15 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

返回顶部