I am trying to find a “simple” way to have a scrollable vertical list for my SpriteKit game.
I am going to use it to implement a store / update part of my game, so I would like the user to scroll down the list to see the various updates that are possible.
I've seen quite a few posts about integrating UIScrollView into SpriteKit, but most of them seem to scroll the entire screen.
What I still have:
-(void) createSceneContents
{
[super createSceneContents];
_scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(10,100, 250, 200)];
_scrollView.contentSize = CGSizeMake(2000, 120);
_scrollView.scrollEnabled = YES;
_scrollView.showsHorizontalScrollIndicator = YES;
_scrollView.backgroundColor = [UIColor brownColor];
[self.view addSubview:_scrollView];
SKSpriteNode *greenTestSprite = [SKSpriteNode spriteNodeWithColor:[SKColor greenColor]
size:CGSizeMake(25, 25)];
[greenTestSprite setName:@"greenTestSprite"];
greenTestSprite.position = CGPointMake(25, 125);
[self addChild:greenTestSprite];
}
I'm trying to think that the easiest way for me is to add a green test sprite to this UIScrollView. can't tear myself away from the way other people did it, as they seem to connect the scroll of the UIScrollView to the SKView so that the screen looks like a scroll.
, , - .
.
.