Scrolling content but not background

Nibbie
Posts: 1
Joined: 2009.06
Post: #1
Hi

I need some advice from you guys about the following problem:
I'm using cocos2d. I've created a view, to which I attached the "Director" and created a "Scene" in (cocos2d's classes). I need to enable scrolling the view's content, so I've placed the view in a UIScrollView. So far so good.

The problem is I also need a background image which the UIScrollView wouldn't scroll. I need the UIScrollView to scroll anything but the background image.

The straight forward solution is to create the background in a different view behind the scroll view, but I couldn't make all the elements in front of the background (UIScrollView, UIView, Scene) transparent so the background image will be seen.
I've also tried to place the background image inside the scrolling view, and manually keep the background image in place by moving it (according to the UIScrollView contentOffset) while the UIScrollView scrolls (implemented the scrollViewDidScroll method of the UIScrollViewDelegate), but it doesn't manage to change its position fast enough, so the background image heavily flickers while scrolling.

I really don't know what to do. Do I have to implement scrolling myself without the UIScrollView?

Any advice???

thanks!
Quote this message in a reply
Nibbie
Posts: 4
Joined: 2009.06
Post: #2
omriykl Wrote:Hi

I need some advice from you guys about the following problem:
I'm using cocos2d. I've created a view, to which I attached the "Director" and created a "Scene" in (cocos2d's classes). I need to enable scrolling the view's content, so I've placed the view in a UIScrollView. So far so good.

The problem is I also need a background image which the UIScrollView wouldn't scroll. I need the UIScrollView to scroll anything but the background image.

The straight forward solution is to create the background in a different view behind the scroll view, but I couldn't make all the elements in front of the background (UIScrollView, UIView, Scene) transparent so the background image will be seen.
I've also tried to place the background image inside the scrolling view, and manually keep the background image in place by moving it (according to the UIScrollView contentOffset) while the UIScrollView scrolls (implemented the scrollViewDidScroll method of the UIScrollViewDelegate), but it doesn't manage to change its position fast enough, so the background image heavily flickers while scrolling.

I really don't know what to do. Do I have to implement scrolling myself without the UIScrollView?

Any advice???

thanks!

I don't think that's possible (am I wrong?)
I think you have to implement your own scrolling for that. Has anyone here done something like that and can share some info with us?
Quote this message in a reply
Post Reply