Tap into virtual and physical game controllers

RSS for tag

Discuss the WWDC21 session Tap into virtual and physical game controllers.

Posts under wwdc21-10081 tag

4 Posts

Post

Replies

Boosts

Views

Activity

How to use GCVirtualController directly with SKScene?
GCVirtualController isn't displaying when used with SKScene class. The Virtual controllers appear but then it seems that they are obscured by the SKScene itself!? The documentation says that calling connect() will display the virtual controllers but I seem to be missing how to add the controllers to the SKScene? class GameScene: SKScene { private var _virtualController: Any? @available(iOS 15.0, *) public var virtualController: GCVirtualController? { get { return self._virtualController as? GCVirtualController } set { self._virtualController = newValue } } override func didMove(to view: SKView) { let background = SKSpriteNode(imageNamed: ".jpg") background.zPosition = -1 addChild(background) let virtualConfig = GCVirtualController.Configuration() virtualConfig.elements = [GCInputLeftThumbstick, GCInputRightThumbstick, GCInputButtonA, GCInputButtonB] virtualController = GCVirtualController(configuration: virtualConfig) virtualController?.connect() } } I've also tried adding the virtual controllers in the UIViewController but this doesn't work either.
5
0
2.5k
Jun ’24
GCVirtualController -- Left elements do not appear when using portrait mode
I'm trying to use GCVirtualController in an app and am running into an apparent bug when trying to use it in portrait mode. If I create "left side" and "right side" elements such as a left analog stick and right analog stick, things appear as expected when in landscape mode. When I switch to portrait mode only the right side elements appear. This doesn't appear to be a documented limitation and I'd like to be able to use the GCVirtualController in both orientations. Any advice? Is this just a bug or an intentional design limitation.
0
0
676
Dec ’21
GCVirtualController -- Unable to customize appearance of analog sticks with a custom UIBezierPath
GCVirtualController supports setting a UIBezierPath for configuring controller elements. This seems to work fine for things like A/B/X/Y buttons but it seems to be silently ignored when trying to set against the analog stick elements. This doesn't seem to be a documented limitation. Is this just a bug in GCVirtualController or an intentional limitation?
0
0
979
Dec ’21
How to use GCVirtualController directly with SKScene?
GCVirtualController isn't displaying when used with SKScene class. The Virtual controllers appear but then it seems that they are obscured by the SKScene itself!? The documentation says that calling connect() will display the virtual controllers but I seem to be missing how to add the controllers to the SKScene? class GameScene: SKScene { private var _virtualController: Any? @available(iOS 15.0, *) public var virtualController: GCVirtualController? { get { return self._virtualController as? GCVirtualController } set { self._virtualController = newValue } } override func didMove(to view: SKView) { let background = SKSpriteNode(imageNamed: ".jpg") background.zPosition = -1 addChild(background) let virtualConfig = GCVirtualController.Configuration() virtualConfig.elements = [GCInputLeftThumbstick, GCInputRightThumbstick, GCInputButtonA, GCInputButtonB] virtualController = GCVirtualController(configuration: virtualConfig) virtualController?.connect() } } I've also tried adding the virtual controllers in the UIViewController but this doesn't work either.
Replies
5
Boosts
0
Views
2.5k
Activity
Jun ’24
GCVirtualController -- Left elements do not appear when using portrait mode
I'm trying to use GCVirtualController in an app and am running into an apparent bug when trying to use it in portrait mode. If I create "left side" and "right side" elements such as a left analog stick and right analog stick, things appear as expected when in landscape mode. When I switch to portrait mode only the right side elements appear. This doesn't appear to be a documented limitation and I'd like to be able to use the GCVirtualController in both orientations. Any advice? Is this just a bug or an intentional design limitation.
Replies
0
Boosts
0
Views
676
Activity
Dec ’21
GCVirtualController -- Unable to customize appearance of analog sticks with a custom UIBezierPath
GCVirtualController supports setting a UIBezierPath for configuring controller elements. This seems to work fine for things like A/B/X/Y buttons but it seems to be silently ignored when trying to set against the analog stick elements. This doesn't seem to be a documented limitation. Is this just a bug in GCVirtualController or an intentional limitation?
Replies
0
Boosts
0
Views
979
Activity
Dec ’21
'GCVirtualController?' has no member 'changeElement'
In the example code:- vc.changeElement(GCInputButtonA) { I get the error. Value of type 'GCVirtualController?' has no member 'changeElement' I thought the vc reference was view controller but this did not work. Any help would be great. Thanks in advance
Replies
1
Boosts
0
Views
1.4k
Activity
Oct ’21