SlideShare a Scribd company logo
1 of 14
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

Ag03 agile culture - dnc14 handouts
Ag03   agile culture - dnc14 handoutsAg03   agile culture - dnc14 handouts
Ag03 agile culture - dnc14 handoutsDotNetCampus
 
Mob03 what's new in windows phone
Mob03   what's new in windows phoneMob03   what's new in windows phone
Mob03 what's new in windows phoneDotNetCampus
 
Sys02 best way to create a share point app
Sys02   best way to create a share point appSys02   best way to create a share point app
Sys02 best way to create a share point appDotNetCampus
 
Fr01 asp.net web api reloaded
Fr01   asp.net web api reloadedFr01   asp.net web api reloaded
Fr01 asp.net web api reloadedDotNetCampus
 
Win05 accesso ai dati in win 8
Win05   accesso ai dati in win 8Win05   accesso ai dati in win 8
Win05 accesso ai dati in win 8DotNetCampus
 
Cert05 70-487 - developing microsoft azure and web services
Cert05   70-487 - developing microsoft azure and web servicesCert05   70-487 - developing microsoft azure and web services
Cert05 70-487 - developing microsoft azure and web servicesDotNetCampus
 
Mob04 best practices for windows phone ui design
Mob04   best practices for windows phone ui designMob04   best practices for windows phone ui design
Mob04 best practices for windows phone ui designDotNetCampus
 
Sys01 creare applicazioni virtuali con microsoft application virtualization...
Sys01   creare applicazioni virtuali con microsoft application virtualization...Sys01   creare applicazioni virtuali con microsoft application virtualization...
Sys01 creare applicazioni virtuali con microsoft application virtualization...DotNetCampus
 
Be01 web devclientvsserver
Be01   web devclientvsserverBe01   web devclientvsserver
Be01 web devclientvsserverDotNetCampus
 
Mob02 windows phone 8.1 app development
Mob02   windows phone 8.1 app development Mob02   windows phone 8.1 app development
Mob02 windows phone 8.1 app development DotNetCampus
 
Fe02 ria con breeze e knockout
Fe02   ria con breeze e knockoutFe02   ria con breeze e knockout
Fe02 ria con breeze e knockoutDotNetCampus
 
Ag01 agile foundation - dnc14 handouts
Ag01   agile foundation - dnc14 handoutsAg01   agile foundation - dnc14 handouts
Ag01 agile foundation - dnc14 handoutsDotNetCampus
 
Sys04 share point-yammer_social_collaboration
Sys04   share point-yammer_social_collaborationSys04   share point-yammer_social_collaboration
Sys04 share point-yammer_social_collaborationDotNetCampus
 
Fe04 angular js-101
Fe04   angular js-101Fe04   angular js-101
Fe04 angular js-101DotNetCampus
 
Gam03 facciamo volare il nosro drone
Gam03   facciamo volare il nosro droneGam03   facciamo volare il nosro drone
Gam03 facciamo volare il nosro droneDotNetCampus
 

Viewers also liked (18)

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

Similar to Unity3 d uitools

Procedure of animation in 3 d autodesk maya tools & techniques
Procedure of animation in 3 d autodesk maya tools & techniquesProcedure of animation in 3 d autodesk maya tools & techniques
Procedure of animation in 3 d autodesk maya tools & techniquesijcga
 
3.4 events and interactivity
3.4   events and interactivity3.4   events and interactivity
3.4 events and interactivityallenbailey
 
A Novel approach for Graphical User Interface development and real time Objec...
A Novel approach for Graphical User Interface development and real time Objec...A Novel approach for Graphical User Interface development and real time Objec...
A Novel approach for Graphical User Interface development and real time Objec...IOSR Journals
 
Flash auto play image gallery
Flash auto play image galleryFlash auto play image gallery
Flash auto play image galleryBoy Jeorge
 
Ui in unity
Ui in unityUi in unity
Ui in unityNoam Gat
 
Keyboard and mouse events in python
Keyboard and mouse events in pythonKeyboard and mouse events in python
Keyboard and mouse events in pythonmal6ayer
 
Introduction to Game Programming: Using C# and Unity 3D - Chapter 2 (Preview)
Introduction to Game Programming: Using C# and Unity 3D - Chapter 2 (Preview)Introduction to Game Programming: Using C# and Unity 3D - Chapter 2 (Preview)
Introduction to Game Programming: Using C# and Unity 3D - Chapter 2 (Preview)noorcon
 
High speed script execution for GUI automation using computer vision
High speed script execution for GUI automation using computer visionHigh speed script execution for GUI automation using computer vision
High speed script execution for GUI automation using computer visionIJECEIAES
 
Introduction to GUIs with guizero
Introduction to GUIs with guizeroIntroduction to GUIs with guizero
Introduction to GUIs with guizeroprimeteacher32
 
Game Project / Working with Unity
Game Project / Working with UnityGame Project / Working with Unity
Game Project / Working with UnityPetri Lankoski
 
unity gaming programing basics for students ppt
unity gaming programing basics for students pptunity gaming programing basics for students ppt
unity gaming programing basics for students pptKathiriyaParthiv
 
Exploring the internal state of user interfaces using sikuli
Exploring the internal state of user interfaces using sikuliExploring the internal state of user interfaces using sikuli
Exploring the internal state of user interfaces using sikuliGermiya K Jose
 
Fast multi touch enabled web sites
Fast multi touch enabled web sitesFast multi touch enabled web sites
Fast multi touch enabled web sitesAspenware
 
Tips for building fast multi touch enabled web sites
 Tips for building fast multi touch enabled web sites Tips for building fast multi touch enabled web sites
Tips for building fast multi touch enabled web sitesAspenware
 
U Pointer Detailed Training Manual
U Pointer Detailed Training ManualU Pointer Detailed Training Manual
U Pointer Detailed Training ManualUPointer
 
M5 - Graphic Animation - Buttons
M5 - Graphic Animation - ButtonsM5 - Graphic Animation - Buttons
M5 - Graphic Animation - ButtonsJamie Hutt
 
Gui in matlab :
Gui in matlab :Gui in matlab :
Gui in matlab :elboob2025
 

Similar to Unity3 d uitools (20)

Procedure of animation in 3 d autodesk maya tools & techniques
Procedure of animation in 3 d autodesk maya tools & techniquesProcedure of animation in 3 d autodesk maya tools & techniques
Procedure of animation in 3 d autodesk maya tools & techniques
 
Unity tutorial
Unity tutorialUnity tutorial
Unity tutorial
 
3.4 events and interactivity
3.4   events and interactivity3.4   events and interactivity
3.4 events and interactivity
 
A Novel approach for Graphical User Interface development and real time Objec...
A Novel approach for Graphical User Interface development and real time Objec...A Novel approach for Graphical User Interface development and real time Objec...
A Novel approach for Graphical User Interface development and real time Objec...
 
Flash auto play image gallery
Flash auto play image galleryFlash auto play image gallery
Flash auto play image gallery
 
Ui in unity
Ui in unityUi in unity
Ui in unity
 
Keyboard and mouse events in python
Keyboard and mouse events in pythonKeyboard and mouse events in python
Keyboard and mouse events in python
 
Introduction to Game Programming: Using C# and Unity 3D - Chapter 2 (Preview)
Introduction to Game Programming: Using C# and Unity 3D - Chapter 2 (Preview)Introduction to Game Programming: Using C# and Unity 3D - Chapter 2 (Preview)
Introduction to Game Programming: Using C# and Unity 3D - Chapter 2 (Preview)
 
High speed script execution for GUI automation using computer vision
High speed script execution for GUI automation using computer visionHigh speed script execution for GUI automation using computer vision
High speed script execution for GUI automation using computer vision
 
Introduction to GUIs with guizero
Introduction to GUIs with guizeroIntroduction to GUIs with guizero
Introduction to GUIs with guizero
 
Game Project / Working with Unity
Game Project / Working with UnityGame Project / Working with Unity
Game Project / Working with Unity
 
unity gaming programing basics for students ppt
unity gaming programing basics for students pptunity gaming programing basics for students ppt
unity gaming programing basics for students ppt
 
Lab 6
Lab 6Lab 6
Lab 6
 
Exploring the internal state of user interfaces using sikuli
Exploring the internal state of user interfaces using sikuliExploring the internal state of user interfaces using sikuli
Exploring the internal state of user interfaces using sikuli
 
Presentación Unity
Presentación UnityPresentación Unity
Presentación Unity
 
Fast multi touch enabled web sites
Fast multi touch enabled web sitesFast multi touch enabled web sites
Fast multi touch enabled web sites
 
Tips for building fast multi touch enabled web sites
 Tips for building fast multi touch enabled web sites Tips for building fast multi touch enabled web sites
Tips for building fast multi touch enabled web sites
 
U Pointer Detailed Training Manual
U Pointer Detailed Training ManualU Pointer Detailed Training Manual
U Pointer Detailed Training Manual
 
M5 - Graphic Animation - Buttons
M5 - Graphic Animation - ButtonsM5 - Graphic Animation - Buttons
M5 - Graphic Animation - Buttons
 
Gui in matlab :
Gui in matlab :Gui in matlab :
Gui in matlab :
 

More from DotNetCampus

ARCHITETTURA DI UN'APPLICAZIONE SCALABILE
ARCHITETTURA DI UN'APPLICAZIONE SCALABILEARCHITETTURA DI UN'APPLICAZIONE SCALABILE
ARCHITETTURA DI UN'APPLICAZIONE SCALABILEDotNetCampus
 
MICROSOFT E IL MONDO IOT
MICROSOFT E IL MONDO IOTMICROSOFT E IL MONDO IOT
MICROSOFT E IL MONDO IOTDotNetCampus
 
70-485: ADVANCED OF DEVELOPING WINDOWS STORE APPS USING C#
70-485: ADVANCED OF DEVELOPING WINDOWS STORE APPS USING C#70-485: ADVANCED OF DEVELOPING WINDOWS STORE APPS USING C#
70-485: ADVANCED OF DEVELOPING WINDOWS STORE APPS USING C#DotNetCampus
 
70-534: ARCHITECTING MICROSOFT AZURE SOLUTIONS
70-534: ARCHITECTING MICROSOFT AZURE SOLUTIONS70-534: ARCHITECTING MICROSOFT AZURE SOLUTIONS
70-534: ARCHITECTING MICROSOFT AZURE SOLUTIONSDotNetCampus
 
70-483: PROGRAMMING IN C#
70-483: PROGRAMMING IN C#70-483: PROGRAMMING IN C#
70-483: PROGRAMMING IN C#DotNetCampus
 
DSTORIE DALLA TRINCEA: TEAM FOUNDATION SERVER IN CASI LIMITE E NON SOLO...
DSTORIE DALLA TRINCEA: TEAM FOUNDATION SERVER IN CASI LIMITE E NON SOLO...DSTORIE DALLA TRINCEA: TEAM FOUNDATION SERVER IN CASI LIMITE E NON SOLO...
DSTORIE DALLA TRINCEA: TEAM FOUNDATION SERVER IN CASI LIMITE E NON SOLO...DotNetCampus
 
TUTTO SU VISUAL STUDIO ALM 2015
TUTTO SU VISUAL STUDIO ALM 2015TUTTO SU VISUAL STUDIO ALM 2015
TUTTO SU VISUAL STUDIO ALM 2015DotNetCampus
 
CONTINUOUS INTEGRATION CON SQL SERVER
CONTINUOUS INTEGRATION CON SQL SERVERCONTINUOUS INTEGRATION CON SQL SERVER
CONTINUOUS INTEGRATION CON SQL SERVERDotNetCampus
 
PREDICT THE FUTURE , MACHINE LEARNING & BIG DATA
PREDICT THE FUTURE , MACHINE LEARNING & BIG DATAPREDICT THE FUTURE , MACHINE LEARNING & BIG DATA
PREDICT THE FUTURE , MACHINE LEARNING & BIG DATADotNetCampus
 
DESKTOP AND CLIENT VIRTUALIZATION: NEW WORKSTYLES WITH MICROSOFT VDI
DESKTOP AND CLIENT VIRTUALIZATION: NEW WORKSTYLES WITH MICROSOFT VDIDESKTOP AND CLIENT VIRTUALIZATION: NEW WORKSTYLES WITH MICROSOFT VDI
DESKTOP AND CLIENT VIRTUALIZATION: NEW WORKSTYLES WITH MICROSOFT VDIDotNetCampus
 
FROM ON-PREMISE TO THE HYBRID CLOUD WITH MICROSOFT AZURE
FROM ON-PREMISE TO THE HYBRID CLOUD WITH MICROSOFT AZUREFROM ON-PREMISE TO THE HYBRID CLOUD WITH MICROSOFT AZURE
FROM ON-PREMISE TO THE HYBRID CLOUD WITH MICROSOFT AZUREDotNetCampus
 
SHAREPOINT 2016 - WHAT'S NEW
SHAREPOINT 2016 - WHAT'S NEWSHAREPOINT 2016 - WHAT'S NEW
SHAREPOINT 2016 - WHAT'S NEWDotNetCampus
 
COSTRUISCI IL TUO DEVICE
COSTRUISCI IL TUO DEVICECOSTRUISCI IL TUO DEVICE
COSTRUISCI IL TUO DEVICEDotNetCampus
 
SVILUPPARE PER MICROSOFT BAND
SVILUPPARE PER MICROSOFT BANDSVILUPPARE PER MICROSOFT BAND
SVILUPPARE PER MICROSOFT BANDDotNetCampus
 
INTERFACCE GRAFICHE CON UNITY3D 4.6: IL GIOCO NON BASTA!
INTERFACCE GRAFICHE CON UNITY3D 4.6: IL GIOCO NON BASTA!INTERFACCE GRAFICHE CON UNITY3D 4.6: IL GIOCO NON BASTA!
INTERFACCE GRAFICHE CON UNITY3D 4.6: IL GIOCO NON BASTA!DotNetCampus
 
WINDOWS PHONE APPS IN C++
WINDOWS PHONE APPS IN C++WINDOWS PHONE APPS IN C++
WINDOWS PHONE APPS IN C++DotNetCampus
 
AZURE NOTIFICATION HUB
AZURE NOTIFICATION HUBAZURE NOTIFICATION HUB
AZURE NOTIFICATION HUBDotNetCampus
 
SFRUTTARE I MICROSOFT AZURE MOBILE SERVICES CON XAMARIN.FORMS
SFRUTTARE I MICROSOFT AZURE MOBILE SERVICES CON XAMARIN.FORMSSFRUTTARE I MICROSOFT AZURE MOBILE SERVICES CON XAMARIN.FORMS
SFRUTTARE I MICROSOFT AZURE MOBILE SERVICES CON XAMARIN.FORMSDotNetCampus
 
UNIVERSAL APP IN TUTTE LE SALSE: PHONE, TABLET, PC, XBOX E IOT
UNIVERSAL APP IN TUTTE LE SALSE: PHONE, TABLET, PC, XBOX E IOTUNIVERSAL APP IN TUTTE LE SALSE: PHONE, TABLET, PC, XBOX E IOT
UNIVERSAL APP IN TUTTE LE SALSE: PHONE, TABLET, PC, XBOX E IOTDotNetCampus
 

More from DotNetCampus (20)

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

Unity3 d uitools

  • 1. Template designed by UNITY3D 4.6 UI TOOLS Alessandro Pozone Alessandro.pozone@hotmail.com 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 Alessandro.pozone@hotmail.com Grazie