SlideShare ist ein Scribd-Unternehmen logo
1 von 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

Weitere ähnliche Inhalte

Andere mochten auch

Andere mochten auch (14)

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...
 
SVILUPPARE PER MICROSOFT BAND
SVILUPPARE PER MICROSOFT BANDSVILUPPARE PER MICROSOFT BAND
SVILUPPARE PER MICROSOFT BAND
 
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#
 
CONTINUOUS INTEGRATION CON SQL SERVER
CONTINUOUS INTEGRATION CON SQL SERVERCONTINUOUS INTEGRATION CON SQL SERVER
CONTINUOUS INTEGRATION CON SQL SERVER
 
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
 
COSTRUISCI IL TUO DEVICE
COSTRUISCI IL TUO DEVICECOSTRUISCI IL TUO DEVICE
COSTRUISCI IL TUO DEVICE
 
70-483: PROGRAMMING IN C#
70-483: PROGRAMMING IN C#70-483: PROGRAMMING IN C#
70-483: PROGRAMMING IN C#
 
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
 
SHAREPOINT 2016 - WHAT'S NEW
SHAREPOINT 2016 - WHAT'S NEWSHAREPOINT 2016 - WHAT'S NEW
SHAREPOINT 2016 - WHAT'S NEW
 
SVILUPPARE E GESTIRE ARCHITETTURE A MICROSERVIZI SU AZURE
SVILUPPARE E GESTIRE ARCHITETTURE A MICROSERVIZI SU AZURESVILUPPARE E GESTIRE ARCHITETTURE A MICROSERVIZI SU AZURE
SVILUPPARE E GESTIRE ARCHITETTURE A MICROSERVIZI SU AZURE
 
Introduzione ai Microservices
Introduzione ai MicroservicesIntroduzione ai Microservices
Introduzione ai Microservices
 
MICROSOFT E IL MONDO IOT
MICROSOFT E IL MONDO IOTMICROSOFT E IL MONDO IOT
MICROSOFT E IL MONDO IOT
 
70-534: ARCHITECTING MICROSOFT AZURE SOLUTIONS
70-534: ARCHITECTING MICROSOFT AZURE SOLUTIONS70-534: ARCHITECTING MICROSOFT AZURE SOLUTIONS
70-534: ARCHITECTING MICROSOFT AZURE SOLUTIONS
 
ARCHITETTURA DI UN'APPLICAZIONE SCALABILE
ARCHITETTURA DI UN'APPLICAZIONE SCALABILEARCHITETTURA DI UN'APPLICAZIONE SCALABILE
ARCHITETTURA DI UN'APPLICAZIONE SCALABILE
 

Ähnlich wie INTERFACCE GRAFICHE CON UNITY3D 4.6: IL GIOCO NON BASTA!

3.4 events and interactivity
3.4   events and interactivity3.4   events and interactivity
3.4 events and interactivity
allenbailey
 
Game Project / Working with Unity
Game Project / Working with UnityGame Project / Working with Unity
Game Project / Working with Unity
Petri Lankoski
 
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
Germiya K Jose
 

Ähnlich wie INTERFACCE GRAFICHE CON UNITY3D 4.6: IL GIOCO NON BASTA! (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
 
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
 
Fast multi touch enabled web sites
Fast multi touch enabled web sitesFast multi touch enabled web sites
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 :
 

Mehr von DotNetCampus

AZURE WEBSITE DEEPDIVE
AZURE WEBSITE DEEPDIVEAZURE WEBSITE DEEPDIVE
AZURE WEBSITE DEEPDIVE
DotNetCampus
 
Windows iot barone
Windows iot baroneWindows iot barone
Windows iot barone
DotNetCampus
 

Mehr von DotNetCampus (17)

TUTTO SU VISUAL STUDIO ALM 2015
TUTTO SU VISUAL STUDIO ALM 2015TUTTO SU VISUAL STUDIO ALM 2015
TUTTO SU VISUAL STUDIO ALM 2015
 
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
 
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
 
SFRUTTARE CORTANA E LE SPEECH API NELLE NOSTRE APP
SFRUTTARE CORTANA E LE SPEECH API NELLE NOSTRE APPSFRUTTARE CORTANA E LE SPEECH API NELLE NOSTRE APP
SFRUTTARE CORTANA E LE SPEECH API NELLE NOSTRE APP
 
APPSTUDIO: DA ZERO ALLO STORE IN 50 MINUTI!
APPSTUDIO: DA ZERO ALLO STORE IN 50 MINUTI!APPSTUDIO: DA ZERO ALLO STORE IN 50 MINUTI!
APPSTUDIO: DA ZERO ALLO STORE IN 50 MINUTI!
 
SIGNALR TO-THE-MAX: VERSO IL WEB ED OLTRE!
SIGNALR TO-THE-MAX: VERSO IL WEB ED OLTRE!SIGNALR TO-THE-MAX: VERSO IL WEB ED OLTRE!
SIGNALR TO-THE-MAX: VERSO IL WEB ED OLTRE!
 
AZURE WEBSITE DEEPDIVE
AZURE WEBSITE DEEPDIVEAZURE WEBSITE DEEPDIVE
AZURE WEBSITE DEEPDIVE
 
INTERNET OF THINGS & AZURE
INTERNET OF THINGS & AZUREINTERNET OF THINGS & AZURE
INTERNET OF THINGS & AZURE
 
JAVASCRIPT TASK AUTOMATION
JAVASCRIPT TASK AUTOMATIONJAVASCRIPT TASK AUTOMATION
JAVASCRIPT TASK AUTOMATION
 
TYPESCRIPT, ANGULAR E BOOTSTRAP ASSIEME PER APPLICAZIONI REAL WORLD
TYPESCRIPT, ANGULAR E BOOTSTRAP ASSIEME PER APPLICAZIONI REAL WORLDTYPESCRIPT, ANGULAR E BOOTSTRAP ASSIEME PER APPLICAZIONI REAL WORLD
TYPESCRIPT, ANGULAR E BOOTSTRAP ASSIEME PER APPLICAZIONI REAL WORLD
 
Programmazione asincrona in java script
Programmazione asincrona in java scriptProgrammazione asincrona in java script
Programmazione asincrona in java script
 
Windows iot barone
Windows iot baroneWindows iot barone
Windows iot barone
 
Unity3 d uitools
Unity3 d uitoolsUnity3 d uitools
Unity3 d uitools
 

Kürzlich hochgeladen

Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.
MateoGardella
 
Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch Letter
MateoGardella
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
negromaestrong
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 

Kürzlich hochgeladen (20)

Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
 
Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch Letter
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 

INTERFACCE GRAFICHE CON UNITY3D 4.6: IL GIOCO NON BASTA!

  • 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