iPhone app on iPad: First screen does not adapt to iPad - ios

I´ve tried running my iOS (for iPhone) game built with cocos2d on an iPad and almost everything works just fine, except the first screen to display where the UI elements is all over the place.
However, if I switch to another View (or Scene in Cocos2d) everything looks great and if I switch back to the previously messed up screen, it also looks normal.
So, the first screen to load when running on the iPad will look messed up and I have no idea what´s causing this.
Any ideas?

This generally happens when you inherit your scene class from CCNode. Change the parent class of your scene to CCScene.

Related

Blank screen after Launch.storyboard in Apple SceneKit game - really annoying bug

So the main problem is a blank screen after Launch.storyboard finishes.
But from the beginning: I wanted to use fullscreen in my game. When I checked "Requires full screen" AND "Launch Screen File" was left empty like on the image,
... the app runs without launch screen (as expected), but I get a scene which is NOT playing as fullscreen, like on the image below, (the status bar is visible, there are also two black bars on either side). In the GameViewController I have: override var prefersStatusBarHidden: Bool { return true },
In info.plist I have:
No matter what I do I do not get full screen without visible status bar.
Now, I change to this:
And... Launch.storyboard shows itself (it has only text, not any large pictures), after this nothing happens, there is only blank screen without any images. I can hear background music, I can even touch the screen and the game runs but I do not see anything. This happens on both my physical devices - iPhone SE 1-st and 2-nd gen. attached to my computer. Interestingly, when I press device's sound level buttons, up or down, .. voila, and I can see everything now, the game scene appears! (full screen without status bar, as I expected).
I tried everything: reinstall app, remove Xcode cache, reboot computer and device - nothing works, all the time blank screen with music. I checked on the simulators - on SE (2) and others everything works fine, the launch.storyboard loads, the game is visible from the beginning. On another physical device, iPhone 12 works fine, also on iPad Pro works fine, (but for a very short time the black screen appears). Maybe it has something with memory, but on the other hand SE 2-nd gen. is rather new device.
Do you have any ideas what could be wrong and how to fix this? I do not want to publish the app until I am 100% sure that it works on all devices without any issues.
Thank you ZAY, but I think I have found the answer after many attempts. When Xcode creates the default Game scene, it creates Main.storyboard that looks like this: .
What I did: instead of default SceneKit View, I added default View, like this:
Everything seems to work now. Do not know why, but it works.

Spritekit actions doesn't work on all devices

I have spritekit scene with element that has actions:
https://scr.hu/dXryae
https://scr.hu/Gw3Ra5
I'm loading this scene, get the Overlay element and put every child of it in main scene of game. Everything were working fine till I tried to add some more features to it. This "features" cause that actions doesn't works. But this is not my problem. I came back to working copy and now it works different on different devices.
Test devices:
Iphone 5 10.3.3 - actions works
Iphone 7 Plus 11.0.2 - actions doesn't work
I've noticed that when I go to home screen of iOS and come back to game actions starts working.
I thought that it can be some cache problem but probably I tried every method of cleaning it.
I have no errors/warnings in xcode or in console.
This is a longshot...but I had a similar issue with my GameScene in iOS11. However I was embedded in Messages so I am not sure it is the same issue, but I had the same symptoms. The Game Scene during the transition was getting paused automatically (but only in iOS11) after transitioning to the scene I ran myScene.isPaused = false and it fixed the issue, and had no adverse affects on iOS10

Different iPhone simulator sizes throwing nodes out of place

I built my game on the iPhone 6 simulator, and everything was going fine until I needed to switch screen sizes for screenshots. I switched from the 6 to the 5s and now everything is in the wrong place and very off center. How do I make my game suitable for all screen sizes with everything in its place? Will post code if necessary.
If you have hardcoded your view locations and sizes (as opposed to making everything relative to everything else) then you will either have to refactor to make everything relative or do some sort of scaling and letterboxing.

Iphone 6 game view dimension changing on device

I created a SpriteKit game and it works well except when I turn my Iphone 6 view mode to zoomed the game looks like zoomed too.
When I return to the standard mode everything goes back and looks just. I create the nodes in the right dimensions. Like it works on Iphone simulator.
I tried to change the scale mode in GameViewController and nothing changes, I still have the same problem.

When my ViewController runs, a gradient background is on my iPhone but it appears fine in the simulator

So I am running a simple ViewController in swift and it when I run it, on the simulator it looks fine but on my iPhone it doesn't.
Here is how the background looks like on the simulator(correctly)
"simulator"
and here is when I run it on the iPhone
"iPhone"
They are both just images that I uploaded (this includes the dividers, 'pounds', and 'repetitions' while the logo on top and button in the bottom are part of the window.
So because of this, I know the problem is in the background but I tried going setting by setting to compare them to other Views that do work and can't seem to find the answer. Anyone have any ideas?

Resources