I am trying to make small iOs game. The user will be presented with a scene that is larger that the screen size of the device. I believe the correct way to handle this is to create the scene and place it inside a scroll view, so the user can scroll to see the entire scene (maybe even scroll in and out to see more detail). However I have been unsuccessful at this.. this is the code:
- (void)viewWillLayoutSubviews
{
// Configure the view.
SKView * skView = (SKView *)self.view;
if (!skView.scene) {
skView.showsFPS = YES;
skView.showsNodeCount = YES;
// Create and configure the scene.
// the size will eventually come from the levels file
SKScene * scene = [[PSMainGameScene alloc] initWithSize:skView.bounds.size andLevel:0];
scene.scaleMode = SKSceneScaleModeAspectFill;
// TODO Add ambiental music
// Present the scene.
[skView presentScene:scene];
}
}
This seems to add the scene and I am able to scroll but scene has no sprites, even thou the skview should draw them (in the corner, after scrolling I am able to see the frame rate 11fps(why is this so small), and 0 sprites)when added outside of a scrollview the sprites are visible).
I would also like to add a HUD : several buttons that will hover in the same place no matter where the user scrolls/zooms ... I have seen an example without the scroll view where thouchesDidMove was used to scroll the SKView , I don't think this is the way to go... Does anyone know the best way to get this done? Or why is my code not working? Thanks