一、 Create a Button

   一、(Menu)NGUI -> Create -> Sprite

  

二、attach box colider to the Sprite , then attach UIButton Script

三、Create - >Lable as Sprite's Child, Set it's Ahchors to it's Parent

(注意:不要给Lable添加box colider 这样Sprite按钮就接受不到事件了,因为Lable 的Depth 大于 Sprite)

四、Sprite attach UIButton Script Again ,set target as Lable

五、Hover the button ,you will seen Sprite and Lable all highlight.

二、Event Trigger -> Use Button Change

一、create a spirte ,which will be changed by button

  二、attach Tween Height and Tween Width ,set valuse like that

  (注意,set two scripts active  false ,这样就不会一开始就变换形状了)

三、attach UIEvent Trigger to button,set event to change sprite,like that

  四、now  show the result

Hover:  Change Size

   

Leave : Noraml Size

三、UIKeyBinding 

  绑定一个快捷键去激活一个按钮,输入框或选择一个对象。

  一、Attach UIKeyBinding Script to button

  

  二、Attach Test Scrpit to Sprite

  

  三、Set OnClick Event Notify Object reference to Sprite

四、Now , you can enter 1,2,3 to change sprite color.

OfSourse you can alse 使用键盘来控制 UIInput

liket that

  

  

  你也可以使用UIKeyNavigation ——附加这个脚步到你的控制上去允许使用键盘或控制器来定位UI(3.5.5新增)

NGUI Tutorial 3的更多相关文章

  1. NGUI Tutorial 4 ScrollView

    一.createScrollView 1.First, select the panel you want to be your scroll view and right-click anywher ...

  2. NGUI 学习笔记实战——制作商城UI界面

    http://www.cnblogs.com/chongxin/p/3876575.html Unity3D的uGUI听说最近4.6即将推出,但是目前NGUI等UI插件大行其道并且已经非常成熟,所以我 ...

  3. NGUI 的使用教程与实例(入门)(1 )

    NGUI教程:步骤1-Scene 1.创建一个新的场景(New Scene).2.选择并删除场景里的MainCamera.3.在NGUI菜单下选择Create a New UI,会打开UI创建向导. ...

  4. Unity3d ngui基础教程

    Unity3d ngui基础教程 NGUI教程:步骤1-Scene 1.创建一个新的场景(New Scene).2.选择并删除场景里的MainCamera.3.在NGUI菜单下选择Create a N ...

  5. NGUI: Documentation

    Video Tutorials Basic Tutorial (v.2.5.0+) SD & HD atlas switching (advanced) Packed Font (advanc ...

  6. NGUI学习笔记(一)UILabel介绍

    来个前言: 作为一个U3D程序员,自然要写一写U3D相关的内容了.想来想去还是从UI开始搞起,可能这也是最直观同时也最重要的部分之一了.U3D自带的UI系统,也许略坑,也没有太多介绍的价值,那么从今天 ...

  7. [翻译+山寨]Hangfire Highlighter Tutorial

    前言 Hangfire是一个开源且商业免费使用的工具函数库.可以让你非常容易地在ASP.NET应用(也可以不在ASP.NET应用)中执行多种类型的后台任务,而无需自行定制开发和管理基于Windows ...

  8. NGUI裁剪模型和粒子

    效果预览 注:Cube上附着的绿色是我添加的粒子效果. 软件环境 NGUI 3.9.x Unity 5.1 x64 相关知识 RenderTexture RenderTexture是一种特殊的纹理,它 ...

  9. Django 1.7 Tutorial 学习笔记

    官方教程在这里 : Here 写在前面的废话:)) 以前学习新东西,第一想到的是找本入门教程,按照书上做一遍.现在看了各种网上的入门教程后,我觉得还是看官方Tutorial靠谱.书的弊端一说一大推 本 ...

随机推荐

  1. 三款精美的html5及css3的源码插件

    1.HTML5 3D爱心动画 晚来的七夕礼物 七夕情人节刚过,今天小编却在国外的网站上看到一个利用HTML5和CSS3制作的3D爱心动画,莫非老外也过七夕?当然小编还是将这款HTML5 3D爱心动画收 ...

  2. 分享7款顶级的CSS3动画特效

    1.CSS3 SVG文字背景动画 超酷的文字特效 今天我们来分享一款基于CSS3和SVG的文字特效,文字的背景可以定义一些动画特效,在背景动画播放的同时,我们还可以选中文字.本示例让文字背景展示水波和 ...

  3. 【leetcode】367. Valid Perfect Square

    题目描述: Given a positive integer num, write a function which returns True if num is a perfect square e ...

  4. Connected_Component Labelling(联通区域标记算法) C++实现

    // Connected-Component Labelling.cpp : 定义控制台应用程序的入口点.//如有是使用,请务必注明引用出处网站:http://www.cnblogs.com/Amat ...

  5. Flex xxx-app.xml配置

    <?xml version="1.0" encoding="UTF-8"?>  <application xmlns="http:/ ...

  6. 1101. Quick Sort (25)

    There is a classical process named partition in the famous quick sort algorithm. In this process we ...

  7. XenServer安装虚拟机---先扩容存放ISO镜像文件

    我们都知道xenserver安装后,不管你的盘有多大,只有4G的空间. 故操作是:新建LV卷,可自定义大小 1.vgdisplay #先查看剩余空间 [root@XenServer /]# vgdis ...

  8. linux内核中的get_user和put_user

    linux内核中的get_user和put_user 在 内核空间和用户空间交换数据时,get_user和put_user是两个两用的函数.相对于copy_to_user和 copy_from_use ...

  9. Linq to XML 之XElement的Descendants方法的新发现

    C#操作XML的方法有很多,但个人认为最方便的莫过于Linq to XML了,特别是XElement的Descendants方法是我最常用的一个方法. 这个方法可以根据节点名(Name)找到当前调用的 ...

  10. C# Windows - 菜单栏和工具栏

    除了MenuStrip控件之外,还有许多控件可用于填充菜单.3个常见的控件是ToolStripMenuItem,ToolStripDropDown,和ToolStripSeparator.这些控件表示 ...