<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.1" -->
<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">
	<channel>
		<title>cocos2d for iPhone &#187; Topic: how do you do your scroling? move the content or the camera?</title>
		<link>http://www.cocos2d-iphone.org/forum/topic/309</link>
		<description>A fast, easy to use, free, and community supported 2D game engine</description>
		<language>en-US</language>
		<pubDate>Fri, 10 Feb 2012 01:25:48 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.1</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>http://www.cocos2d-iphone.org/forum/search.php</link>
		</textInput>
		<atom:link href="http://www.cocos2d-iphone.org/forum/rss/topic/309" rel="self" type="application/rss+xml" />

		<item>
			<title>artakus on "how do you do your scroling? move the content or the camera?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/309/page/2#post-14299</link>
			<pubDate>Mon, 05 Oct 2009 08:44:42 +0000</pubDate>
			<dc:creator>artakus</dc:creator>
			<guid isPermaLink="false">14299@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I found that cocos2d has included a sample code how to drag map. but it doesn't use camera method. is there any way i can move the map by using camera method So all my obstacle list coordinate i have set in the iPhone coordinate still there.
</p></description>
		</item>
		<item>
			<title>ob1 on "how do you do your scroling? move the content or the camera?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/309/page/2#post-11758</link>
			<pubDate>Tue, 15 Sep 2009 15:15:29 +0000</pubDate>
			<dc:creator>ob1</dc:creator>
			<guid isPermaLink="false">11758@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Sorry to revive an old thread.</p>
<p>In my scroller game, I followed the advice here and moved the camera instead of the layer. The result is terrible. The scrolling is not smooth at all.</p>
<p>Then I replaced the camera moving calls with layer moving calls with the same delta, and everything is smooth. </p>
<p>Does anybody have an idea why ?</p>
<p>Second, I have black blinking lines between my sprites. I have already read several threads about this problem, but could someone explain the technical reason for this ?</p>
<p>Edit: One last point, if I set 2D projection I have nothing on screen anymore :-/
</p></description>
		</item>
		<item>
			<title>cpk on "how do you do your scroling? move the content or the camera?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/309/page/2#post-10486</link>
			<pubDate>Wed, 02 Sep 2009 21:29:29 +0000</pubDate>
			<dc:creator>cpk</dc:creator>
			<guid isPermaLink="false">10486@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Ooops.... This is covered under another topic ...<br />
<a href="http://www.cocos2d-iphone.org/forum/topic/1314" rel="nofollow">http://www.cocos2d-iphone.org/forum/topic/1314</a>
</p></description>
		</item>
		<item>
			<title>cpk on "how do you do your scroling? move the content or the camera?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/309#post-10476</link>
			<pubDate>Wed, 02 Sep 2009 19:32:34 +0000</pubDate>
			<dc:creator>cpk</dc:creator>
			<guid isPermaLink="false">10476@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hello! I have a game with a background wider than the screen. When the actor moves I want the view to be centered over the actor. Moving the camera (discussed above) works well for this.</p>
<p>I want the user to be able to interact with (touch) the actor. But I am having problems with mapping touches on the screen (screen coordinates) with coordinates in the game space. The following code get's the position of the touch relative to the "screen coordinates" and orientation.<br />
	UITouch *myTouch =  [touches anyObject];<br />
	CGPoint loc = [myTouch locationInView: [myTouch view]];<br />
	CGPoint convLoc = [[Director sharedDirector] convertCoordinate: loc];<br />
It looks like the method attached to CocosNode should do the trick....<br />
	CGPoint wsConvLoc = [self convertToWorldSpace: convLoc];<br />
But it does not. Any hint would be much appreciated. I am using Cocos2d 0.8.1 and the most recent version of Chipmunk.
</p></description>
		</item>
		<item>
			<title>Nicke on "how do you do your scroling? move the content or the camera?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/309#post-7107</link>
			<pubDate>Fri, 07 Aug 2009 07:14:05 +0000</pubDate>
			<dc:creator>Nicke</dc:creator>
			<guid isPermaLink="false">7107@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Simple implementation would look something like:</p>
<p>In your interface file:<br />
<pre><code>CGPoint lastLocation;</code></pre>
<p>In your implementation</p>
<pre><code>-(BOOL)ccTouchesBegan:(NSSet*)touches withEvent:(UIEvent*)event {

        UITouch *touch = [touches anyObject];
	CGPoint tmpLoc = [touch locationInView: [touch view]];
	CGPoint location = [[Director sharedDirector] convertCoordinate:tmpLoc];

        lastLocation = location;

}

-(BOOL)ccTouchesMoved:(NSSet*)touches withEvent:(UIEvent*)event {

	UITouch *touch = [touches anyObject];
	CGPoint tmpLoc = [touch locationInView: [touch view]];
	CGPoint location = [[Director sharedDirector] convertCoordinate:tmpLoc];

        if (!(CGPointEqualToPoint( location, lastLocation ))) { 

            yourTileMap.position = ccp((location.x - lastLocation.x), (location.y - lastLocation.y));

        }

        lastLocation = location;

}</code></pre>
<p>Feel free to correct any silly errors, I'm only on my first cup of coffee, still two cups away from my zen hacker state ;)
</p></description>
		</item>
		<item>
			<title>artakus on "how do you do your scroling? move the content or the camera?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/309#post-7098</link>
			<pubDate>Fri, 07 Aug 2009 04:31:24 +0000</pubDate>
			<dc:creator>artakus</dc:creator>
			<guid isPermaLink="false">7098@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>i understand your concept but a bit confuse with the implementation.</p>
<p>So i have to define my map position like this:</p>
<p>locx = tilemap.position.x;<br />
locy = tilemap.position.y;</p>
<p>then ? urgh. :&#124;
</p></description>
		</item>
		<item>
			<title>Acceleroto on "how do you do your scroling? move the content or the camera?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/309#post-7094</link>
			<pubDate>Fri, 07 Aug 2009 04:10:50 +0000</pubDate>
			<dc:creator>Acceleroto</dc:creator>
			<guid isPermaLink="false">7094@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>One way to do this would be to define the location of your last touch and compare that to the current touch location (the new Cocos touch handler is probably the best to use for this).  Once you have to difference in x &#38; y between the old &#38; new touch locations, add that difference to the tilemap location.</p>
<p>-Bryan
</p></description>
		</item>
		<item>
			<title>artakus on "how do you do your scroling? move the content or the camera?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/309#post-7093</link>
			<pubDate>Fri, 07 Aug 2009 03:49:24 +0000</pubDate>
			<dc:creator>artakus</dc:creator>
			<guid isPermaLink="false">7093@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I'm new in cocos2d actually.</p>
<p>I have large map and i wanna drag it to the left, right, top and bottom, so I use this code to drag my map:</p>
<p>- (BOOL)ccTouchesMoved:(NSSet *)touches withEvent:(UIEvent *)event<br />
{<br />
	UITouch *touch = [touches anyObject];</p>
<p>	if( touch )<br />
	{<br />
		CGPoint location = [touch locationInView: [touch view]];<br />
               TileMapAtlas *tilemap = (TileMapAtlas*) [self getChildByTag:kTagMap];<br />
               [tilemap setPosition:[[Director sharedDirector] convertCoordinate:location]];<br />
        }<br />
}</p>
<p>However the result is bad. My map only follow the touch location.. :&#124;
</p></description>
		</item>
		<item>
			<title>Acceleroto on "how do you do your scroling? move the content or the camera?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/309#post-6997</link>
			<pubDate>Thu, 06 Aug 2009 17:33:20 +0000</pubDate>
			<dc:creator>Acceleroto</dc:creator>
			<guid isPermaLink="false">6997@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>The above code just centers the camera on a given point.  If you want to move the camera while your finger moves, you should add something in ccTouchesMoved also.  I'm not exactly sure what you're trying to do with your game, so it's a little tough for me to give exact code examples.</p>
<p>Maybe think about what you want to occur when touches start, move and end.  From there, program the right things in ccTouchesBegan, ccTouchesMoved, ccTouchesEnded, and ccTouchesCancelled.  For my code, my ccTouchesEnded &#38; ccTouchesCancelled do the same things.</p>
<p>-Bryan
</p></description>
		</item>
		<item>
			<title>artakus on "how do you do your scroling? move the content or the camera?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/309#post-6945</link>
			<pubDate>Thu, 06 Aug 2009 08:39:30 +0000</pubDate>
			<dc:creator>artakus</dc:creator>
			<guid isPermaLink="false">6945@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hai Acceleroto. I cannot move the map, First I click on the screen, The map going to the top right (North East) and nothing happened. </p>
<p>I think it should be used in  ccTouchBegan. because im going to drag it to the right, left, top and down. then in cctouchEnded (i untouch), then it will be going to the original location.</p>
<p>So which part did you mention about the dragging method? The above code? Or the above code just to center the map position? How about the dragging map?
</p></description>
		</item>
		<item>
			<title>Acceleroto on "how do you do your scroling? move the content or the camera?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/309#post-6930</link>
			<pubDate>Thu, 06 Aug 2009 03:52:38 +0000</pubDate>
			<dc:creator>Acceleroto</dc:creator>
			<guid isPermaLink="false">6930@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>@<a href='http://www.cocos2d-iphone.org/forum/profile/766'>artakus</a> - there's only a "set" for the X part of the method name.  I think you need to set the camera and the eye to do what you want:</p>
<pre><code>//the next 2 lines are from camera.m
GSize s = [[Director sharedDirector] displaySize];
//return ( s.height / 1.1566f ); //commented out &#38; left for reference

//this sets the Z value for the eye to the Cocos default
float cameraZ = ( s.height / 1.1566f );

//set the camera view center and location
[self.camera setCenterX:tilemap.position.x centerY:tilemap.position.y centerZ:0];
[self.camera setEyeX:tilemap.position.x eyeY:tilemap.position.x eyeZ:cameraZ];</code></pre></description>
		</item>
		<item>
			<title>artakus on "how do you do your scroling? move the content or the camera?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/309#post-6927</link>
			<pubDate>Thu, 06 Aug 2009 03:05:59 +0000</pubDate>
			<dc:creator>artakus</dc:creator>
			<guid isPermaLink="false">6927@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>@<a href='http://www.cocos2d-iphone.org/forum/profile/165'>Acceleroto</a> :<br />
Yeah the concept help me but the implementation made me confuse! :( .<br />
@<a href='http://www.cocos2d-iphone.org/forum/profile/642'>natanavra</a><br />
I think the Z value is just a typo. Sorry for my mistake.</p>
<p>Your code suggestion:</p>
<p>[self.camera setEyeX:mySprite.position.x setEyeY:mySprite.position.y setEyeZ:0];</p>
<p>===============</p>
<p>I compile and X-code said : warning 'Camera' may not respond to '-setEyeX:setEyeY:setEyeZ:'</p>
<p>Maybe setEyeY and setEyeZ don't exist? Or instead use eyeY and eyeZ?</p>
<p>I change setEyeY and setEyeZ to eyeY and eyeZ :</p>
<p>[self.camera setEyeX:tilemap.position.x eyeY:tilemap.position.y eyeZ:0 ]</p>
<p>and blank dark screen appear.. :(
</p></description>
		</item>
		<item>
			<title>Acceleroto on "how do you do your scroling? move the content or the camera?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/309#post-6542</link>
			<pubDate>Mon, 03 Aug 2009 15:11:21 +0000</pubDate>
			<dc:creator>Acceleroto</dc:creator>
			<guid isPermaLink="false">6542@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>@<a href='http://www.cocos2d-iphone.org/forum/profile/642'>natanavra</a>:<br />
&#62;Camera shows us the screen space, and by moving it,<br />
&#62;we show a different portion of the world on the screen right?</p>
<p>Yes.  The setEye method sets where the camera is looking FROM and the setCenter method sets where the camera is looking TO.  So, the setCenter location defines the center point of the portion of the world that you are viewing.  If you want a 2D scrolling view, set the camera x,y and the eye x,y to be the same.  You can create a rotating/slanting/3D view by making the center &#38; eye different x,y values.</p>
<p>&#62;By the way, why did you do the setEyeZ with an x value?? or is just a typo? </p>
<p>For a 2D non-zooming view, you usually want the setEyeZ value to be a constant number.  You could, however, vary the zoom of the scene by changing the Z value based on some other calculations.  If you set it to an X value of something, then the further left (towards zero) that object got, the more zoomed in the scene would be.</p>
<p>@<a href='http://www.cocos2d-iphone.org/forum/profile/22'>Codemattic</a>:<br />
&#62;But you can use position/rotation/scale for childnodes of that camera node right? </p>
<p>Yes.  The way I do this in Occurro! is I leave the background layer stationary.  There are parallax layers, bad guys, explosions &#38; more all as children of the background layer.  It may not be the most elegant way to do this, but it works fine for me.</p>
<p>I prefer moving the camera around instead of the layer because I do physics calculations based on positions of objects in the layer.  It also seems more "pure" to me.</p>
<p>-Bryan
</p></description>
		</item>
		<item>
			<title>riq on "how do you do your scroling? move the content or the camera?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/309#post-6538</link>
			<pubDate>Mon, 03 Aug 2009 14:59:44 +0000</pubDate>
			<dc:creator>riq</dc:creator>
			<guid isPermaLink="false">6538@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>@codematic:<br />
yes, the camera only affects the node that is using it.<br />
the node's children can use it's own camera or it's own position/scale/rotation properties.
</p></description>
		</item>
		<item>
			<title>Codemattic on "how do you do your scroling? move the content or the camera?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/309#post-6537</link>
			<pubDate>Mon, 03 Aug 2009 14:45:40 +0000</pubDate>
			<dc:creator>Codemattic</dc:creator>
			<guid isPermaLink="false">6537@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>"Limitations:<br />
* position/rotation/scale doesn't work if you are using the camera"</p>
<p>But you can use position/rotation/scale for childnodes of that camera node right?  So you can just keep the parent node static (and use camera to scroll or zoom, etc...) - and you can change the position/rotation/scale of the childnodes to run your game's animation.
</p></description>
		</item>
		<item>
			<title>Carpy on "how do you do your scroling? move the content or the camera?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/309#post-6536</link>
			<pubDate>Mon, 03 Aug 2009 14:35:11 +0000</pubDate>
			<dc:creator>Carpy</dc:creator>
			<guid isPermaLink="false">6536@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Its funny... i've been working with cocos2d for a long time now and i have no idea how to use the camera, i tried looking for information but was unable to find any.</p>
<p>So i just move the layer around.
</p></description>
		</item>
		<item>
			<title>riq on "how do you do your scroling? move the content or the camera?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/309#post-6525</link>
			<pubDate>Mon, 03 Aug 2009 13:22:34 +0000</pubDate>
			<dc:creator>riq</dc:creator>
			<guid isPermaLink="false">6525@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Some notes regarding camera vs. position/rotation/scale:</p>
<p>With the camera you can do everything that you can do with position/rotation/scale and more.<br />
But you should know that if you use the camera you can't use the position/rotation/scale.<br />
Either you use the camera or the position/rotation/scale.</p>
<p>Benefits of camera:<br />
 * you can do more things than the position/rotation/scale, like 3d effects (eg: OrbitCamera)</p>
<p>Limitations:<br />
 * position/rotation/scale doesn't work if you are using the camera
</p></description>
		</item>
		<item>
			<title>zombie on "how do you do your scroling? move the content or the camera?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/309#post-6514</link>
			<pubDate>Mon, 03 Aug 2009 10:35:44 +0000</pubDate>
			<dc:creator>zombie</dc:creator>
			<guid isPermaLink="false">6514@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Interesting thread. I use the layer position approach. Then I use its position for the offset of some stuff. Works ok. Thought about using the camera, but some things did not work as I needed it.</p>
<p>Zombie - ZombieSmash! <a href="http://ZombieSmash.gamedrs.com" rel="nofollow">http://ZombieSmash.gamedrs.com</a><br />
Our musician will be revealed tonight! (the last hint: Tu..., R-..., Gr..., Sh...)
</p></description>
		</item>
		<item>
			<title>natanavra on "how do you do your scroling? move the content or the camera?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/309#post-6507</link>
			<pubDate>Mon, 03 Aug 2009 08:35:48 +0000</pubDate>
			<dc:creator>natanavra</dc:creator>
			<guid isPermaLink="false">6507@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I think in order to achieve what you want you should implement this:</p>
<pre><code>-(BOOL)ccTouchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
        [self.camera setEyeX:mySprite.position.x setEyeY:mySprite.position.y setEyeZ:0];
        return kEventHandled;
}</code></pre>
<p>By the way, why did you do the setEyeZ with an x value?? or is just a typo?
</p></description>
		</item>
		<item>
			<title>artakus on "how do you do your scroling? move the content or the camera?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/309#post-6504</link>
			<pubDate>Mon, 03 Aug 2009 08:07:43 +0000</pubDate>
			<dc:creator>artakus</dc:creator>
			<guid isPermaLink="false">6504@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Thanks for your reply.</p>
<p>I try to implement your code for moving my map to the TOP/RIGHT/UP/DOWN by using ccTouchesMoved Method:</p>
<p>[self.camera setEyeX:convertedPoint.x eyeY:convertedPoint.y  eyeZ:convertedPoint.x ];</p>
<p>unfortunately, the way the map move is not what i want. I just wanna move it by dragging to the LEFT/RIGHT/TOP/DOWN (hand still touch the screen) and the map will be at the original place where the sprite is at (after i put my finger away from the screen (untouch) )
</p></description>
		</item>
		<item>
			<title>natanavra on "how do you do your scroling? move the content or the camera?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/309#post-6503</link>
			<pubDate>Mon, 03 Aug 2009 08:06:52 +0000</pubDate>
			<dc:creator>natanavra</dc:creator>
			<guid isPermaLink="false">6503@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Wow, this is one interesting thread!<br />
Bryan, I really like the camera movement in Occuro!<br />
I have one question regarding World and Screen space:</p>
<p>Camera shows us the screen space, and by moving it, we show a different portion of the world on the screen right?<br />
Btw, could anyone (marcond maybe), refer me to XML tuts and on how to use them in game to create a world spacing?</p>
<p>~Thank in advance.
</p></description>
		</item>
		<item>
			<title>Acceleroto on "how do you do your scroling? move the content or the camera?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/309#post-6496</link>
			<pubDate>Mon, 03 Aug 2009 04:31:57 +0000</pubDate>
			<dc:creator>Acceleroto</dc:creator>
			<guid isPermaLink="false">6496@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>@<a href='http://www.cocos2d-iphone.org/forum/profile/766'>artakus</a> - In Occurro!, I update the camera position at the end of every game loop (called "step" in many Cocos projects).</p>
<p>Everything in that game is calculated in a game space coordinate system &#38; the camera is moved around to view the desired part of that space.  So, there's an algorithm that calculates the camera position based on the player ship.  A simple way to do it would be to set the camera position to be equal to the player position.  This, however, would keep the player ship exactly in the middle of the screen.  To give a little more sense of motion, the camera in Occurro! doesn't move quite as fast as the player ship.</p>
<p>Does that help?</p>
<p>-Bryan
</p></description>
		</item>
		<item>
			<title>artakus on "how do you do your scroling? move the content or the camera?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/309#post-6489</link>
			<pubDate>Mon, 03 Aug 2009 02:42:10 +0000</pubDate>
			<dc:creator>artakus</dc:creator>
			<guid isPermaLink="false">6489@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>@Accelerotor</p>
<p>Where you set your cameraX. cameraY and cameraZ ? I didn't get it.
</p></description>
		</item>
		<item>
			<title>marcond on "how do you do your scroling? move the content or the camera?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/309#post-3384</link>
			<pubDate>Thu, 09 Jul 2009 20:38:36 +0000</pubDate>
			<dc:creator>marcond</dc:creator>
			<guid isPermaLink="false">3384@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Grr.. Preceding spaces were removed.</p>
<p>&#124;--&#62;ParallaxNode (practically everything goes in here. I just add the managers)<br />
_     &#124;----&#62;Background Items (Different parallaxes i specify in XML)<br />
_     &#124;----&#62;Enemies (AtlasManager 0 Parallax)<br />
_     &#124;----&#62;Player (AtlasManager 0 Parallax)<br />
_     &#124;----&#62;Bullets (AtlasManager 0 Parallax)
</p></description>
		</item>
		<item>
			<title>marcond on "how do you do your scroling? move the content or the camera?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/309#post-3383</link>
			<pubDate>Thu, 09 Jul 2009 20:37:18 +0000</pubDate>
			<dc:creator>marcond</dc:creator>
			<guid isPermaLink="false">3383@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>This is a nice thread, as I haven't seen many talking about why you would want to use Camera, or why it is the "correct" way to do it. I currently have a side view style game, where the board is 960x320 (2x wide landscape). I took the avoid-hierarchy-of-Layer quite literal, and only use one layer. Hierarchy looks like this:</p>
<p>LayerGameBoard<br />
&#124;--&#62;GUI Stuff (Labels, joy stick etc) individual pieces<br />
&#124;--&#62;ParallaxNode (practically everything goes in here. I just add the managers)<br />
      &#124;----&#62;Background Items (Different parallaxes i specify in XML)<br />
      &#124;----&#62;Enemies (AtlasManager 0 Parallax)<br />
      &#124;----&#62;Player (AtlasManager 0 Parallax)<br />
      &#124;----&#62;Bullets (AtlasManager 0 Parallax)</p>
<p>That's it.. Everything is moved at once, as unigee had mentioned in Comment #<a href='http://www.cocos2d-iphone.org/forum/tags/1'>1</a>. </p>
<p>It sounds like a lot of extra work to use Camera, especially if you have to constantly convert between chipmunk/cocos positions.. Is the overhead of these conversions insignificant when using chipmunk pretty heavily? At least in debug, when I see that a sprite is at 780px,200px, I know it's a literal location, and on the right side of the board pretty quickly! </p>
<p>Does anyone actually know the benefits of using Camera?
</p></description>
		</item>
		<item>
			<title>Acceleroto on "how do you do your scroling? move the content or the camera?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/309#post-1816</link>
			<pubDate>Fri, 26 Jun 2009 11:55:28 +0000</pubDate>
			<dc:creator>Acceleroto</dc:creator>
			<guid isPermaLink="false">1816@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>@<a href='http://www.cocos2d-iphone.org/forum/profile/52'>patrickC</a> I'll have to look more closely at exactly what I do then.  I move my camera around, but to keep my UI in place, I have to move it to follow the camera every frame.  I'd love to clean up that bit of code.  Thanks!</p>
<p>-Bryan
</p></description>
		</item>
		<item>
			<title>patrickC on "how do you do your scroling? move the content or the camera?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/309#post-1798</link>
			<pubDate>Fri, 26 Jun 2009 10:04:57 +0000</pubDate>
			<dc:creator>patrickC</dc:creator>
			<guid isPermaLink="false">1798@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hey Brian, actually I just use self.camera too.<br />
But I use it inside the Layer implementation, and it just seems to use that one layer and not the other one that has been added to the scene.<br />
hope that helps!
</p></description>
		</item>
		<item>
			<title>slipster216 on "how do you do your scroling? move the content or the camera?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/309#post-1790</link>
			<pubDate>Fri, 26 Jun 2009 07:22:27 +0000</pubDate>
			<dc:creator>slipster216</dc:creator>
			<guid isPermaLink="false">1790@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I prefer the camera method, as it's the 'correct' way to do it, really. If you move your world around constantly, then calculating the true position of an object in multiple spaces becomes a giant mess. I personally don't use the parallax system cocos provides because it moves the world rather than the cameras. Instead, I make a new subclass of CocosNode with a 'setParallaxOffset' function, and it adjust the camera for that layer and passes any children the same message. It's only a few lines of code, and works with world space particles, etc..
</p></description>
		</item>
		<item>
			<title>Acceleroto on "how do you do your scroling? move the content or the camera?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/309#post-1767</link>
			<pubDate>Fri, 26 Jun 2009 00:18:28 +0000</pubDate>
			<dc:creator>Acceleroto</dc:creator>
			<guid isPermaLink="false">1767@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>@<a href='http://www.cocos2d-iphone.org/forum/profile/11766'>patrick</a> - that sounds great...how do you move the layer's camera?  </p>
<p>Right now, I use:<br />
<pre><code>[self.camera setCenterX:cameraX centerY:cameraY centerZ:0];
	[self.camera setEyeX:cameraX eyeY:cameraY eyeZ:cameraZ];</code></pre>
<p>Is the layer's camera just layer.camera?</p>
<p>Thanks,<br />
-Bryan
</p></description>
		</item>
		<item>
			<title>patrickC on "how do you do your scroling? move the content or the camera?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/309#post-1755</link>
			<pubDate>Thu, 25 Jun 2009 23:29:21 +0000</pubDate>
			<dc:creator>patrickC</dc:creator>
			<guid isPermaLink="false">1755@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Also an option,<br />
I have two layers one for the game content and one for the gui.<br />
You can then move the camera of the layer it self, and that will only affect sprites and nodes inside that layer and not the gui layer.<br />
similar to what solmead said really, but slightly different perhaps since i'm using the camera in the layer and not moving the layer itself.
</p></description>
		</item>

	</channel>
</rss>

