From dc2d17ffbefa783d06c62250ee2c7aeccd68ac69 Mon Sep 17 00:00:00 2001 From: Caroline Moore Date: Thu, 25 Jun 2026 15:37:44 -0400 Subject: [PATCH 1/2] Adds offset to game view, enabling drag-to-reposition --- DeltaCore/UI/Game/GameViewController.swift | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/DeltaCore/UI/Game/GameViewController.swift b/DeltaCore/UI/Game/GameViewController.swift index c6de884..0e4d9c8 100644 --- a/DeltaCore/UI/Game/GameViewController.swift +++ b/DeltaCore/UI/Game/GameViewController.swift @@ -92,6 +92,9 @@ open class GameViewController: UIViewController, GameControllerReceiver public var automaticallyPausesWhileInactive: Bool = true + // Offset applied to the game view while it's centered with no on-screen controls. + public var gameScreenOffset: CGPoint = .zero + public var gameView: GameView! { return self.gameViews.first } @@ -401,7 +404,7 @@ open class GameViewController: UIViewController, GameControllerReceiver else { let gameScreenFrame = AVMakeRect(aspectRatio: gameScreenDimensions, insideRect: availableGameFrame) - self.gameView.frame = gameScreenFrame + self.gameView.frame = gameScreenFrame.offsetBy(dx: self.gameScreenOffset.x, dy: self.gameScreenOffset.y) } if let emulatorCore = self.emulatorCore, emulatorCore.state != .running From a020f4589e0c05c3efd97301051ace59a61e16a6 Mon Sep 17 00:00:00 2001 From: Caroline Moore Date: Thu, 25 Jun 2026 16:40:20 -0400 Subject: [PATCH 2/2] Adds support for drag-to-reposition in DS games --- DeltaCore/UI/Game/GameViewController.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DeltaCore/UI/Game/GameViewController.swift b/DeltaCore/UI/Game/GameViewController.swift index 0e4d9c8..4435946 100644 --- a/DeltaCore/UI/Game/GameViewController.swift +++ b/DeltaCore/UI/Game/GameViewController.swift @@ -364,7 +364,7 @@ open class GameViewController: UIViewController, GameControllerReceiver contentAspectRatio = gameScreenDimensions } - let appPlacementFrame = AVMakeRect(aspectRatio: contentAspectRatio, insideRect: availableGameFrame).rounded() + let appPlacementFrame = AVMakeRect(aspectRatio: contentAspectRatio, insideRect: availableGameFrame).rounded().offsetBy(dx: self.gameScreenOffset.x, dy: self.gameScreenOffset.y) if self.appPlacementLayoutGuide.layoutFrame.rounded() != appPlacementFrame { self.appPlacementXConstraint.constant = appPlacementFrame.minX