How to select buttons in the tvOS menu for a SpriteKit game

I am expanding my iOS game for tvOS. Most game controls are processed touchesBegan, touchesMovedand touchesEnded. All my selection buttons are handled as follows:

 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 the image below:

enter image description here

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

+4
source share

Source: https://habr.com/ru/post/1666333/


All Articles