Post

Replies

Boosts

Views

Activity

Apple TV won’t connect to my external surround sound speakers
I know that this is not a coding question and I have posted on the regular Apple Forum and have been working with the 800 Tech Support folk for 4 months. I am in a world of hurt. Have ATV + Samsung TV + external soundbar. All software versions are current NO Cable box (direct input). 4 months ago I had Cable box = zero problems. With Samsung on and ATV off, stereo = Dolby 5.1 sounds great. With ATV also on, no stereo. I can use Siri remote to activate stereo until I change to a new movie. ATV then reverts to mono = PCM One Tech Support lady said to just not watch multiple movie. ?$@!*+^? I have spoken with engineers at Samsung and Sonos (soundbar). Both say my cabling is correct = 1 cable from soundbar to HDMI Arc on TV + 1 cable from ATV to another HDMI port on TV. Another Tech Support folk said to connect ATV to soundbar. Soundbars don’t have gobs of HDMI ports, the TV does. ?!$@*^+%# I have spoken with Apple Tech Support with zero help for 3-4 months. I think I have been a good soldier. But it is time for real results. Please help
1
0
1.3k
Apr ’24
Calling SKAction.follow(..) causes my SKSpriteNode to rotate 90 degrees CW and not stay horizontal as it follows my UIBezierPath?
Calling SKAction.follow(..) causes my SKSpriteNode to rotate 90 degrees CW and not stay horizontal as it follows my UIBezierPath? I have this code (within my GameViewController Class) which implements the following of a SKSpriteNode along a UIBezierPath. ===== Please note that a brilliant contributor solved the above challenge by creating a new Class, e.g., class NewClass: NSObject. Nevertheless, I need the solution to appear in an extension of my GameViewController ===== func createTrainPath() { trackRect = CGRect(x: tracksPosX - tracksWidth/2, y: tracksPosY, width: tracksWidth, height: tracksHeight) trainPath = UIBezierPath(ovalIn: trackRect) } // createTrainPath func startFollowTrainPath() { var trainAction = SKAction.follow( trainPath.cgPath, asOffset: false, orientToPath: true, speed: theSpeed) trainAction = SKAction.repeatForever(trainAction) myTrain.run(trainAction, withKey: runTrainKey) } // startFollowTrainPath func stopFollowTrainPath() { guard myTrain == nil else { myTrain.removeAction(forKey: runTrainKey) savedTrainPosition = getPositionFor(myTrain, orPath: trainPath) return } } // stopFollowTrainPath
2
0
1.3k
Jul ’24
How to ensure current SKScene has fully loaded before engaging it with the GamePad Controller?
How to ensure current SKScene has fully loaded before engaging it with the GamePad Controller? The problem is this = when stopping sound is involved when I do switch SKScenes, if I press the buttons of the GamePad Controller (which cycle thru these other SKScenes) too fast, the movement of the Game Pieces fails to resume when I return to the Game Scene after the above cycling. This problem occurs only with the os(tvOS) version, but not with the iPad version. And the reason for this distinction is that each SKScene for the iPad has to fully load due to the fact that the button I press to switch SKScenes is at the top-left corner of the iPad -- so, by definition, by the time I have access to this button, the current SKScene has fully loaded. By definition, there is no such button for os(tvOS). Given this button’s absence, I believe I need the Swift version of jQuery’s $(document).ready (function() {. Any help will be appreciated to the rafters ...
2
0
845
Jul ’24
How do I correctly show a PDF document?
How do I correctly show a PDF document? iPad and Xcode 15.4 Within my GameViewController, I have: func presentScene(_ theScene: SKScene) { theScene.scaleMode = .resizeFill if let skView = self.view as? SKView { skView.ignoresSiblingOrder = true skView.showsFPS = true skView.showsNodeCount = true #if os(iOS) let theTransition = SKTransition.doorway(withDuration: 2.0) skView.presentScene(theScene, transition: theTransition) #elseif os(tvOS) skView.presentScene(theScene) #endif } } // presentScene I believe presentScene(theScene) goes to the sceneDidLoad() func of theScene which adds various SKSpriteNodes to the scene via a call to addChild(theNode). So far so good ... Until I have a SKScene wherein I wish to display a PDF. I use this snippet to display this PDF with this call within the SKScene's sceneDisLoad(): displayPDF("ABOUT_OLD_WEST_LOCOMOTIVE") func displayPDF(_ itsName:String) { let pdfView = PDFView() guard let path = Bundle.main.path(forResource: itsName, ofType: "pdf") else { return } print("path") guard let pdfDocument = PDFDocument(url: URL(fileURLWithPath: path)) else { return } print("pdfDocument") pdfView.displayMode = .singlePageContinuous pdfView.autoScales = true pdfView.displayDirection = .vertical pdfView.document = pdfDocument } // displayPDF The 2 print statements show, yet the SKScene does not display the PDF via pdfView.document = pdfDocument? Anyone have a clue what errors I have committed? Appreciate it.
4
0
956
Jul ’24
How do I stop a node as it is moving around a UIBezierPath and then restart the moving from where it stopped?
I have an oval UIBezierPath with a moving SKSpriteNode, I stop its motion and record the stopped position. I then restart this motion and want it to restart where it initially stopped. Works great if motion is not stopped. Movement is great around entire oval Path. Also works great as long as this stop-restart sequence occurs along the top half of the oval UIBezierPath. However, I have problems along the bottom half of this Path -- it stops okay, but the restart position is not where it previously stopped. My method to create this oval UIBezierePath is as follows: func createTrainPath() { trainRect = CGRect(x: tracksPosX - tracksWidth/2, y: tracksPosY - tracksHeight/2, width: tracksWidth, height: tracksHeight) // these methods come from @DonMag trainPoints = generatePoints(inRect: trainRect, withNumberOfPoints: nbrPathPoints) trainPath = generatePathFromPoints(trainPoints!, startingAtIDX: savedTrainIndex) } // createTrainPath My method to stop this motion is as follows: func stopFollowTrainPath() { guard (myTrain != nil) else { return } myTrain.isPaused = true savedTrainPosition = myTrain.position // also from @DonMag savedTrainIndex = closestIndexInPath( trainPath, toPoint: savedTrainPosition) ?? 0 } // stopFollowTrainPath Finally, I call this to re-start this motion: func startFollowTrainPath() { var trainAction = SKAction.follow(trainPath.cgPath, asOffset: false, orientToPath: true, speed: thisSpeed) trainAction = SKAction.repeatForever(trainAction) myTrain.run(trainAction, withKey: runTrainKey) myTrain.isPaused = false } // startFollowTrainPath Again, great if motion is not stopped. Movement is great around entire oval Path. Again, no problem for stopping and then restarting along top half of oval .. the ohoh occurs along bottom half. Is there something I need to do within GameScene's update method that I am missing? For example, do I need to reconstruct my UIBezierPath? every time my node moves between the top half and the bottom half and therein account for the fact that the node is traveling in the opposite direction from the top half?
2
0
863
Nov ’24
PlaySound below crashes with this error: AddInstanceForFactory: No factory registered for id
Problem = PlaySound below crashes with this error: AddInstanceForFactory: No factory registered for id Setting a breakpoint before the guard let url block = NO error. Setting a breakpoint after the guard let url block = error!!, coupled with a horrible static sound happening. Note that if I set NO breakpoints, the correct sound happens but with the above error. What am I missing? Within my SKScene Class: func controllerInputDetected(gamepad: GCExtendedGamepad, element: GCControllerElement, index: Int) { // rightShoulder if (gamepad.rightShoulder == element) { if (gamepad.rightShoulder.value != 0) { startGame() } } } As shown above, I call the following function by pressing a shoulder button on my Gamepad: func startGame() { PlaySound(theSoundName: "roar") } func PlaySound(theSoundName: String) { guard let url = Bundle.main.url(forResource: "audio/" + theSoundName, withExtension: "mp3") else { print("sound not found") return } do { try AVAudioSession.sharedInstance().setCategory(.playback, mode: .default) try AVAudioSession.sharedInstance().setActive(true) itsSoundPlayer = try AVAudioPlayer(contentsOf: url) if theSoundName == "roar" { itsSoundPlayer?.numberOfLoops = -1 // forever } itsSoundPlayer!.play() } catch let error as NSError { print("error: \(error.localizedDescription)") } } Again, what am I missing?
1
0
967
Jan ’23
Cannot add a iOS Distribution Certificate to my Project or Target?
Cannot add a iOS Distribution Certificate to my Project or Target? During the Submission for Review process, it states I should choose a Build (for Distribution) and I need to do the above add before I can do that. Here is a screen shot of my Certificates set in my Developer Account: Here is the screen shot when I double-click on the iOS Distribution Certificate above: Here is a screen shot of that Certificate in the Finder: Yet in spite of all the above evidence, here is a screen shot of my Target for both my iOS and tvOS Project: So, please provide some hints because this is the only step left before I finally submit my App to the App store.
3
0
2.4k
Feb ’23
How can I make my Game App appear under Games in the App Store and not under Apps?
The reason I ask centers on the fact that my "Monster Paddle Pong" has been uploaded to the App Store - and it works! BTW: Search within Apps - not Games! Within Xcode I selected App Category = Games and the above search agrees with that. My question = how can I in the future make my Game appear under Games in the App Store and not under Apps?
1
0
651
Feb ’23
With Xcode 14.2, I unpaired my apple tv and now the apple tv does not show
With Xcode 14.2, had trouble pairing with my Apple TV (latest update). It continuously showed "Not Connected". So, I unpaired my apple tv and now the ATV does not show under Devices and Simulators. My ATV shows as the Target of my Xcode Project My Ventura 13.3 iMac mirrors to my ATV just great, but not my Xcode 14.2. Have turned off my ATV, quit Xcode and Shutdown and then re-started my iMac and no luck. Help desperately needed. Other posts seem to show an identical problem experienced by others.
1
0
937
Apr ’23
How do I resize a new image to an existing Sprite?
I have multiple images that at various times I need to replace a target image for a SKSpriteNode. Each of these multiple images has a different size. The target SKSpriteNode has a fixed frame that I want to stay fixed. This target is created via: myTarget = SKSpriteNode(imageNamed: “target”) myTarget.size = CGSize(…) myTarget.physicsBody = SKPhysicsBody(rectangleOf: myTarget.size) How do I resize each of the multiple images so that each fills up the target frame (expand or contract)? Pretend the target is a shoebox and each image is a balloon that expands or contracts to fill the shoebox. I have tried the following that fails, that is, it changes the size of the target to fit the new image .. in short, it does the exact opposite of what I want. let newTexture = SKTexture(imageNamed: newImage) let changeImgAction = SKAction.setTexture(newTexture, resize: true) myTarget.run(changeImgAction) Again, keep frame of myTarget fixed and change size of newTexture to fit the above frame ..
1
0
1k
May ’24