0

TL;DR: I have a SpriteKit game that looks great in 4' screens, need a quick fix (like using a scrollview to contain a SKScene) for 3.5' screens without coding everything again, thanks!

I currently finished a game I was working on SpriteKit and I'm planning to upload it to the AppStore, but here is the problem: I designed the game to work perfectly on 4 inch screen devices so in 3.5 it looks terrible and I'm afraid Apple will hand me the game back to correct this problem. Therefore I have considered the following options:

  1. Use a ScrollView to present the Scenes by using the following method:

`

SKView *skView = (SKView *)self.view;

// Create and configure the scene.
SKScene *scene = [BIMainMenu sceneWithSize:skView.bounds.size];
scene.scaleMode = SKSceneScaleModeAspectFill;
UIScrollView *scrollView = [[UIScrollView alloc]initWithFrame:self.view.bounds];
scrollView.contentSize = CGSizeMake(320, 568);

[scrollView addSubview:skView];
[self.view addSubview:scrollView]; //expection thrown here
// Present the scene.
[skView presentScene:scene];

`

But this method does not work, it throughs an exception when trying to add the scrollView to the view. Maybe I'm doing something wrong here?

2.Use conditionals in every single line of code to check the device size and setup the images correctly: This might be the way to go but I really hope there is another way since the main game area relies on the "board" being 568 pixels long and it might also mess up the game logic entirely. (Yes, maybe bad planning.

3.Use something along this answer: https://stackoverflow.com/a/19096256/2328918 But I think some of the setup might also mess up my code.

4.Also tried changing the scene's scaleMode but does not seem to work either.

Thank you for your suggestions and tips, I'm looking for the "short" answer in the sense that adding a Scrollview to the game will simply allow 3.5 users to "play" the game but not really tackle the problem but I would really like to ship this out as version 1.0 and then work on improving the experience for 3.5 screens.

Community
  • 1
  • 1
romsearcher
  • 340
  • 5
  • 19
  • What makes you think Apple won't hand you back a scrolling 3.5" version of your app? Especially if this feels awkward, out of place or otherwise looks or feels like a cheap fix to support 3.5" devices Apple might still reject the app on ground of the HID (human interface design guidelines). – CodeSmile Jul 18 '14 at 09:55

1 Answers1

-1

You cannot use UIScrollView with SKView in that way.

You can have hierarchy like this:

- UIScrollView
-- SKView
--- SKScene

but it's useless. How do you think, how touch event can be handled by both UIScrollView and SKView?

Andrey Gordeev
  • 30,606
  • 13
  • 135
  • 162
  • Yes, you are right, I guess the touch event would get confused: "is it for scrolling or for game logic?" But then how could I achieve fitting the scene for 3.5 screens? Or would it still be too complicate to both scroll and touch buttons? Thank you for your answer – romsearcher Jul 18 '14 at 02:01
  • I haven't had any problems with 3.5 screens. In the worst case you could just add black lines on top and bottom of the scene – Andrey Gordeev Jul 18 '14 at 03:07