iOS splash screens not scaling?

GuyCockcroft

  • *
  • Posts: 193
Is anybody else having trouble with their iOS splash screens not scaling properly? I'm using the stretch to fit mode (only for the splash screen), but it seems to scale the image, keeping the ratio the same.
The template that Stencyl generates for iPhone is in the 19.5:9 ratio of the iPhoneX, so I need it to squash down for other phone screens. Not ideal, but it will be ok for a splash screen that only appears very briefly. At the moment, though, it doesn't stretch the image as it should. (This is for a portrait orientation game - not sure if this is the case in landscape).

It also seems to have a habit of keeping the old image in the build, even though you specify a new one in the editor, and sometimes even displays two splash screens one after the other when in-game! Could be related?

Justin

  • *
  • Posts: 4441
For the first problem, could you either send me the image you're using as well as the relevant game settings (screen size, splash screen scale mode, orientation, etc), or send me the game itself?



Regarding the old splash screen still being present, it seems to be some issue with the device caching the image (so it doesn't need to scale the image again next time you open your game).

https://stackoverflow.com/questions/33002829/ios-keeping-old-launch-screen-and-app-icon-after-update/33003622

The displaying of two images in a row is because iOS displays one (the cached one), and then hands control over to the app. One of our third-party libraries, SDL, then re-displays the same image (but without a cache), so it should always be the correct image. Finally, control is handed over to OpenFL/Stencyl, and the second launch image is removed.

Depending on how quickly each of these stages is loaded, you may not even see one or both of the launch screens. Both should be identical, but because of iOS not updating its cache, the first one may be an old image.

I've seen conflicting reports about whether this does or doesn't affect end-users who download your app, but there may be something we can do to prevent it from happening.
For Live Support: Join our discord server and ping me @justin.
I'm most often available between 10am and 10pm Japan time. (GMT+9)

GuyCockcroft

  • *
  • Posts: 193
Thanks for the reply, Justin. I can't send the game I'm afraid, but I can tell you that this happens with the template images generated by Stencyl.
My game is portrait mode, using the Scale to Fit (Full Screen) scaling mode. None of the splash screen scaling modes appear to work for me.

With the 'Stretch to Fit' mode selected in the splash screen options, I get the result shown in the attached image. It looks to me that the width of the splash screen template image has been stretched to 1920 pixels, but it hasn't been stretched vertically. (This is just a guess, based on me comparing the resulting image with the original).

Thanks for the info about cached images, I had a feeling it was something like that. Hopefully this shouldn't affect other users then, but I'll send the build out for people to test.

Thanks again.

« Last Edit: May 24, 2019, 11:24:50 am by GuyCockcroft »

Justin

  • *
  • Posts: 4441
It looks like the launch storyboard isn't being resized appropriately.

Open this file
Code: [Select]
[Stencyl install]/plaf/haxe/lib/lime/lime/templates/ios/storyboards/splash.storyboard

Search for this text
Code: [Select]
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
(the autoresizingMask element appears twice, it should be the second one)

And replace it with this
Code: [Select]
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>


You're done. Try testing again and see if it works better.
For Live Support: Join our discord server and ping me @justin.
I'm most often available between 10am and 10pm Japan time. (GMT+9)

GuyCockcroft

  • *
  • Posts: 193
Thanks, Justin - that's fixed it!

Worth also mentioning( to anybody else having the same trouble) that to get rid of the double splash screen problem, you just have to delete the app from the device, re-boot it, and install the game again. Sorted!

Thanks again

Justin

  • *
  • Posts: 4441
Thanks. I've added that change to Stencyl in b10344.
For Live Support: Join our discord server and ping me @justin.
I'm most often available between 10am and 10pm Japan time. (GMT+9)