Commit ce692af8 authored by Gerard Gascón's avatar Gerard Gascón
Browse files

feat: basic window resizing

parent 438b16fc
Loading
Loading
Loading
Loading
+14 −2
Original line number Diff line number Diff line
@@ -679,6 +679,7 @@ GameObject:
  - component: {fileID: 501733677}
  - component: {fileID: 501733676}
  - component: {fileID: 501733679}
  - component: {fileID: 501733680}
  m_Layer: 0
  m_Name: Main Camera
  m_TagString: MainCamera
@@ -773,8 +774,19 @@ MonoBehaviour:
  m_Name: 
  m_EditorClassIdentifier: 
  mouseButton: 0
  modifierKey: 0
  temporarilyDisableIfKeyPressed: 
--- !u!114 &501733680
MonoBehaviour:
  m_ObjectHideFlags: 0
  m_CorrespondingSourceObject: {fileID: 0}
  m_PrefabInstance: {fileID: 0}
  m_PrefabAsset: {fileID: 0}
  m_GameObject: {fileID: 501733675}
  m_Enabled: 1
  m_EditorHideFlags: 0
  m_Script: {fileID: 11500000, guid: 0d779b53ae5c4644b516e84fdc31fcdc, type: 3}
  m_Name: 
  m_EditorClassIdentifier: 
  mouseButton: 0
--- !u!1 &902566661
GameObject:
  m_ObjectHideFlags: 0
+5 −4
Original line number Diff line number Diff line
#if !UNITY_EDITOR

using SatorImaging.AppWindowUtility;
using UnityEngine;

@@ -6,13 +6,14 @@ namespace View {
	internal static class DisplaySetup {
		[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSplashScreen)]
		private static void Setup() {
#if !UNITY_EDITOR
			AppWindowUtility.AlwaysOnTop = true;
			AppWindowUtility.FrameVisibility = false;

			//Vector2Int resolution = new(360, 640);
			Vector2Int resolution = new(360, 540);
			AppWindowUtility.ResizeWindowRelative(resolution.x, resolution.y);
			AppWindowUtility.ResizeWindow(resolution.x, resolution.y);
#endif
		}
	}
}
 No newline at end of file
#endif
 No newline at end of file
+5 −6
Original line number Diff line number Diff line
@@ -67,8 +67,11 @@ namespace SatorImaging.AppWindowUtility


        public static bool WindowResizeSupported { get => platform?.WindowResizeSupported ?? false; }
        public static void ResizeWindowRelative(int pixelX, int pixelY)
            => platform?.ResizeWindowRelative(pixelX, pixelY);
        public static void ResizeWindow(int pixelX, int pixelY)
            => platform?.ResizeWindow(pixelX, pixelY);

        public static void ResizeWindowRelative(float pixelX, float pixelY, Vector2 resizeDirection, float aspectRatio)
            => platform?.ResizeWindowRelative(pixelX, pixelY, resizeDirection, aspectRatio);



@@ -106,9 +109,5 @@ namespace SatorImaging.AppWindowUtility

            }//set
        }//




    }//class
}//namespace
+5 −3
Original line number Diff line number Diff line
namespace SatorImaging.AppWindowUtility
using UnityEngine;

namespace SatorImaging.AppWindowUtility
{
    public interface IPlatformDependent
    {
@@ -36,8 +38,8 @@
        void MoveWindow(int x, int y);

        bool WindowResizeSupported { get; }
        public void ResizeWindowRelative(int relativeWidth, int relativeHeight);

        public void ResizeWindow(int width, int height);
        void ResizeWindowRelative(float deltaX, float deltaY, Vector2 resizeDirection, float aspectRatio);
    }//

}//namespace
+7 −0
Original line number Diff line number Diff line
namespace SatorImaging.AppWindowUtility {
	public enum MouseButton {
		Left = 0,
		Right = 1,
		Middle = 2,
	}
}
 No newline at end of file
Loading