97
© 2016 Apple Inc. All rights reserved. Redistribution or public display not permitted without written permission from Apple. Graphics and Games #WWDC16 Session 607 Controlling Game Input for Apple TV JJ Cwik Software Engineer

Controlling Game Input for Apple TV · Controlling Game Input for Apple TV JJ Cwik Software Engineer. tvOS 10 What’s New Apps may require an MFi game controller Support for up to

  • Upload
    others

  • View
    10

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Controlling Game Input for Apple TV · Controlling Game Input for Apple TV JJ Cwik Software Engineer. tvOS 10 What’s New Apps may require an MFi game controller Support for up to

© 2016 Apple Inc. All rights reserved. Redistribution or public display not permitted without written permission from Apple.

Graphics and Games #WWDC16

Session 607

Controlling Game Input for Apple TV

JJ Cwik Software Engineer

Page 2: Controlling Game Input for Apple TV · Controlling Game Input for Apple TV JJ Cwik Software Engineer. tvOS 10 What’s New Apps may require an MFi game controller Support for up to
Page 3: Controlling Game Input for Apple TV · Controlling Game Input for Apple TV JJ Cwik Software Engineer. tvOS 10 What’s New Apps may require an MFi game controller Support for up to

tvOS 10What’s New

Apps may require an MFi game controllerSupport for up to four MFi game controllersApple TV Remote app

NEW

Page 4: Controlling Game Input for Apple TV · Controlling Game Input for Apple TV JJ Cwik Software Engineer. tvOS 10 What’s New Apps may require an MFi game controller Support for up to

Siri Remote MFi Game Controller

Page 5: Controlling Game Input for Apple TV · Controlling Game Input for Apple TV JJ Cwik Software Engineer. tvOS 10 What’s New Apps may require an MFi game controller Support for up to

OverviewGame Controller Framework

Adds Siri Remote and MFi game controller support to your game

Page 6: Controlling Game Input for Apple TV · Controlling Game Input for Apple TV JJ Cwik Software Engineer. tvOS 10 What’s New Apps may require an MFi game controller Support for up to

OverviewGame Controller Framework

Adds Siri Remote and MFi game controller support to your gameSame API for all controllers• Detect controllers• Handle connection, disconnection• Read inputs

Page 7: Controlling Game Input for Apple TV · Controlling Game Input for Apple TV JJ Cwik Software Engineer. tvOS 10 What’s New Apps may require an MFi game controller Support for up to

OverviewGame Controller Framework

Adds Siri Remote and MFi game controller support to your gameSame API for all controllers• Detect controllers• Handle connection, disconnection• Read inputs

Available for tvOS, iOS and macOS

Page 8: Controlling Game Input for Apple TV · Controlling Game Input for Apple TV JJ Cwik Software Engineer. tvOS 10 What’s New Apps may require an MFi game controller Support for up to

Detecting Controllers

GCController represents a physical controllerSame class for all controllers

Page 9: Controlling Game Input for Apple TV · Controlling Game Input for Apple TV JJ Cwik Software Engineer. tvOS 10 What’s New Apps may require an MFi game controller Support for up to

Detecting Controllers

GCController represents a physical controllerSame class for all controllersCurrently-connected controllers:

GCController.controllers() // [GCController]

Page 10: Controlling Game Input for Apple TV · Controlling Game Input for Apple TV JJ Cwik Software Engineer. tvOS 10 What’s New Apps may require an MFi game controller Support for up to

Detecting Controllers

GCController represents a physical controllerSame class for all controllersCurrently-connected controllers:

GCController.controllers() // [GCController]

Connection and disconnection notifications:

GCControllerDidConnectNotification

GCControllerDidDisconnectNotification

Page 11: Controlling Game Input for Apple TV · Controlling Game Input for Apple TV JJ Cwik Software Engineer. tvOS 10 What’s New Apps may require an MFi game controller Support for up to

Siri Remote

GCController

Page 12: Controlling Game Input for Apple TV · Controlling Game Input for Apple TV JJ Cwik Software Engineer. tvOS 10 What’s New Apps may require an MFi game controller Support for up to

Siri Remote

GCController• GCMicroGamepad

Page 13: Controlling Game Input for Apple TV · Controlling Game Input for Apple TV JJ Cwik Software Engineer. tvOS 10 What’s New Apps may require an MFi game controller Support for up to

Siri Remote

GCController• GCMicroGamepad• GCMotion

Page 14: Controlling Game Input for Apple TV · Controlling Game Input for Apple TV JJ Cwik Software Engineer. tvOS 10 What’s New Apps may require an MFi game controller Support for up to

GCMicroGamepad Profile

Dpad (analog or digital)‘A’ button (digital)‘X’ button (digital)

DPAD

Page 15: Controlling Game Input for Apple TV · Controlling Game Input for Apple TV JJ Cwik Software Engineer. tvOS 10 What’s New Apps may require an MFi game controller Support for up to

GCMicroGamepad Profile

Dpad (analog or digital)‘A’ button (digital)‘X’ button (digital)

Page 16: Controlling Game Input for Apple TV · Controlling Game Input for Apple TV JJ Cwik Software Engineer. tvOS 10 What’s New Apps may require an MFi game controller Support for up to

GCMicroGamepad Profile

Dpad (analog or digital)‘A’ button (digital)‘X’ button (digital)

‘A’ button

Page 17: Controlling Game Input for Apple TV · Controlling Game Input for Apple TV JJ Cwik Software Engineer. tvOS 10 What’s New Apps may require an MFi game controller Support for up to

GCMicroGamepad Profile

Dpad (analog or digital)‘A’ button (digital)‘X’ button (digital)

Page 18: Controlling Game Input for Apple TV · Controlling Game Input for Apple TV JJ Cwik Software Engineer. tvOS 10 What’s New Apps may require an MFi game controller Support for up to

GCMicroGamepad Profile

Dpad (analog or digital)‘A’ button (digital)‘X’ button (digital)

‘X’ button

Page 19: Controlling Game Input for Apple TV · Controlling Game Input for Apple TV JJ Cwik Software Engineer. tvOS 10 What’s New Apps may require an MFi game controller Support for up to

ButtonsGCMicroGamepad Profile

Polling

let isAPressed = controller.microGamepad?.buttonA.isPressed // Bool

let isXPressed = controller.microGamepad?.buttonX.isPressed // Bool

Page 20: Controlling Game Input for Apple TV · Controlling Game Input for Apple TV JJ Cwik Software Engineer. tvOS 10 What’s New Apps may require an MFi game controller Support for up to

ButtonsGCMicroGamepad Profile

Polling

let isAPressed = controller.microGamepad?.buttonA.isPressed // Bool

let isXPressed = controller.microGamepad?.buttonX.isPressed // Bool

Event callbacks

controller.microGamepad?.buttonA.pressedChangedHandler = myButtonAHandler

controller.microGamepad?.buttonX.pressedChangedHandler = myButtonXHandler

Page 21: Controlling Game Input for Apple TV · Controlling Game Input for Apple TV JJ Cwik Software Engineer. tvOS 10 What’s New Apps may require an MFi game controller Support for up to

GCControllerDirectionPadGCMicroGamepad Profile

Treated as four buttons• up, down, left, right

And as two axes• xAxis, yAxis

DPAD

Page 22: Controlling Game Input for Apple TV · Controlling Game Input for Apple TV JJ Cwik Software Engineer. tvOS 10 What’s New Apps may require an MFi game controller Support for up to

GCControllerAxisInputGCMicroGamepad Profile

Polling

let dpadX = controller.microGamepad?.dpad.xAxis.value // Float, -1.0 to 1.0

let dpadY = controller.microGamepad?.dpad.yAxis.value // Float, -1.0 to 1.0

Page 23: Controlling Game Input for Apple TV · Controlling Game Input for Apple TV JJ Cwik Software Engineer. tvOS 10 What’s New Apps may require an MFi game controller Support for up to

GCControllerAxisInputGCMicroGamepad Profile

Polling

let dpadX = controller.microGamepad?.dpad.xAxis.value // Float, -1.0 to 1.0

let dpadY = controller.microGamepad?.dpad.yAxis.value // Float, -1.0 to 1.0

Event callbacks

controller.microGamepad?.dpad.valueChangedHandler = myDpadHandler

Page 24: Controlling Game Input for Apple TV · Controlling Game Input for Apple TV JJ Cwik Software Engineer. tvOS 10 What’s New Apps may require an MFi game controller Support for up to

DPAD windowingSiri Remote

Page 25: Controlling Game Input for Apple TV · Controlling Game Input for Apple TV JJ Cwik Software Engineer. tvOS 10 What’s New Apps may require an MFi game controller Support for up to

DPAD windowingSiri Remote

x

y

Page 26: Controlling Game Input for Apple TV · Controlling Game Input for Apple TV JJ Cwik Software Engineer. tvOS 10 What’s New Apps may require an MFi game controller Support for up to

DPAD windowingSiri Remote

Provides windowed values (by default)• Touch start location defines (0, 0)• Subsequent values relative to start point

x

y

Page 27: Controlling Game Input for Apple TV · Controlling Game Input for Apple TV JJ Cwik Software Engineer. tvOS 10 What’s New Apps may require an MFi game controller Support for up to

DPAD windowingSiri Remote

Page 28: Controlling Game Input for Apple TV · Controlling Game Input for Apple TV JJ Cwik Software Engineer. tvOS 10 What’s New Apps may require an MFi game controller Support for up to

DPAD windowingSiri Remote

Page 29: Controlling Game Input for Apple TV · Controlling Game Input for Apple TV JJ Cwik Software Engineer. tvOS 10 What’s New Apps may require an MFi game controller Support for up to

DPAD windowingSiri Remote

x

y

Page 30: Controlling Game Input for Apple TV · Controlling Game Input for Apple TV JJ Cwik Software Engineer. tvOS 10 What’s New Apps may require an MFi game controller Support for up to

DPAD windowingSiri Remote

x

y

Page 31: Controlling Game Input for Apple TV · Controlling Game Input for Apple TV JJ Cwik Software Engineer. tvOS 10 What’s New Apps may require an MFi game controller Support for up to

DPAD windowingSiri Remote

x

y

Page 32: Controlling Game Input for Apple TV · Controlling Game Input for Apple TV JJ Cwik Software Engineer. tvOS 10 What’s New Apps may require an MFi game controller Support for up to

DPAD windowingSiri Remote

x

y

Page 33: Controlling Game Input for Apple TV · Controlling Game Input for Apple TV JJ Cwik Software Engineer. tvOS 10 What’s New Apps may require an MFi game controller Support for up to

DPAD windowingSiri Remote

Opt-in to get absolute dpad valuesPlaces (0, 0) at center of touch surface

controller.microGamepad?.reportsAbsoluteDpadValues = true

x

y

Page 34: Controlling Game Input for Apple TV · Controlling Game Input for Apple TV JJ Cwik Software Engineer. tvOS 10 What’s New Apps may require an MFi game controller Support for up to

DPAD windowingSiri Remote

Page 35: Controlling Game Input for Apple TV · Controlling Game Input for Apple TV JJ Cwik Software Engineer. tvOS 10 What’s New Apps may require an MFi game controller Support for up to

DPAD windowingSiri Remote

x

y

Page 36: Controlling Game Input for Apple TV · Controlling Game Input for Apple TV JJ Cwik Software Engineer. tvOS 10 What’s New Apps may require an MFi game controller Support for up to

DPAD windowingSiri Remote

x

y

Page 37: Controlling Game Input for Apple TV · Controlling Game Input for Apple TV JJ Cwik Software Engineer. tvOS 10 What’s New Apps may require an MFi game controller Support for up to

RotationSiri Remote

DPAD (x, y) values reported in portrait• Regardless of remote orientation• X right, Y up

x

y

Page 38: Controlling Game Input for Apple TV · Controlling Game Input for Apple TV JJ Cwik Software Engineer. tvOS 10 What’s New Apps may require an MFi game controller Support for up to

RotationSiri Remote

DPAD (x, y) values reported in portrait• Regardless of remote orientation• X right, Y up

x

y

Page 39: Controlling Game Input for Apple TV · Controlling Game Input for Apple TV JJ Cwik Software Engineer. tvOS 10 What’s New Apps may require an MFi game controller Support for up to

RotationSiri Remote

Opt-in to report (x, y) based on orientation• Portrait• Landscape left• Landscape right

controller.microGamepad?.allowsRotation = true

x

y

Page 40: Controlling Game Input for Apple TV · Controlling Game Input for Apple TV JJ Cwik Software Engineer. tvOS 10 What’s New Apps may require an MFi game controller Support for up to

MotionSiri Remote

GCMotion• Gravity vector (x, y, z)• User acceleration (x, y, z)

Page 41: Controlling Game Input for Apple TV · Controlling Game Input for Apple TV JJ Cwik Software Engineer. tvOS 10 What’s New Apps may require an MFi game controller Support for up to

MotionSiri Remote

GCMotion• Gravity vector (x, y, z)• User acceleration (x, y, z)

Already filtered

Page 42: Controlling Game Input for Apple TV · Controlling Game Input for Apple TV JJ Cwik Software Engineer. tvOS 10 What’s New Apps may require an MFi game controller Support for up to

MotionSiri Remote

GCMotion• Gravity vector (x, y, z)• User acceleration (x, y, z)

Already filteredFused motion data• Accelerometer and gyroscope

Page 43: Controlling Game Input for Apple TV · Controlling Game Input for Apple TV JJ Cwik Software Engineer. tvOS 10 What’s New Apps may require an MFi game controller Support for up to

MotionSiri Remote

Not intended for• Vigorous shaking• Aggressive movements

Page 44: Controlling Game Input for Apple TV · Controlling Game Input for Apple TV JJ Cwik Software Engineer. tvOS 10 What’s New Apps may require an MFi game controller Support for up to

Menu Button

Page 45: Controlling Game Input for Apple TV · Controlling Game Input for Apple TV JJ Cwik Software Engineer. tvOS 10 What’s New Apps may require an MFi game controller Support for up to

Menu Button

1. Minimize app and return to Apple TV Home Screen

Page 46: Controlling Game Input for Apple TV · Controlling Game Input for Apple TV JJ Cwik Software Engineer. tvOS 10 What’s New Apps may require an MFi game controller Support for up to

Menu Button

1. Minimize app and return to Apple TV Home Screen2. Go back one level in app menus

Page 47: Controlling Game Input for Apple TV · Controlling Game Input for Apple TV JJ Cwik Software Engineer. tvOS 10 What’s New Apps may require an MFi game controller Support for up to

Menu Button

1. Minimize app and return to Apple TV Home Screen2. Go back one level in app menus3. Pause / resume gameplay

Page 48: Controlling Game Input for Apple TV · Controlling Game Input for Apple TV JJ Cwik Software Engineer. tvOS 10 What’s New Apps may require an MFi game controller Support for up to

Menu Button

Page 49: Controlling Game Input for Apple TV · Controlling Game Input for Apple TV JJ Cwik Software Engineer. tvOS 10 What’s New Apps may require an MFi game controller Support for up to

Menu Button

Child View Controller

Child View Controller

Root View Controller

UIKit apps

Page 50: Controlling Game Input for Apple TV · Controlling Game Input for Apple TV JJ Cwik Software Engineer. tvOS 10 What’s New Apps may require an MFi game controller Support for up to

Menu Button

Child View Controller

Child View Controller

Root View Controller

UIKit apps

Root View Controller

Main menu Character selection

Level selection Gameplay

Pause screen

Games

Page 51: Controlling Game Input for Apple TV · Controlling Game Input for Apple TV JJ Cwik Software Engineer. tvOS 10 What’s New Apps may require an MFi game controller Support for up to

Menu Button

GCEventViewController• For single-view controller games• Use as your root view controller

Page 52: Controlling Game Input for Apple TV · Controlling Game Input for Apple TV JJ Cwik Software Engineer. tvOS 10 What’s New Apps may require an MFi game controller Support for up to

Menu Button

GCEventViewController• For single-view controller games• Use as your root view controller

public var controllerUserInteractionEnabled: Bool

• false: Stay in-game• true: Return to Home Screen

Page 53: Controlling Game Input for Apple TV · Controlling Game Input for Apple TV JJ Cwik Software Engineer. tvOS 10 What’s New Apps may require an MFi game controller Support for up to

Managing controllerUserInteractionEnabledMenu Button

Page 54: Controlling Game Input for Apple TV · Controlling Game Input for Apple TV JJ Cwik Software Engineer. tvOS 10 What’s New Apps may require an MFi game controller Support for up to

Managing controllerUserInteractionEnabledMenu Button

Splash Screen In-Game

Main Menu

true

controllerUserInteractionEnabled:

Home Screen

true

Page 55: Controlling Game Input for Apple TV · Controlling Game Input for Apple TV JJ Cwik Software Engineer. tvOS 10 What’s New Apps may require an MFi game controller Support for up to

Managing controllerUserInteractionEnabledMenu Button

Splash Screen In-Game

Main MenuIn-Game

Submenus

falsetrue

controllerUserInteractionEnabled:

Gameplay

false

Home Screen

true

Pause Screen

false

Page 56: Controlling Game Input for Apple TV · Controlling Game Input for Apple TV JJ Cwik Software Engineer. tvOS 10 What’s New Apps may require an MFi game controller Support for up to

Menu Button

Pause handler

public var controllerPausedHandler: ((GCController) -> Void)?

Called when Menu button pressed

Page 57: Controlling Game Input for Apple TV · Controlling Game Input for Apple TV JJ Cwik Software Engineer. tvOS 10 What’s New Apps may require an MFi game controller Support for up to

Menu Button

Pause handler

public var controllerPausedHandler: ((GCController) -> Void)?

Called when Menu button pressed• In submenus: Go back to previous menu• In gameplay: Toggle pause state

Page 58: Controlling Game Input for Apple TV · Controlling Game Input for Apple TV JJ Cwik Software Engineer. tvOS 10 What’s New Apps may require an MFi game controller Support for up to

MFi Game Controller

Page 59: Controlling Game Input for Apple TV · Controlling Game Input for Apple TV JJ Cwik Software Engineer. tvOS 10 What’s New Apps may require an MFi game controller Support for up to

Optional accessoryMFi Game Controller

Wireless extended gamepad• DPAD• ABXY• 2 thumbsticks• 2 shoulders• 2 triggers• Menu• Player indicator LEDs

Page 60: Controlling Game Input for Apple TV · Controlling Game Input for Apple TV JJ Cwik Software Engineer. tvOS 10 What’s New Apps may require an MFi game controller Support for up to

GCExtendedGamepad profileMFi Game Controller

Property Type

dpadGCControllerDirectionPadleftThumbstick

rightThumbstick

buttonA buttonB buttonX buttonY

GCControllerButtonInputleftShoulder

rightShoulderleftTrigger

rightTrigger

Page 61: Controlling Game Input for Apple TV · Controlling Game Input for Apple TV JJ Cwik Software Engineer. tvOS 10 What’s New Apps may require an MFi game controller Support for up to

Pressure-sensitiveMFi Game Controller

Polling

let digital = controller.extendedGamepad?.buttonA.isPressed // Bool

let analog = controller.extendedGamepad?.buttonA.value // Float, 0.0 to 1.0

Page 62: Controlling Game Input for Apple TV · Controlling Game Input for Apple TV JJ Cwik Software Engineer. tvOS 10 What’s New Apps may require an MFi game controller Support for up to

Pressure-sensitiveMFi Game Controller

Polling

let digital = controller.extendedGamepad?.buttonA.isPressed // Bool

let analog = controller.extendedGamepad?.buttonA.value // Float, 0.0 to 1.0

Event callbacks

controller.extendedGamepad?.buttonA.pressedChangedHandler = myButtonAHandler // digital

controller.extendedGamepad?.buttonA.valueChangedHandler = myButtonAHandler // analog

Page 63: Controlling Game Input for Apple TV · Controlling Game Input for Apple TV JJ Cwik Software Engineer. tvOS 10 What’s New Apps may require an MFi game controller Support for up to

tvOSSupported Controller Types

Siri Remote

Page 64: Controlling Game Input for Apple TV · Controlling Game Input for Apple TV JJ Cwik Software Engineer. tvOS 10 What’s New Apps may require an MFi game controller Support for up to

tvOSSupported Controller Types

Siri RemoteSiri Remote and MFi game controllers

Page 65: Controlling Game Input for Apple TV · Controlling Game Input for Apple TV JJ Cwik Software Engineer. tvOS 10 What’s New Apps may require an MFi game controller Support for up to

tvOSSupported Controller Types

Siri RemoteSiri Remote and MFi game controllersMFi game controllers

NEW

Page 66: Controlling Game Input for Apple TV · Controlling Game Input for Apple TV JJ Cwik Software Engineer. tvOS 10 What’s New Apps may require an MFi game controller Support for up to

tvOSSupported Controller Types

Specify in Game Controllers capability in XcodeAutomatically updates Info.plistNeeded for App Review

Page 67: Controlling Game Input for Apple TV · Controlling Game Input for Apple TV JJ Cwik Software Engineer. tvOS 10 What’s New Apps may require an MFi game controller Support for up to

tvOSSupported Controller Types

App Store• Badging• May warn if MFi game controller

has not been paired

Page 68: Controlling Game Input for Apple TV · Controlling Game Input for Apple TV JJ Cwik Software Engineer. tvOS 10 What’s New Apps may require an MFi game controller Support for up to

Design considerationsRequiring MFi Game Controllers

Game may launch with no game controllers connected

NEW

Page 69: Controlling Game Input for Apple TV · Controlling Game Input for Apple TV JJ Cwik Software Engineer. tvOS 10 What’s New Apps may require an MFi game controller Support for up to

Design considerationsRequiring MFi Game Controllers

Game may launch with no game controllers connectedProvide feedback to player to connect a game controller

NEW

Page 70: Controlling Game Input for Apple TV · Controlling Game Input for Apple TV JJ Cwik Software Engineer. tvOS 10 What’s New Apps may require an MFi game controller Support for up to

Design considerationsRequiring MFi Game Controllers

Game may launch with no game controllers connectedProvide feedback to player to connect a game controllerGracefully handle game controllers that disconnect

NEW

Page 71: Controlling Game Input for Apple TV · Controlling Game Input for Apple TV JJ Cwik Software Engineer. tvOS 10 What’s New Apps may require an MFi game controller Support for up to

Design considerationsRequiring MFi Game Controllers

Game may launch with no game controllers connectedProvide feedback to player to connect a game controllerGracefully handle game controllers that disconnectSee “Designing for tvOS” (session 802)

NEW

Page 72: Controlling Game Input for Apple TV · Controlling Game Input for Apple TV JJ Cwik Software Engineer. tvOS 10 What’s New Apps may require an MFi game controller Support for up to

Apple TV Remote App NEW

Page 73: Controlling Game Input for Apple TV · Controlling Game Input for Apple TV JJ Cwik Software Engineer. tvOS 10 What’s New Apps may require an MFi game controller Support for up to

GCMicroGamepad, GCMotionApple TV Remote App NEW

Page 74: Controlling Game Input for Apple TV · Controlling Game Input for Apple TV JJ Cwik Software Engineer. tvOS 10 What’s New Apps may require an MFi game controller Support for up to

CoalescingApple TV Remote App NEW

controllers[0]

controllers[n]

controllers[1]

Siri Remote

Apple TV Remote app

Page 75: Controlling Game Input for Apple TV · Controlling Game Input for Apple TV JJ Cwik Software Engineer. tvOS 10 What’s New Apps may require an MFi game controller Support for up to

CoalescingApple TV Remote App NEW

controllers[0]

controllers[n]

controllers[1]

Siri Remote

Apple TV Remote app

Page 76: Controlling Game Input for Apple TV · Controlling Game Input for Apple TV JJ Cwik Software Engineer. tvOS 10 What’s New Apps may require an MFi game controller Support for up to

Separate remotesApple TV Remote App NEW

controllers[0]

controllers[n]

controllers[1]

Siri Remote

Apple TV Remote app

Page 77: Controlling Game Input for Apple TV · Controlling Game Input for Apple TV JJ Cwik Software Engineer. tvOS 10 What’s New Apps may require an MFi game controller Support for up to

Separate remotesApple TV Remote App NEW

Opt-in to separate Siri Remote and Apple TV Remote appGCSupportsMultipleMicroGamepads YES in Info.plist

controllers[0]

controllers[n]

controllers[1]

Siri Remote

Apple TV Remote app

Page 78: Controlling Game Input for Apple TV · Controlling Game Input for Apple TV JJ Cwik Software Engineer. tvOS 10 What’s New Apps may require an MFi game controller Support for up to

Design considerationsApple TV Remote App

Game Controller mode is in landscape

NEW

Game Controller mode is in landscape

Page 79: Controlling Game Input for Apple TV · Controlling Game Input for Apple TV JJ Cwik Software Engineer. tvOS 10 What’s New Apps may require an MFi game controller Support for up to

Design considerationsApple TV Remote App

Game Controller mode is in landscape

NEW

Game Controller mode is in landscapeDpad values automatically rotated 90 degrees

Page 80: Controlling Game Input for Apple TV · Controlling Game Input for Apple TV JJ Cwik Software Engineer. tvOS 10 What’s New Apps may require an MFi game controller Support for up to

Design considerationsApple TV Remote App

Game Controller mode is in landscape

NEW

Game Controller mode is in landscapeDpad values automatically rotated 90 degreesDon’t rotate dpad values in-game, instead set allowsRotation = true

Page 81: Controlling Game Input for Apple TV · Controlling Game Input for Apple TV JJ Cwik Software Engineer. tvOS 10 What’s New Apps may require an MFi game controller Support for up to

Design considerationsApple TV Remote App

Game Controller mode separates ‘A’ Button from touchpad surface

NEW

Touchpad ‘A’ Button

Page 82: Controlling Game Input for Apple TV · Controlling Game Input for Apple TV JJ Cwik Software Engineer. tvOS 10 What’s New Apps may require an MFi game controller Support for up to

Design considerationsApple TV Remote App

Game Controller mode separates ‘A’ Button from touchpad surfaceCan still simultaneously use both

NEW

Touchpad ‘A’ Button

Page 83: Controlling Game Input for Apple TV · Controlling Game Input for Apple TV JJ Cwik Software Engineer. tvOS 10 What’s New Apps may require an MFi game controller Support for up to

Design considerationsApple TV Remote App

Game Controller mode separates ‘A’ Button from touchpad surfaceCan still simultaneously use both‘A’ Button presses don’t implicitly provide touchpad DPAD values

NEW

Touchpad ‘A’ Button

Page 84: Controlling Game Input for Apple TV · Controlling Game Input for Apple TV JJ Cwik Software Engineer. tvOS 10 What’s New Apps may require an MFi game controller Support for up to

Multiple Controllers

Page 85: Controlling Game Input for Apple TV · Controlling Game Input for Apple TV JJ Cwik Software Engineer. tvOS 10 What’s New Apps may require an MFi game controller Support for up to

Multiple Controllers

One Siri RemoteUp to four MFi game controllersApple TV Remote app

NEW

Page 86: Controlling Game Input for Apple TV · Controlling Game Input for Apple TV JJ Cwik Software Engineer. tvOS 10 What’s New Apps may require an MFi game controller Support for up to

Single-player game

Page 87: Controlling Game Input for Apple TV · Controlling Game Input for Apple TV JJ Cwik Software Engineer. tvOS 10 What’s New Apps may require an MFi game controller Support for up to

Single-player game

Page 88: Controlling Game Input for Apple TV · Controlling Game Input for Apple TV JJ Cwik Software Engineer. tvOS 10 What’s New Apps may require an MFi game controller Support for up to

Single-player game

Page 89: Controlling Game Input for Apple TV · Controlling Game Input for Apple TV JJ Cwik Software Engineer. tvOS 10 What’s New Apps may require an MFi game controller Support for up to

Single-player game

Page 90: Controlling Game Input for Apple TV · Controlling Game Input for Apple TV JJ Cwik Software Engineer. tvOS 10 What’s New Apps may require an MFi game controller Support for up to

Single-player best practicesMultiple Controllers

Allow user to seamlessly switch to a different controller

Page 91: Controlling Game Input for Apple TV · Controlling Game Input for Apple TV JJ Cwik Software Engineer. tvOS 10 What’s New Apps may require an MFi game controller Support for up to

Single-player best practicesMultiple Controllers

Allow user to seamlessly switch to a different controllerTreat intentional input (buttons, DPAD, thumbsticks, touch surface) as user intent

Page 92: Controlling Game Input for Apple TV · Controlling Game Input for Apple TV JJ Cwik Software Engineer. tvOS 10 What’s New Apps may require an MFi game controller Support for up to

Single-player best practicesMultiple Controllers

Allow user to seamlessly switch to a different controllerTreat intentional input (buttons, DPAD, thumbsticks, touch surface) as user intentTake motion from the last controller to register intentional input

Page 93: Controlling Game Input for Apple TV · Controlling Game Input for Apple TV JJ Cwik Software Engineer. tvOS 10 What’s New Apps may require an MFi game controller Support for up to

Summary

Siri RemoteMenu buttonMFi game controllersApple TV Remote appMultiple controllers

Page 94: Controlling Game Input for Apple TV · Controlling Game Input for Apple TV JJ Cwik Software Engineer. tvOS 10 What’s New Apps may require an MFi game controller Support for up to

More Information

https://developer.apple.com/wwdc16/607

Page 95: Controlling Game Input for Apple TV · Controlling Game Input for Apple TV JJ Cwik Software Engineer. tvOS 10 What’s New Apps may require an MFi game controller Support for up to

Related Sessions

Mastering UIKit on tvOS Presidio Wednesday 10:00AM

Designing for tvOS Presidio Tuesday 4:00PM

Page 96: Controlling Game Input for Apple TV · Controlling Game Input for Apple TV JJ Cwik Software Engineer. tvOS 10 What’s New Apps may require an MFi game controller Support for up to

Labs

Game Controllers Lab Graphics, Games, and Media Lab A Thursday 9:00AM

tvOS Lab Frameworks Lab D Thursday 9:00AM

Page 97: Controlling Game Input for Apple TV · Controlling Game Input for Apple TV JJ Cwik Software Engineer. tvOS 10 What’s New Apps may require an MFi game controller Support for up to