SlideShare a Scribd company logo
Template designed by
UNITY3D 4.6 UI TOOLS
Alessandro Pozone
Alessandro.pozone@hotmail.com
www.poz1.com
@TPoz1
Alessandro Pozone
Ingegneria Informatica @ PoliMi
Worldwide Finals finalist ImagineCup 2014
Microsoft Student Partner
Xamarin Student Ambassador
chi sono
Before UGUI
Canvas
Rect Transform & Anchors
Pivot
Slice Scaling & Animation
UIManager
Demo
agenda
public class ExampleClass : MonoBehaviour {
public Texture btnTexture;
void OnGUI() {
if (!btnTexture) {
Debug.LogError("Please assign a texture on the inspector");
return;
}
if (GUI.Button(new Rect(10, 10, 50, 50), btnTexture))
Debug.Log("Clicked the button with an image");
if (GUI.Button(new Rect(10, 70, 50, 30), "Click"))
Debug.Log("Clicked the button with text");
}
}
OnGui vs UGUI
The Canvas is a Game Object with a Canvas component on it,
and all UI elements must be children of a Canvas.
UI elements in the Canvas are drawn in the same order they
appear in the Hierarchy.
Canvas
When dealing with UI
Controls we don’t have
the Transforms panel
but the Rect Transform.
It will change the way it
looks depending on the
anchors settings.
Rect Transform & Anchors
Setting Anchors is a simple way to control
the position and size of your UI elements,
relative to their parent.
When the parent is resized, your UI element
will try to maintain uniform distance to the
anchor points, thus forcing it to move or
resize right along with its parent.
Rect Transform & Anchors
The Pivot is a point
around which all
transformations are made.
The Pivot is set in
normalized coordinates.
This means that it goes
from 0 to 1 for both
height and width.
Where (0,0) is the bottom
left corner and (1,1) is the
top right corner.
Pivot
Unlike images that rarely scale,
especially non-uniformly, buttons
often come in completely
different sizes.
To avoid dealing with several
sizes of the same image you can
use a technique called 9-Slice
scaling, which allows you to
provide one small image that
scales to fit all the sizes.
This technique makes this
possible because the image does
not scale evenly. There are nine
zones, each of which scale
differently.
Slice Scaling
When you add an event handler to
the button, you need to specify which
method to call when you tap the
button. This means you need to
attach an object to a script, since you
can’t use static methods.
UIManager
public void StartGame()
{
Application.LoadLevel("RocketMouse");
}
Animating buttons is no different from animating any other
Unity object. You’ll need to add an Animator component, create
few animations and set up states and transitions between them.
Animation
We can manage animator conditions using the UIManager
Animation
public Animator settingsButton;
public void OpenSettings()
{
settingsButton.SetBool("isHidden”,true);
}
demo
Unity3D :]
Grazie a tutti per la partecipazione
Riceverete il link per il download a slide e demo via email nei
prossimi giorni
Per contattarmi
Alessandro.pozone@hotmail.com
Grazie

More Related Content

Viewers also liked (18)

PDF
Ag03 agile culture - dnc14 handouts
DotNetCampus
 
PPTX
Mob03 what's new in windows phone
DotNetCampus
 
PPTX
Sys02 best way to create a share point app
DotNetCampus
 
PDF
Ds04 data quality
DotNetCampus
 
PPTX
Fr01 asp.net web api reloaded
DotNetCampus
 
PPTX
Win05 accesso ai dati in win 8
DotNetCampus
 
PDF
Cert05 70-487 - developing microsoft azure and web services
DotNetCampus
 
PPTX
Mob04 best practices for windows phone ui design
DotNetCampus
 
PPTX
Sys01 creare applicazioni virtuali con microsoft application virtualization...
DotNetCampus
 
PDF
Be01 web devclientvsserver
DotNetCampus
 
PDF
Mob02 windows phone 8.1 app development
DotNetCampus
 
PPTX
Fe02 ria con breeze e knockout
DotNetCampus
 
PPTX
Cert02 70-410
DotNetCampus
 
PDF
Ag01 agile foundation - dnc14 handouts
DotNetCampus
 
PDF
Ds05 power bi
DotNetCampus
 
PPTX
Sys04 share point-yammer_social_collaboration
DotNetCampus
 
PPTX
Fe04 angular js-101
DotNetCampus
 
PPTX
Gam03 facciamo volare il nosro drone
DotNetCampus
 
Ag03 agile culture - dnc14 handouts
DotNetCampus
 
Mob03 what's new in windows phone
DotNetCampus
 
Sys02 best way to create a share point app
DotNetCampus
 
Ds04 data quality
DotNetCampus
 
Fr01 asp.net web api reloaded
DotNetCampus
 
Win05 accesso ai dati in win 8
DotNetCampus
 
Cert05 70-487 - developing microsoft azure and web services
DotNetCampus
 
Mob04 best practices for windows phone ui design
DotNetCampus
 
Sys01 creare applicazioni virtuali con microsoft application virtualization...
DotNetCampus
 
Be01 web devclientvsserver
DotNetCampus
 
Mob02 windows phone 8.1 app development
DotNetCampus
 
Fe02 ria con breeze e knockout
DotNetCampus
 
Cert02 70-410
DotNetCampus
 
Ag01 agile foundation - dnc14 handouts
DotNetCampus
 
Ds05 power bi
DotNetCampus
 
Sys04 share point-yammer_social_collaboration
DotNetCampus
 
Fe04 angular js-101
DotNetCampus
 
Gam03 facciamo volare il nosro drone
DotNetCampus
 

Similar to Unity3 d uitools (20)

PPTX
Unity workshop
fsxflyer789Productio
 
PPTX
Workingwithunity 110519054824-phpapp01
Srijib Roy
 
PDF
Game UI Development_1
Felipe Ramos
 
PPTX
Creating great Unity games for Windows 10 - Part 1
Jiri Danihelka
 
PPTX
Cross platform game development
Jerel Hass
 
PPTX
unity basics
Reham Maher El-Safarini
 
PDF
【Unite 2017 Tokyo】Unity UI最適化ガイド 〜ベストプラクティスと新機能
Unity Technologies Japan K.K.
 
PDF
Intro to unity for as3
mrondina
 
PDF
Presentación Unity
Laura Milena Parra Navarro
 
PPTX
Unity Game Engine - Basics
FirosK2
 
PDF
Mobile AR Lecture6 - Introduction to Unity 3D
Mark Billinghurst
 
PDF
Introduction to Game Programming: Using C# and Unity 3D - Chapter 2 (Preview)
noorcon
 
PPTX
Unity programming 1
Petri Lankoski
 
PPTX
Game Project / Working with Unity
Petri Lankoski
 
PPTX
02 unity 3_d_part_1
Reham Maher El-Safarini
 
PPTX
Introduction to Unity
University of Auckland
 
PPTX
Unity - Internals: memory and performance
Codemotion
 
PDF
course1-Intrduction-to-the-game-industry.pdf
BoubakerMedanas
 
PPTX
Game development -session on unity 3d
Muhammad Maaz Irfan
 
PDF
Unity UI and Compatibility Testing Content.pdf
vijaykrishanmoorthy
 
Unity workshop
fsxflyer789Productio
 
Workingwithunity 110519054824-phpapp01
Srijib Roy
 
Game UI Development_1
Felipe Ramos
 
Creating great Unity games for Windows 10 - Part 1
Jiri Danihelka
 
Cross platform game development
Jerel Hass
 
【Unite 2017 Tokyo】Unity UI最適化ガイド 〜ベストプラクティスと新機能
Unity Technologies Japan K.K.
 
Intro to unity for as3
mrondina
 
Presentación Unity
Laura Milena Parra Navarro
 
Unity Game Engine - Basics
FirosK2
 
Mobile AR Lecture6 - Introduction to Unity 3D
Mark Billinghurst
 
Introduction to Game Programming: Using C# and Unity 3D - Chapter 2 (Preview)
noorcon
 
Unity programming 1
Petri Lankoski
 
Game Project / Working with Unity
Petri Lankoski
 
02 unity 3_d_part_1
Reham Maher El-Safarini
 
Introduction to Unity
University of Auckland
 
Unity - Internals: memory and performance
Codemotion
 
course1-Intrduction-to-the-game-industry.pdf
BoubakerMedanas
 
Game development -session on unity 3d
Muhammad Maaz Irfan
 
Unity UI and Compatibility Testing Content.pdf
vijaykrishanmoorthy
 
Ad

More from DotNetCampus (20)

PDF
ARCHITETTURA DI UN'APPLICAZIONE SCALABILE
DotNetCampus
 
PPTX
MICROSOFT E IL MONDO IOT
DotNetCampus
 
PPTX
70-485: ADVANCED OF DEVELOPING WINDOWS STORE APPS USING C#
DotNetCampus
 
PDF
70-534: ARCHITECTING MICROSOFT AZURE SOLUTIONS
DotNetCampus
 
PDF
70-483: PROGRAMMING IN C#
DotNetCampus
 
PPTX
DSTORIE DALLA TRINCEA: TEAM FOUNDATION SERVER IN CASI LIMITE E NON SOLO...
DotNetCampus
 
PPTX
TUTTO SU VISUAL STUDIO ALM 2015
DotNetCampus
 
PPTX
CONTINUOUS INTEGRATION CON SQL SERVER
DotNetCampus
 
PPTX
PREDICT THE FUTURE , MACHINE LEARNING & BIG DATA
DotNetCampus
 
PPTX
DESKTOP AND CLIENT VIRTUALIZATION: NEW WORKSTYLES WITH MICROSOFT VDI
DotNetCampus
 
PPTX
FROM ON-PREMISE TO THE HYBRID CLOUD WITH MICROSOFT AZURE
DotNetCampus
 
PPTX
SHAREPOINT 2016 - WHAT'S NEW
DotNetCampus
 
PPTX
COSTRUISCI IL TUO DEVICE
DotNetCampus
 
PPTX
SVILUPPARE PER MICROSOFT BAND
DotNetCampus
 
PPTX
INTERFACCE GRAFICHE CON UNITY3D 4.6: IL GIOCO NON BASTA!
DotNetCampus
 
PPTX
WINDOWS PHONE APPS IN C++
DotNetCampus
 
PPTX
AZURE NOTIFICATION HUB
DotNetCampus
 
PPTX
SFRUTTARE I MICROSOFT AZURE MOBILE SERVICES CON XAMARIN.FORMS
DotNetCampus
 
PPTX
INTRO TO XAMARIN
DotNetCampus
 
PPTX
UNIVERSAL APP IN TUTTE LE SALSE: PHONE, TABLET, PC, XBOX E IOT
DotNetCampus
 
ARCHITETTURA DI UN'APPLICAZIONE SCALABILE
DotNetCampus
 
MICROSOFT E IL MONDO IOT
DotNetCampus
 
70-485: ADVANCED OF DEVELOPING WINDOWS STORE APPS USING C#
DotNetCampus
 
70-534: ARCHITECTING MICROSOFT AZURE SOLUTIONS
DotNetCampus
 
70-483: PROGRAMMING IN C#
DotNetCampus
 
DSTORIE DALLA TRINCEA: TEAM FOUNDATION SERVER IN CASI LIMITE E NON SOLO...
DotNetCampus
 
TUTTO SU VISUAL STUDIO ALM 2015
DotNetCampus
 
CONTINUOUS INTEGRATION CON SQL SERVER
DotNetCampus
 
PREDICT THE FUTURE , MACHINE LEARNING & BIG DATA
DotNetCampus
 
DESKTOP AND CLIENT VIRTUALIZATION: NEW WORKSTYLES WITH MICROSOFT VDI
DotNetCampus
 
FROM ON-PREMISE TO THE HYBRID CLOUD WITH MICROSOFT AZURE
DotNetCampus
 
SHAREPOINT 2016 - WHAT'S NEW
DotNetCampus
 
COSTRUISCI IL TUO DEVICE
DotNetCampus
 
SVILUPPARE PER MICROSOFT BAND
DotNetCampus
 
INTERFACCE GRAFICHE CON UNITY3D 4.6: IL GIOCO NON BASTA!
DotNetCampus
 
WINDOWS PHONE APPS IN C++
DotNetCampus
 
AZURE NOTIFICATION HUB
DotNetCampus
 
SFRUTTARE I MICROSOFT AZURE MOBILE SERVICES CON XAMARIN.FORMS
DotNetCampus
 
INTRO TO XAMARIN
DotNetCampus
 
UNIVERSAL APP IN TUTTE LE SALSE: PHONE, TABLET, PC, XBOX E IOT
DotNetCampus
 
Ad

Unity3 d uitools

  • 1. Template designed by UNITY3D 4.6 UI TOOLS Alessandro Pozone [email protected] www.poz1.com @TPoz1
  • 2. Alessandro Pozone Ingegneria Informatica @ PoliMi Worldwide Finals finalist ImagineCup 2014 Microsoft Student Partner Xamarin Student Ambassador chi sono
  • 3. Before UGUI Canvas Rect Transform & Anchors Pivot Slice Scaling & Animation UIManager Demo agenda
  • 4. public class ExampleClass : MonoBehaviour { public Texture btnTexture; void OnGUI() { if (!btnTexture) { Debug.LogError("Please assign a texture on the inspector"); return; } if (GUI.Button(new Rect(10, 10, 50, 50), btnTexture)) Debug.Log("Clicked the button with an image"); if (GUI.Button(new Rect(10, 70, 50, 30), "Click")) Debug.Log("Clicked the button with text"); } } OnGui vs UGUI
  • 5. The Canvas is a Game Object with a Canvas component on it, and all UI elements must be children of a Canvas. UI elements in the Canvas are drawn in the same order they appear in the Hierarchy. Canvas
  • 6. When dealing with UI Controls we don’t have the Transforms panel but the Rect Transform. It will change the way it looks depending on the anchors settings. Rect Transform & Anchors
  • 7. Setting Anchors is a simple way to control the position and size of your UI elements, relative to their parent. When the parent is resized, your UI element will try to maintain uniform distance to the anchor points, thus forcing it to move or resize right along with its parent. Rect Transform & Anchors
  • 8. The Pivot is a point around which all transformations are made. The Pivot is set in normalized coordinates. This means that it goes from 0 to 1 for both height and width. Where (0,0) is the bottom left corner and (1,1) is the top right corner. Pivot
  • 9. Unlike images that rarely scale, especially non-uniformly, buttons often come in completely different sizes. To avoid dealing with several sizes of the same image you can use a technique called 9-Slice scaling, which allows you to provide one small image that scales to fit all the sizes. This technique makes this possible because the image does not scale evenly. There are nine zones, each of which scale differently. Slice Scaling
  • 10. When you add an event handler to the button, you need to specify which method to call when you tap the button. This means you need to attach an object to a script, since you can’t use static methods. UIManager public void StartGame() { Application.LoadLevel("RocketMouse"); }
  • 11. Animating buttons is no different from animating any other Unity object. You’ll need to add an Animator component, create few animations and set up states and transitions between them. Animation
  • 12. We can manage animator conditions using the UIManager Animation public Animator settingsButton; public void OpenSettings() { settingsButton.SetBool("isHidden”,true); }
  • 14. Grazie a tutti per la partecipazione Riceverete il link per il download a slide e demo via email nei prossimi giorni Per contattarmi [email protected] Grazie