Skip to content

Add per-controller-type body silhouette to GCKControllerView#3

Closed
0xWDG with Copilot wants to merge 3 commits into
mainfrom
copilot/improve-gckcontrollerview
Closed

Add per-controller-type body silhouette to GCKControllerView#3
0xWDG with Copilot wants to merge 3 commits into
mainfrom
copilot/improve-gckcontrollerview

Conversation

Copilot AI commented Apr 1, 2026

Copy link
Copy Markdown

GCKControllerView showed no visual representation of the physical controller form factor. This PR adds SwiftUI Shape-based silhouettes that render the appropriate controller outline based on the connected type.

New: GCKControllerShape.swift

  • GCKPlayStationControllerShape — bezier path outline for DualSense/DualShock (wide flat top, symmetrical bottom grips, arch gap between them)
  • GCKXboxControllerShape — similar structure with a gently arched top and rounder grips matching Xbox proportions
  • GCKSiriRemoteShape — tall pill (roundedRect path)
  • GCKControllerShapeView — public composite view; switches on GCKControllerType?, renders the matching stroked shape, falls back to the gamecontroller SF Symbol for generic/unknown controllers

All shapes are designed in a normalised coordinate space (e.g. 200×130) and scale to any CGRect, with Color.primary stroke for automatic light/dark mode support.

Updated: GCKControllerView.swift

Embeds GCKControllerShapeView between the controller type label and the shoulder buttons:

controllerTypeLabel

GCKControllerShapeView(controllerType: GCKit.controllerType)
    .padding(.bottom, 8)

shoulder2
shoulder1

Because controllerType is @Published on the @EnvironmentObject, the silhouette updates reactively on connect/disconnect without additional wiring.

Also fixed a pre-existing typo in GCKControllerType.description: "Genric""Generic".

Copilot AI changed the title [WIP] Implement improved GCKControllerView for dynamic controller UI Improve GCKControllerView to adapt UI dynamically by controller type Apr 1, 2026
Copilot finished work on behalf of 0xWDG April 1, 2026 09:49
Copilot AI requested a review from 0xWDG April 1, 2026 09:49
Copilot AI changed the title Improve GCKControllerView to adapt UI dynamically by controller type Add per-controller-type body silhouette to GCKControllerView Apr 1, 2026
Copilot finished work on behalf of 0xWDG April 1, 2026 10:12
@0xWDG 0xWDG closed this Jun 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants