我正在为tvOS扩展我的iOS游戏。大多数游戏控件由touchesBegan
,touchesMoved
和touchesEnded
处理。我的所有选择按钮都按以下方式处理:
if button1.contains(location){
let gameplayScene = GamePlayScene(size: self.size)
self.view?.presentScene(gameplayScene)
}
if button2.contains(location){
let settingsScene = SettingsScene(size: self.size)
self.view?.presentScene(settingsScene)
}
if button3.contains(location){
let helpScene = HelpScene(size: self.size)
self.view?.presentScene(helpScene)
}
以下图片:
如何使用AppleTV遥控器适当地突出显示并选择tvOS中的每个按钮?