From 51953e0e301cab18471b2c1d887a984d019d9a28 Mon Sep 17 00:00:00 2001 From: Mateus Pires Date: Mon, 5 Oct 2015 18:05:53 -0300 Subject: [PATCH] Aplicacao de responsividade do texto das telas do tutorial --- Assets/Scenes/Main.unity | 86 +++++++++++++++++++++++++++++++++++++++++++------------------------------------------- Assets/Scripts/UIManagers/UIManagerTutorial.cs | 11 +++++++++-- 2 files changed, 52 insertions(+), 45 deletions(-) diff --git a/Assets/Scenes/Main.unity b/Assets/Scenes/Main.unity index 100f7f4..896a686 100644 --- a/Assets/Scenes/Main.unity +++ b/Assets/Scenes/Main.unity @@ -250,7 +250,7 @@ RectTransform: m_Father: {fileID: 28912434} m_RootOrder: 0 m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: .5, y: 1} + m_AnchorMax: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 10, y: 0} m_Pivot: {x: .5, y: .5} @@ -1240,10 +1240,10 @@ RectTransform: m_Children: [] m_Father: {fileID: 1032180211} m_RootOrder: 2 - m_AnchorMin: {x: 0, y: .5} - m_AnchorMax: {x: 1, y: .5} + m_AnchorMin: {x: .5, y: 0} + m_AnchorMax: {x: .5, y: 1} m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: -60, y: 244} + m_SizeDelta: {x: 1200, y: 0} m_Pivot: {x: .5, y: .5} --- !u!114 &251043462 MonoBehaviour: @@ -1260,7 +1260,7 @@ MonoBehaviour: m_Color: {r: .196078435, g: .533333361, b: .650980413, a: 1} m_FontData: m_Font: {fileID: 12800000, guid: 195abaf1001bde54db32dfcefbcc33e8, type: 3} - m_FontSize: 12 + m_FontSize: 52 m_FontStyle: 0 m_BestFit: 0 m_MinSize: 15 @@ -1457,7 +1457,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 0 + m_IsActive: 1 --- !u!224 &317863997 RectTransform: m_ObjectHideFlags: 0 @@ -1600,7 +1600,7 @@ MonoBehaviour: next: {fileID: 1364122813} container: {fileID: 796326285} exit: {fileID: 1778899873} - text: {fileID: 0} + text: {fileID: 1827424311} --- !u!1 &327467908 GameObject: m_ObjectHideFlags: 0 @@ -3375,8 +3375,8 @@ RectTransform: m_Children: [] m_Father: {fileID: 788795694} m_RootOrder: 0 - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} + m_AnchorMin: {x: .5, y: 0} + m_AnchorMax: {x: .5, y: 1} m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 84, y: 0} m_Pivot: {x: .5, y: .5} @@ -4229,10 +4229,10 @@ RectTransform: m_Children: [] m_Father: {fileID: 984201655} m_RootOrder: 2 - m_AnchorMin: {x: 0, y: .5} - m_AnchorMax: {x: 1, y: .5} + m_AnchorMin: {x: .5, y: 0} + m_AnchorMax: {x: .5, y: 1} m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: -60, y: 244} + m_SizeDelta: {x: 1200, y: 0} m_Pivot: {x: .5, y: .5} --- !u!222 &757628127 CanvasRenderer: @@ -4256,16 +4256,16 @@ MonoBehaviour: m_Color: {r: .196078435, g: .533333361, b: .650980413, a: 1} m_FontData: m_Font: {fileID: 12800000, guid: 195abaf1001bde54db32dfcefbcc33e8, type: 3} - m_FontSize: 14 + m_FontSize: 52 m_FontStyle: 0 - m_BestFit: 1 + m_BestFit: 0 m_MinSize: 15 m_MaxSize: 30 m_Alignment: 4 - m_RichText: 1 + m_RichText: 0 m_HorizontalOverflow: 0 m_VerticalOverflow: 0 - m_LineSpacing: 1 + m_LineSpacing: .699999988 m_Text: "Barra de velocidade\r\n\r\nNa barra voc\xEA pode escolher a velocidade que deseja visualizar o sinal" --- !u!1 &759960328 @@ -5320,7 +5320,7 @@ RectTransform: m_Father: {fileID: 1728858300} m_RootOrder: 0 m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} + m_AnchorMax: {x: .5, y: 1} m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 10, y: 0} m_Pivot: {x: .5, y: .5} @@ -5513,7 +5513,7 @@ MonoBehaviour: next: {fileID: 1290849128} container: {fileID: 2021702886} exit: {fileID: 721763001} - text: {fileID: 0} + text: {fileID: 757628128} --- !u!1 &988639887 GameObject: m_ObjectHideFlags: 0 @@ -5709,7 +5709,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!224 &1032180211 RectTransform: m_ObjectHideFlags: 0 @@ -5774,7 +5774,7 @@ MonoBehaviour: next: {fileID: 1621592088} container: {fileID: 792221207} exit: {fileID: 2084437505} - text: {fileID: 0} + text: {fileID: 251043462} --- !u!1 &1059824453 GameObject: m_ObjectHideFlags: 0 @@ -6219,8 +6219,8 @@ RectTransform: m_Children: [] m_Father: {fileID: 836162931} m_RootOrder: 0 - m_AnchorMin: {x: .5, y: 0} - m_AnchorMax: {x: .5, y: 1} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 84, y: 0} m_Pivot: {x: .5, y: .5} @@ -6992,10 +6992,10 @@ RectTransform: m_Children: [] m_Father: {fileID: 1559431852} m_RootOrder: 2 - m_AnchorMin: {x: 0, y: .5} - m_AnchorMax: {x: 1, y: .5} + m_AnchorMin: {x: .5, y: 0} + m_AnchorMax: {x: .5, y: 1} m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: -60, y: 244} + m_SizeDelta: {x: 1200, y: 0} m_Pivot: {x: .5, y: .5} --- !u!114 &1273954787 MonoBehaviour: @@ -7012,16 +7012,16 @@ MonoBehaviour: m_Color: {r: .196078435, g: .533333361, b: .650980413, a: 1} m_FontData: m_Font: {fileID: 12800000, guid: 195abaf1001bde54db32dfcefbcc33e8, type: 3} - m_FontSize: 14 + m_FontSize: 52 m_FontStyle: 0 - m_BestFit: 1 + m_BestFit: 0 m_MinSize: 15 m_MaxSize: 30 m_Alignment: 4 - m_RichText: 1 + m_RichText: 0 m_HorizontalOverflow: 0 m_VerticalOverflow: 0 - m_LineSpacing: 1 + m_LineSpacing: .699999988 m_Text: "Sobre o VLibras\r\n\r\nNessa op\xE7\xE3o voc\xEA tem acesso a informa\xE7\xF5es adicionais sobre nossa aplica\xE7\xE3o" --- !u!222 &1273954788 @@ -9409,7 +9409,7 @@ MonoBehaviour: next: {fileID: 1310535611} container: {fileID: 2082404725} exit: {fileID: 522470815} - text: {fileID: 0} + text: {fileID: 1273954787} --- !u!1 &1559484045 GameObject: m_ObjectHideFlags: 0 @@ -9526,7 +9526,7 @@ MonoBehaviour: next: {fileID: 1284557005} container: {fileID: 1330338141} exit: {fileID: 1491086499} - text: {fileID: 0} + text: {fileID: 1580893663} --- !u!1 &1577109299 GameObject: m_ObjectHideFlags: 0 @@ -9724,10 +9724,10 @@ RectTransform: m_Children: [] m_Father: {fileID: 1570800642} m_RootOrder: 2 - m_AnchorMin: {x: 0, y: .5} - m_AnchorMax: {x: 1, y: .5} + m_AnchorMin: {x: .5, y: 0} + m_AnchorMax: {x: .5, y: 1} m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: -60, y: 244} + m_SizeDelta: {x: 1200, y: 0} m_Pivot: {x: .5, y: .5} --- !u!114 &1580893663 MonoBehaviour: @@ -9744,16 +9744,16 @@ MonoBehaviour: m_Color: {r: .196078435, g: .533333361, b: .650980413, a: 1} m_FontData: m_Font: {fileID: 12800000, guid: 195abaf1001bde54db32dfcefbcc33e8, type: 3} - m_FontSize: 14 + m_FontSize: 52 m_FontStyle: 0 - m_BestFit: 1 + m_BestFit: 0 m_MinSize: 15 m_MaxSize: 30 m_Alignment: 4 m_RichText: 1 m_HorizontalOverflow: 0 m_VerticalOverflow: 0 - m_LineSpacing: 1 + m_LineSpacing: .699999988 m_Text: "Legendas\r\n\r\nNessa op\xE7\xE3o voc\xEA pode ativar e desativar as legendas enquanto o sinal \xE9 traduzido" --- !u!222 &1580893664 @@ -11429,10 +11429,10 @@ RectTransform: m_Children: [] m_Father: {fileID: 323095194} m_RootOrder: 2 - m_AnchorMin: {x: 0, y: .5} - m_AnchorMax: {x: 1, y: .5} + m_AnchorMin: {x: .5, y: 0} + m_AnchorMax: {x: .5, y: 1} m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: -60, y: 244} + m_SizeDelta: {x: 1200, y: 0} m_Pivot: {x: .5, y: .5} --- !u!114 &1827424311 MonoBehaviour: @@ -11449,16 +11449,16 @@ MonoBehaviour: m_Color: {r: .196078435, g: .533333361, b: .650980413, a: 1} m_FontData: m_Font: {fileID: 12800000, guid: 195abaf1001bde54db32dfcefbcc33e8, type: 3} - m_FontSize: 14 + m_FontSize: 52 m_FontStyle: 0 - m_BestFit: 1 + m_BestFit: 0 m_MinSize: 15 m_MaxSize: 30 m_Alignment: 4 m_RichText: 1 m_HorizontalOverflow: 0 m_VerticalOverflow: 0 - m_LineSpacing: 1 + m_LineSpacing: .699999988 m_Text: "Tradu\xE7\xE3o de Fala\n\nNessa op\xE7\xE3o, o que voc\xEA falar ser\xE1 traduzido para LIBRAS" --- !u!222 &1827424312 diff --git a/Assets/Scripts/UIManagers/UIManagerTutorial.cs b/Assets/Scripts/UIManagers/UIManagerTutorial.cs index 8f549c3..d213520 100644 --- a/Assets/Scripts/UIManagers/UIManagerTutorial.cs +++ b/Assets/Scripts/UIManagers/UIManagerTutorial.cs @@ -7,7 +7,8 @@ public class UIManagerTutorial : UIManager { public Button next; public GameObject container; public Button exit; - public RawImage text; + public Text text; + protected override void rebuild(float scale) { @@ -22,7 +23,13 @@ public class UIManagerTutorial : UIManager { float dist = 116 * scale * 0.75F; exit.transform.position = new Vector3(Screen.width - dist, Screen.height - dist, 0); -// text.transform.localScale = new Vector3(scale, scale, 1); + + Vector3 size = text.GetComponent().sizeDelta; + size.x = 1200 * scale; + text.GetComponent().sizeDelta = size; + + float textSize = 52 * scale; + text.fontSize = (int) textSize; } } -- libgit2 0.21.2