<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Cocos2D and UIScrollView</title>
	<atom:link href="http://getsetgames.com/2009/08/21/cocos2d-and-uiscrollview/feed/" rel="self" type="application/rss+xml" />
	<link>http://getsetgames.com/2009/08/21/cocos2d-and-uiscrollview/</link>
	<description></description>
	<lastBuildDate>Mon, 14 May 2012 23:43:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
	<item>
		<title>By: Sts2055</title>
		<link>http://getsetgames.com/2009/08/21/cocos2d-and-uiscrollview/comment-page-3/#comment-4522</link>
		<dc:creator>Sts2055</dc:creator>
		<pubDate>Sat, 25 Feb 2012 22:40:00 +0000</pubDate>
		<guid isPermaLink="false">http://getsetgames.com/?p=138#comment-4522</guid>
		<description>Formatting of the middle section got messed up:

in - (void)loadView in your UIViewController add: UIView *subView = [[UIView alloc] initWithFrame:CGRectMake(myLayer.position.x, myLayer.position.y, myLayer.contentSize.height, myLayer.contentSize.width)];        [self.view addSubview:subView ];


as well as:


yourScrollView.minimumZoomScale = 0.25;  // your own value


yourScrollView.maximumZoomScale = 1.0; // your own value


in your UIScrollView delegate implement:

- (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView{    return [[self subviews] objectAtIndex:0];}- (void)scrollViewDidEndZooming:(UIScrollView *)scrollView withView:(UIView *)view atScale:(float)scale {}- (void)scrollViewDidZoom:(UIScrollView *)scrollView{    CCLayer *targetLayer = [[[CCDirector sharedDirector]runningScene].children objectAtIndex:0 ];    targetLayer.scale = self.zoomScale;} </description>
		<content:encoded><![CDATA[<p>Formatting of the middle section got messed up:</p>
<p>in - (void)loadView in your UIViewController add: UIView *subView = [[UIView alloc] initWithFrame:CGRectMake(myLayer.position.x, myLayer.position.y, myLayer.contentSize.height, myLayer.contentSize.width)];        [self.view addSubview:subView ];</p>
<p>as well as:</p>
<p>yourScrollView.minimumZoomScale = 0.25;  // your own value</p>
<p>yourScrollView.maximumZoomScale = 1.0; // your own value</p>
<p>in your UIScrollView delegate implement:</p>
<p>- (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView{    return [[self subviews] objectAtIndex:0];}- (void)scrollViewDidEndZooming:(UIScrollView *)scrollView withView:(UIView *)view atScale:(float)scale {}- (void)scrollViewDidZoom:(UIScrollView *)scrollView{    CCLayer *targetLayer = [[[CCDirector sharedDirector]runningScene].children objectAtIndex:0 ];    targetLayer.scale = self.zoomScale;} </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sts2055</title>
		<link>http://getsetgames.com/2009/08/21/cocos2d-and-uiscrollview/comment-page-3/#comment-4523</link>
		<dc:creator>Sts2055</dc:creator>
		<pubDate>Sat, 25 Feb 2012 22:40:00 +0000</pubDate>
		<guid isPermaLink="false">http://getsetgames.com/?p=138#comment-4523</guid>
		<description>I give up :)</description>
		<content:encoded><![CDATA[<p>I give up <img src='http://getsetgames.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sts2055</title>
		<link>http://getsetgames.com/2009/08/21/cocos2d-and-uiscrollview/comment-page-3/#comment-4521</link>
		<dc:creator>Sts2055</dc:creator>
		<pubDate>Sat, 25 Feb 2012 22:37:00 +0000</pubDate>
		<guid isPermaLink="false">http://getsetgames.com/?p=138#comment-4521</guid>
		<description>I found a solution:


in - (void)loadView in your UIViewController add:

 UIView *subView = [[UIView alloc] initWithFrame:CGRectMake(myLayer.position.x, 
myLayer.position.y, 
myLayer.contentSize.height, myLayer.contentSize.width)];        [self.view addSubview:
subView ];as well as:yourScrollView.minimumZoomScale = 0.25;  // your own valueyourScrollView.maximumZoomScale = 1.0; // your own valuein your UIScrollView delegate implement:

- (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView{    return [[self subviews] objectAtIndex:0];}

- (void)scrollViewDidEndZooming:(UIScrollView *)scrollView withView:(UIView *)view atScale:(float)scale {}

- (void)scrollViewDidZoom:(UIScrollView *)scrollView{    CCLayer *targetLayer = [[[CCDirector sharedDirector]runningScene].children objectAtIndex:0 ];    targetLayer.scale = self.zoomScale;}





This will enable zooming of your layer, however, I still encounter a problem that when zooming, the scaled layer&#039;s position gets pushed to the top right outside of the pannable, zoomable view when zooming scale is lower than 1.0      Does anyone have a solution to this?</description>
		<content:encoded><![CDATA[<p>I found a solution:</p>
<p>in - (void)loadView in your UIViewController add:</p>
<p> UIView *subView = [[UIView alloc] initWithFrame:CGRectMake(myLayer.position.x, <br />
myLayer.position.y, <br />
myLayer.contentSize.height, myLayer.contentSize.width)];        [self.view addSubview:<br />
subView ];as well as:yourScrollView.minimumZoomScale = 0.25;  // your own valueyourScrollView.maximumZoomScale = 1.0; // your own valuein your UIScrollView delegate implement:</p>
<p>- (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView{    return [[self subviews] objectAtIndex:0];}</p>
<p>- (void)scrollViewDidEndZooming:(UIScrollView *)scrollView withView:(UIView *)view atScale:(float)scale {}</p>
<p>- (void)scrollViewDidZoom:(UIScrollView *)scrollView{    CCLayer *targetLayer = [[[CCDirector sharedDirector]runningScene].children objectAtIndex:0 ];    targetLayer.scale = self.zoomScale;}</p>
<p>This will enable zooming of your layer, however, I still encounter a problem that when zooming, the scaled layer&#8217;s position gets pushed to the top right outside of the pannable, zoomable view when zooming scale is lower than 1.0      Does anyone have a solution to this?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sts2055</title>
		<link>http://getsetgames.com/2009/08/21/cocos2d-and-uiscrollview/comment-page-3/#comment-4520</link>
		<dc:creator>Sts2055</dc:creator>
		<pubDate>Sat, 25 Feb 2012 08:35:00 +0000</pubDate>
		<guid isPermaLink="false">http://getsetgames.com/?p=138#comment-4520</guid>
		<description>I tried to implement this as well and got the following error message:


&quot;The view returned from viewForZoomingInScrollView: must be a subview of the scroll view. It can not be the scroll view itself.&quot;

What I gather from this is that if I want to use the scrollView to zoom a cocos2d layer, I would have to first:
- create a subview- then attach my layer to it
The scrollView should then zoom the subview and since the layer is statically bound to the subview, it will scale with it.

That&#039;s the idea at least....</description>
		<content:encoded><![CDATA[<p>I tried to implement this as well and got the following error message:</p>
<p>&#8220;The view returned from viewForZoomingInScrollView: must be a subview of the scroll view. It can not be the scroll view itself.&#8221;</p>
<p>What I gather from this is that if I want to use the scrollView to zoom a cocos2d layer, I would have to first:<br />
- create a subview- then attach my layer to it<br />
The scrollView should then zoom the subview and since the layer is statically bound to the subview, it will scale with it.</p>
<p>That&#8217;s the idea at least&#8230;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Arshad</title>
		<link>http://getsetgames.com/2009/08/21/cocos2d-and-uiscrollview/comment-page-3/#comment-4324</link>
		<dc:creator>Arshad</dc:creator>
		<pubDate>Sat, 03 Dec 2011 11:52:00 +0000</pubDate>
		<guid isPermaLink="false">http://getsetgames.com/?p=138#comment-4324</guid>
		<description>Can anybody help me solve this problem of scroll in cocos2d. http://stackoverflow.com/questions/8366443/how-to-scroll-characters-on-a-label-in-cocos2d</description>
		<content:encoded><![CDATA[<p>Can anybody help me solve this problem of scroll in cocos2d. <a href="http://stackoverflow.com/questions/8366443/how-to-scroll-characters-on-a-label-in-cocos2d" rel="nofollow">http://stackoverflow.com/questions/8366443/how-to-scroll-characters-on-a-label-in-cocos2d</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: &#187; UIScrollView problems solved with drawScene mikedesu d0t com</title>
		<link>http://getsetgames.com/2009/08/21/cocos2d-and-uiscrollview/comment-page-3/#comment-4322</link>
		<dc:creator>&#187; UIScrollView problems solved with drawScene mikedesu d0t com</dc:creator>
		<pubDate>Fri, 02 Dec 2011 22:14:43 +0000</pubDate>
		<guid isPermaLink="false">http://getsetgames.com/?p=138#comment-4322</guid>
		<description>[...] rest of the UIScrollView stuff can be found here, http://getsetgames.com/2009/08/21/cocos2d-and-uiscrollview/. I hope someone finds my blogpost useful [...]</description>
		<content:encoded><![CDATA[<p>[...] rest of the UIScrollView stuff can be found here, <a href="http://getsetgames.com/2009/08/21/cocos2d-and-uiscrollview/" rel="nofollow">http://getsetgames.com/2009/08/21/cocos2d-and-uiscrollview/</a>. I hope someone finds my blogpost useful [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: A Paging UIScrollView in Cocos2d (with previews) &#124; iOS Development Tips &#38; Tricks by BiOM</title>
		<link>http://getsetgames.com/2009/08/21/cocos2d-and-uiscrollview/comment-page-3/#comment-4310</link>
		<dc:creator>A Paging UIScrollView in Cocos2d (with previews) &#124; iOS Development Tips &#38; Tricks by BiOM</dc:creator>
		<pubDate>Mon, 28 Nov 2011 08:02:52 +0000</pubDate>
		<guid isPermaLink="false">http://getsetgames.com/?p=138#comment-4310</guid>
		<description>[...] http://getsetgames.com/2009/08/21/cocos2d-and-uiscrollview/ [...]</description>
		<content:encoded><![CDATA[<p>[...] <a href="http://getsetgames.com/2009/08/21/cocos2d-and-uiscrollview/" rel="nofollow">http://getsetgames.com/2009/08/21/cocos2d-and-uiscrollview/</a> [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anonymous</title>
		<link>http://getsetgames.com/2009/08/21/cocos2d-and-uiscrollview/comment-page-3/#comment-4274</link>
		<dc:creator>Anonymous</dc:creator>
		<pubDate>Thu, 03 Nov 2011 09:07:00 +0000</pubDate>
		<guid isPermaLink="false">http://getsetgames.com/?p=138#comment-4274</guid>
		<description>OK, thanks.</description>
		<content:encoded><![CDATA[<p>OK, thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Telinir</title>
		<link>http://getsetgames.com/2009/08/21/cocos2d-and-uiscrollview/comment-page-3/#comment-4271</link>
		<dc:creator>Telinir</dc:creator>
		<pubDate>Thu, 03 Nov 2011 03:15:00 +0000</pubDate>
		<guid isPermaLink="false">http://getsetgames.com/?p=138#comment-4271</guid>
		<description>Yes it exists, try finding it in &quot;Search&quot;.</description>
		<content:encoded><![CDATA[<p>Yes it exists, try finding it in &#8220;Search&#8221;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anonymous</title>
		<link>http://getsetgames.com/2009/08/21/cocos2d-and-uiscrollview/comment-page-3/#comment-4259</link>
		<dc:creator>Anonymous</dc:creator>
		<pubDate>Mon, 31 Oct 2011 20:04:00 +0000</pubDate>
		<guid isPermaLink="false">http://getsetgames.com/?p=138#comment-4259</guid>
		<description>I don&#039;t see CC_DIRECTOR_INIT() called in 1.0 cocos2d HelloWorld sample.  Is this still relevant?</description>
		<content:encoded><![CDATA[<p>I don&#8217;t see CC_DIRECTOR_INIT() called in 1.0 cocos2d HelloWorld sample.  Is this still relevant?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

