diff --git a/Assets/Resources/Prefabs/ExhibitTitle.prefab b/Assets/Resources/Prefabs/ExhibitTitle.prefab index 227e88e..94528e0 100644 --- a/Assets/Resources/Prefabs/ExhibitTitle.prefab +++ b/Assets/Resources/Prefabs/ExhibitTitle.prefab @@ -479,7 +479,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_IgnoreLayout: 0 - m_MinWidth: 0.5 + m_MinWidth: 0.85 m_MinHeight: -1 m_PreferredWidth: -1 m_PreferredHeight: -1 @@ -546,7 +546,7 @@ MonoBehaviour: m_Script: {fileID: 1741964061, guid: f70555f144d8491a825f0804e09c671c, type: 3} m_Name: m_EditorClassIdentifier: - m_HorizontalFit: 2 + m_HorizontalFit: 1 m_VerticalFit: 2 --- !u!222 &222375422432509192 CanvasRenderer: diff --git a/Assets/RothenburgAR/Editor/Test/ExhibitionXmlPreloaderTest.cs b/Assets/RothenburgAR/Editor/Test/ExhibitionXmlPreloaderTest.cs index b2e5854..3e8a840 100644 --- a/Assets/RothenburgAR/Editor/Test/ExhibitionXmlPreloaderTest.cs +++ b/Assets/RothenburgAR/Editor/Test/ExhibitionXmlPreloaderTest.cs @@ -79,10 +79,6 @@ namespace RothenburgAR Assert.NotNull(testExhibit.Description); Assert.IsTrue(testExhibit.Title.HasValue); - - Assert.AreEqual(40f, testExhibit.Title.Value.FontSize); - Assert.AreEqual(45f, testExhibit.Title.Value.BoxHeight); - Assert.AreEqual(200f, testExhibit.Title.Value.BoxWidth); } } } \ No newline at end of file diff --git a/Assets/RothenburgAR/Scripts/Exhibition/ExhibitBehaviour.cs b/Assets/RothenburgAR/Scripts/Exhibition/ExhibitBehaviour.cs index 2e1f059..ffd9daa 100644 --- a/Assets/RothenburgAR/Scripts/Exhibition/ExhibitBehaviour.cs +++ b/Assets/RothenburgAR/Scripts/Exhibition/ExhibitBehaviour.cs @@ -40,13 +40,16 @@ namespace RothenburgAR.Exhibition TitleBehaviour.Exhibit = this; } - //TODO remove title rotation - if (newTitle.Rotation.HasValue) - TitleBehaviour.transform.localEulerAngles = newTitle.Rotation.Value + new Vector3(90, 0, 0); + TitleBehaviour.transform.localEulerAngles = new Vector3(90, 0, 0); - //TODO remove title position and calculate on the fly? if tracker is on a wall, below is best. if it sits on the ground, what? + //TODO remove title position property and calculate on the fly? + // if tracker is on a wall, below is best. if it sits on the ground, what? + // leave property alive for now and set title slightly below the bottom border for now if (newTitle.Position.HasValue) TitleBehaviour.transform.localPosition = newTitle.Position.Value; + else + TitleBehaviour.transform.localPosition = new Vector3(0, .05f, -.52f); + TitleBehaviour.DataText = newTitle.Text; } diff --git a/Assets/RothenburgAR/Scripts/Exhibition/ExhibitionApiDataPreloader.cs b/Assets/RothenburgAR/Scripts/Exhibition/ExhibitionApiDataPreloader.cs index 917e396..e03269b 100644 --- a/Assets/RothenburgAR/Scripts/Exhibition/ExhibitionApiDataPreloader.cs +++ b/Assets/RothenburgAR/Scripts/Exhibition/ExhibitionApiDataPreloader.cs @@ -88,21 +88,9 @@ namespace RothenburgAR.Exhibition } newExhibit.Description = exhibitDescr; - //TODO calculate sizes dynamically and remove these default values - var position = new Vector3(0, .1f, -.52f); - var rotation = Vector3.zero; - var fontSize = .7f; - var boxHeight = .25f; - var boxWidth = .75f; - PreloadedExhibitTitle preTitle = new PreloadedExhibitTitle { - Text = exhibitTitle, - Position = position, - Rotation = rotation, - FontSize = fontSize, - BoxWidth = boxWidth, - BoxHeight = boxHeight + Text = exhibitTitle }; newExhibit.Title = preTitle; diff --git a/Assets/RothenburgAR/Scripts/Exhibition/ExhibitionXmlPreloader.cs b/Assets/RothenburgAR/Scripts/Exhibition/ExhibitionXmlPreloader.cs index 9315172..f5a3532 100644 --- a/Assets/RothenburgAR/Scripts/Exhibition/ExhibitionXmlPreloader.cs +++ b/Assets/RothenburgAR/Scripts/Exhibition/ExhibitionXmlPreloader.cs @@ -93,11 +93,7 @@ namespace RothenburgAR.Exhibition PreloadedExhibitTitle preTitle = new PreloadedExhibitTitle { Text = exhibitTitle, - Position = GetVector3FromXmlNode(exhibitNode.SelectSingleNode("title/position")), - Rotation = GetVector3FromXmlNode(exhibitNode.SelectSingleNode("title/rotation")), - FontSize = fontSize ?? 20, - BoxWidth = boxWidth ?? 200, - BoxHeight = boxHeight ?? 25 + Position = GetVector3FromXmlNode(exhibitNode.SelectSingleNode("title/position")) }; newExhibit.Title = preTitle; } diff --git a/Assets/RothenburgAR/Scripts/Exhibition/PreloadedExhibition.cs b/Assets/RothenburgAR/Scripts/Exhibition/PreloadedExhibition.cs index 06d5b58..580d3e1 100644 --- a/Assets/RothenburgAR/Scripts/Exhibition/PreloadedExhibition.cs +++ b/Assets/RothenburgAR/Scripts/Exhibition/PreloadedExhibition.cs @@ -31,11 +31,6 @@ namespace RothenburgAR.Exhibition public struct PreloadedExhibitTitle { public TextElement Text { get; set; } - public Vector3? Rotation { get; set; } public Vector3? Position { get; set; } - public Vector2? Dimensions { get; set; } - public float FontSize { get; set; } - public float BoxHeight { get; set; } - public float BoxWidth { get; set; } } } \ No newline at end of file