Hello, I'm struggling with moving the view of my UIScrollView programmatically (showing different regions inside the UIScrollView).
To make it simple:
1x UIScrollView
2x UIImageView (a gamefield) & (a playerunit).
So i set up my gamefield in the UIScrollView (this is bigger than the visible region of the UIScrollView, so i can pan and zoom etc)
And i set up my player unit in the UIScrollview, above the gamefield.
so now to the problem. When my playerUnit goes outside the bounds of my UIScrollView the camera doesn't move, and this is frankly ok, i just pan to where it is.
But, when i pan around the map, i don't want to go and search for my playerUnit, and I've therefore put a IBAction set up to a UIButton.
I want this IBAction to place the "camera" (view region of my UIscrollview) to have my PlayerUnit centered.
Thankful for all responses!
To make it simple:
1x UIScrollView
2x UIImageView (a gamefield) & (a playerunit).
So i set up my gamefield in the UIScrollView (this is bigger than the visible region of the UIScrollView, so i can pan and zoom etc)
And i set up my player unit in the UIScrollview, above the gamefield.
so now to the problem. When my playerUnit goes outside the bounds of my UIScrollView the camera doesn't move, and this is frankly ok, i just pan to where it is.
But, when i pan around the map, i don't want to go and search for my playerUnit, and I've therefore put a IBAction set up to a UIButton.
I want this IBAction to place the "camera" (view region of my UIscrollview) to have my PlayerUnit centered.
Thankful for all responses!