From 2f4a6f514822b89ee32c0c0198058f142d4bf5df Mon Sep 17 00:00:00 2001
From: mhby1g21 <mhby1g21@soton.ac.uk>
Date: Mon, 30 Dec 2024 23:11:09 +0000
Subject: [PATCH] set initial size smaller and to bottom right

---
 ...mplete XR Origin Set Up Variant AVVR.prefab | 11 +----------
 AVVR/Assets/_Scripts/SpectatorWindow.cs        | 18 ++++++++++++++++--
 2 files changed, 17 insertions(+), 12 deletions(-)

diff --git a/AVVR/Assets/Prefabs/Complete XR Origin Set Up Variant AVVR.prefab b/AVVR/Assets/Prefabs/Complete XR Origin Set Up Variant AVVR.prefab
index c9872f4..637f32d 100644
--- a/AVVR/Assets/Prefabs/Complete XR Origin Set Up Variant AVVR.prefab	
+++ b/AVVR/Assets/Prefabs/Complete XR Origin Set Up Variant AVVR.prefab	
@@ -59,7 +59,6 @@ GameObject:
   m_Component:
   - component: {fileID: 24857229647593761}
   - component: {fileID: 7249712585786564757}
-  - component: {fileID: 7321445143899016650}
   - component: {fileID: 3027666375171427404}
   - component: {fileID: 5041059882800856174}
   m_Layer: 2
@@ -97,7 +96,7 @@ Camera:
   m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
   m_projectionMatrixMode: 1
   m_GateFitMode: 2
-  m_FOVAxisMode: 0
+  m_FOVAxisMode: 1
   m_Iso: 200
   m_ShutterSpeed: 0.005
   m_Aperture: 16
@@ -135,14 +134,6 @@ Camera:
   m_OcclusionCulling: 1
   m_StereoConvergence: 10
   m_StereoSeparation: 0.022
---- !u!81 &7321445143899016650
-AudioListener:
-  m_ObjectHideFlags: 0
-  m_CorrespondingSourceObject: {fileID: 0}
-  m_PrefabInstance: {fileID: 0}
-  m_PrefabAsset: {fileID: 0}
-  m_GameObject: {fileID: 5619876154759688209}
-  m_Enabled: 1
 --- !u!114 &3027666375171427404
 MonoBehaviour:
   m_ObjectHideFlags: 0
diff --git a/AVVR/Assets/_Scripts/SpectatorWindow.cs b/AVVR/Assets/_Scripts/SpectatorWindow.cs
index 773abe0..a10aa77 100644
--- a/AVVR/Assets/_Scripts/SpectatorWindow.cs
+++ b/AVVR/Assets/_Scripts/SpectatorWindow.cs
@@ -6,8 +6,22 @@ public class SpectatorWindow : MonoBehaviour
     private Camera spectatorCam;
     private RenderTexture renderTexture;
     private bool showWindow = true;
-    [SerializeField] private KeyCode toggleKey = KeyCode.F2;
-    private Rect windowRect = new Rect(100, 100, 800, 450);
+    [SerializeField] private KeyCode toggleKey = KeyCode.Tab;
+    private Rect windowRect;
+
+    private void Start()
+    {
+        // Set initial window size
+        float windowWidth = 400;
+        float windowHeight = 225;
+
+        // Calculate position for bottom right
+        float xPos = Screen.width - windowWidth - 20;  // 20 pixels padding from right
+        float yPos = Screen.height - windowHeight - 40; // 40 pixels padding from bottom for taskbar etc
+
+        // Initialize window rectangle
+        windowRect = new Rect(xPos, yPos, windowWidth, windowHeight);
+    }
     
     [Header("Window Settings")]
     [SerializeField] private bool enableWindowDrag = true;
-- 
GitLab