How to select buttons in tvOS menu for SpriteKit game

家住魔仙堡 提交于 2019-12-22 07:59:54

问题


I am extending my iOS game for tvOS. Most of the game controls are handled by touchesBegan, touchesMoved and touchesEnded. All my select buttons are handled in the following way:

 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)
 }

for an image below:

How can I appropriately highlight and select each one of these buttons in tvOS using the AppleTV remote?

来源:https://stackoverflow.com/questions/41561494/how-to-select-buttons-in-tvos-menu-for-spritekit-game

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!