<?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; Tag: Layer - Recent Posts</title>
		<link>http://www.cocos2d-iphone.org/forum/tags/layer</link>
		<description>A fast, easy to use, free, and community supported 2D game engine</description>
		<language>en-US</language>
		<pubDate>Fri, 10 Feb 2012 02:10:12 +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/tags/layer" rel="self" type="application/rss+xml" />

		<item>
			<title>Karl on "[?]Class A imports B, B needs to import A too..."</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/29119#post-143512</link>
			<pubDate>Thu, 09 Feb 2012 19:55:28 +0000</pubDate>
			<dc:creator>Karl</dc:creator>
			<guid isPermaLink="false">143512@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>When you find that classes require two-way communication, it can commonly be a sign of bad OO design, as birkemose said. However, there are cases where it's completely warranted. In such a case, you have three choices:</p>
<p>1. Make both aware of each other using the @class forward declaration, as mentioned earlier (this is usually the wrong approach).<br />
2. Use the delegate pattern, which is a commonly used pattern in UIKit (UIApplicationDelegate being used in EVERY iOS app).<br />
3. Register callbacks for the object that doesn't need to know about the other, except for notifications. This can be done with target/selector, blocks, or even monitoring NSNotifications or KVO (which is useful when multiple classes may be interested in events a class could generate).
</p></description>
		</item>
		<item>
			<title>Duckwit on "[?]Class A imports B, B needs to import A too..."</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/29119#post-143502</link>
			<pubDate>Thu, 09 Feb 2012 19:40:13 +0000</pubDate>
			<dc:creator>Duckwit</dc:creator>
			<guid isPermaLink="false">143502@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>@<a href='http://www.cocos2d-iphone.org/forum/profile/20192'>Birkemose</a> - Very wise advice, and I would love to take the time to implement it - but this here is just for a quick level-editor I made for my personal use only, so the code doesn't really need to work 'well' it just needs to work. (Which it does, and very smoothly + extremely fast as well).
</p></description>
		</item>
		<item>
			<title>Birkemose on "[?]Class A imports B, B needs to import A too..."</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/29119#post-143475</link>
			<pubDate>Thu, 09 Feb 2012 17:49:02 +0000</pubDate>
			<dc:creator>Birkemose</dc:creator>
			<guid isPermaLink="false">143475@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>While forward declarations work, they are no good.<br />
It is a common problem that you "suddenly" needs to cross-include two classes. Imo it should always be fixed by rethinking your class lay-out, because it will in the end result in a stronger OO-hierachy.
</p></description>
		</item>
		<item>
			<title>Duckwit on "[?]Class A imports B, B needs to import A too..."</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/29119#post-143470</link>
			<pubDate>Thu, 09 Feb 2012 17:20:08 +0000</pubDate>
			<dc:creator>Duckwit</dc:creator>
			<guid isPermaLink="false">143470@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Thanks @Martin and @<a href='http://www.cocos2d-iphone.org/forum/profile/31966'>frilla</a> - I implemented this just after @Martin posted and it is working beautifully. :)
</p></description>
		</item>
		<item>
			<title>frilla on "[?]Class A imports B, B needs to import A too..."</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/29119#post-143469</link>
			<pubDate>Thu, 09 Feb 2012 17:07:16 +0000</pubDate>
			<dc:creator>frilla</dc:creator>
			<guid isPermaLink="false">143469@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>As @Martin stated, you can use a forward declaration @class classNameHere on your header files so tell the compiler that you'll be refering to classes with this name in the header file but you won't be able to use them in the header file (for example call one of their methods).</p>
<p>In the implementation file, you'll have to import the header files in order to actually use the objects.</p>
<p>classA.h:<br />
<pre><code>@class classB;

classB *_pointerToClassB;</code></pre>
<p>classB.h:<br />
<pre><code>@class classA

classA *_pointerToClassA;</code></pre>
<p>classA.m:<br />
<pre><code>#<a href='http://www.cocos2d-iphone.org/forum/tags/import'>import</a> &#34;classB.h&#34;

//you can now use classB</code></pre>
<p>classB.m:<br />
<pre><code>#<a href='http://www.cocos2d-iphone.org/forum/tags/import'>import</a> &#34;classA.h
//you can now use classA</code></pre></description>
		</item>
		<item>
			<title>Martin on "[?]Class A imports B, B needs to import A too..."</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/29119#post-143468</link>
			<pubDate>Thu, 09 Feb 2012 16:58:17 +0000</pubDate>
			<dc:creator>Martin</dc:creator>
			<guid isPermaLink="false">143468@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I don't know whats the most proper solution, but you could use a protocol that one object conforms to, to define the methods the other object will use. Then both objects will import the file containing the protocol definition(s).<br />
And/Or you could import the header file of the other object only in the implementation file of your object. Afaik importing in the implementation does not generate cyclic dependencies.<br />
If your singleton stores a reference to the object you could use @class to "promise" the definition of the class will follow "later" (importing its header in the .m file). If I remember correctly that's how I usually do it.</p>
<p>p.s.: aaaand read this :)<br />
<a href="http://stackoverflow.com/questions/322597/class-vs-import" rel="nofollow">http://stackoverflow.com/questions/322597/class-vs-import</a>
</p></description>
		</item>
		<item>
			<title>Duckwit on "[?]Class A imports B, B needs to import A too..."</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/29119#post-143466</link>
			<pubDate>Thu, 09 Feb 2012 16:50:53 +0000</pubDate>
			<dc:creator>Duckwit</dc:creator>
			<guid isPermaLink="false">143466@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>This is one of those stupid technical problem that I should be able to solve by now, but being bogged down by work and struggling to find programming time I can't seem to figure this out. </p>
<p>Class A is a singleton, it receives input from the user interface using Interface Builder.<br />
Class B is a CCLayer subclass (HelloWorldLayer)</p>
<p>B needs to know about a to send it some data via a method.<br />
A needs to know about B to call some methods in it when it receives certain file data from the NSOpenPanel. </p>
<p>B #imports A<br />
But if A imports B there are problems - (circular importing)  </p>
<p>How should I properly reference each class?
</p></description>
		</item>
		<item>
			<title>rickms on "Z order(s) and Layers"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/29055#post-143382</link>
			<pubDate>Thu, 09 Feb 2012 01:52:41 +0000</pubDate>
			<dc:creator>rickms</dc:creator>
			<guid isPermaLink="false">143382@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>My comment about batch nodes is very much related to Karl's excellent explanation.    If you have multiple batch nodes,  because of what Karl as explained, you can never do something like:</p>
<p>background sprite: batchnodeA.sprite1<br />
middle sprite: batchnodeB.sprite1<br />
foreground sprite: batchnodeA.sprite2</p>
<p>This also applies to mixing batch node sprites with non-batched sprites.
</p></description>
		</item>
		<item>
			<title>Karl on "Z order(s) and Layers"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/29055#post-143379</link>
			<pubDate>Thu, 09 Feb 2012 00:31:34 +0000</pubDate>
			<dc:creator>Karl</dc:creator>
			<guid isPermaLink="false">143379@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Let's say for example that you have two custom nodes: DogNode and CatNode. Those custom nodes have their own children (various body parts, which are implemented as CCSprites). You could lay them out like so:</p>
<p><img src="http://i.imgur.com/Ykuti.png" /></p>
<p>Your layer has 2 children: a dog and a cat.</p>
<p>The dog has 3 sprites as children, and the cat also has 3 sprites inside it.</p>
<p>Dog has a Z order of 0 inside layer (its parent), and cat has a Z order of 1, so dog will always be drawn before cat no matter what order you added them in:</p>
<pre><code>[layer addChild:dog z:0];
[layer addChild:cat z:1];</code></pre>
<p>is exactly the same as:</p>
<pre><code>[layer addChild:cat z:1];
[layer addChild:dog z:0];</code></pre>
<p>Inside cat, body has a z of 0, eyes 10, ears 11, so they always will be in that order.<br />
However, dog has all of them at the same Z order (1000), so then cocos2d falls back on the order you added them in. In this case:<br />
<pre><code>[dog addChild:body z:1000];
[dog addChild:eyes z:1000];
[dog addChild:ears z:1000];</code></pre>
<p>is NOT the same as:<br />
<pre><code>[dog addChild:ears z:1000];
[dog addChild:body z:1000];
[dog addChild:eyes z:1000];</code></pre>
<p>Now when it comes time to render this graph, cocos2d does it like this (simplified):</p>
<pre><code>layer&#039;s parent: draw layer.
    layer: draw dog.
        dog: draw body
        dog: draw eyes
        dog: draw ears
        dog: no more children to draw
    layer:draw cat
        cat: draw body
        cat: draw eyes
        cat: draw ears
        cat: no more children to draw
    layer: no more children to draw
layer&#039;s parent: no more children to draw.</code></pre>
<p>So the order the sprites get drawn in is: dog body, dog eyes, dog ears, cat body, cat eyes, cat ears.<br />
If the cat is in the same location as the dog, the cat comes out over top because the ENTIRE cat gets drawn after the ENTIRE dog. This happens even though the dog's components have a z order of 1000 while the cat's components have Z orders that are smaller. Z order is only relative to your immediate peers (other children of the same parent).
</p></description>
		</item>
		<item>
			<title>mijator on "Z order(s) and Layers"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/29055#post-143375</link>
			<pubDate>Wed, 08 Feb 2012 23:57:45 +0000</pubDate>
			<dc:creator>mijator</dc:creator>
			<guid isPermaLink="false">143375@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Thanks.</p>
<p>What I found really useful:</p>
<p>Duckwit: "Except, 'before things get confusing':<br />
If you have a sprite on a layer at z:100, you can have more than 100 sprites below it simply by using negative values."</p>
<p>Rickms: "Particularly important when it comes to batch nodes."  </p>
<p>- I want/need to know what you meant because it may be related to my current problem (i.e., using batch nodes for multiple sprites/layers and having z values get mixed up)...so please, Rickms, explain more about your comment...</p>
<p>Karl: " If you add two nodes with the same z value, they are placed in the same area of the list, but the node you added earlier will always be before the node you added later. When it comes time to draw, cocos2d will step through the list, drawing each child. Children drawn later will overwrite any part that overlaps with a previously drawn child node."</p>
<p>- this is really useful.  Perhaps this is why my previous layer objects have disappeared (i.e., I've overwritten them with newer ones "Children drawn later" )...</p>
<p>Karl: "Either all children of node A will draw before all children of node B, or vice versa"</p>
<p>- perhaps this is the key to understanding things...</p>
<p>i.e., if node B draws after node A...then B overwrites whatever A has done.  </p>
<p>DOES THAT MEAN: whoever draws last takes highest priority?</p>
<p>&#62;&#62;&#62;<br />
It seems to be based upon nodes, so a quick explanation of nodes would be nice<br />
&#62;&#62;&#62;
</p></description>
		</item>
		<item>
			<title>mavrik5150 on "Z order(s) and Layers"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/29055#post-143328</link>
			<pubDate>Wed, 08 Feb 2012 22:46:38 +0000</pubDate>
			<dc:creator>mavrik5150</dc:creator>
			<guid isPermaLink="false">143328@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>One thing you should consider as well if you are going to be using the Z tag a lot is setting up a typedef in the .m file and give some of them an name to make it easier to track like </p>
<pre><code>typedef enum {
Layer1Z = 1,
Layer5Z = 20,
etc
}ZLayers</code></pre>
<p>Then when you start adding your different sprites and layers you can actually have a word in the z so things aren't as confusing (ex CCSprite *a-sprite z:Layer1Z). It also helps for when you need to do stuff later and try to track something down based on tag or z order (I do the same for my Tag's that will be used frequently).
</p></description>
		</item>
		<item>
			<title>Karl on "Z order(s) and Layers"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/29055#post-143325</link>
			<pubDate>Wed, 08 Feb 2012 21:53:51 +0000</pubDate>
			<dc:creator>Karl</dc:creator>
			<guid isPermaLink="false">143325@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Child nodes are actually stored in a list internally. The "z" value determines their relative position in the list. Higher numbers are placed later in the list than lower numbers. If you add two nodes with the same z value, they are placed in the same area of the list, but the node you added earlier will always be before the node you added later.</p>
<p>When it comes time to draw, cocos2d will step through the list, drawing each child. Children drawn later will overwrite any part that overlaps with a previously drawn child node (unless you're using a custom blend mode).</p>
<p>Each node has its own list of children, so the z value of nodes in different parents have no effect on each other. Either all children of node A will draw before all children of node B, or vice versa.</p>
<p>Also, the z value is just an integer. You could use 100000, for example.
</p></description>
		</item>
		<item>
			<title>rickms on "Z order(s) and Layers"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/29055#post-143324</link>
			<pubDate>Wed, 08 Feb 2012 21:48:54 +0000</pubDate>
			<dc:creator>rickms</dc:creator>
			<guid isPermaLink="false">143324@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Yes, this is how it works.   Particularly important when it comes to batch nodes.
</p></description>
		</item>
		<item>
			<title>Duckwit on "Z order(s) and Layers"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/29055#post-143323</link>
			<pubDate>Wed, 08 Feb 2012 21:48:36 +0000</pubDate>
			<dc:creator>Duckwit</dc:creator>
			<guid isPermaLink="false">143323@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Yes. You are correct. </p>
<p>Except, 'before things get confusing':<br />
If you have a sprite on a layer at z:100, you can have more than 100 sprites below it simply by using negative values. </p>
<p>e.g:<br />
sprite z:100<br />
sprite z: 90<br />
sprite z:50<br />
sprite z:20<br />
sprite z:10<br />
sprite z:5<br />
sprite z:0<br />
sprite z:-1<br />
sprite z:-10<br />
sprite z: -50<br />
etc...
</p></description>
		</item>
		<item>
			<title>mijator on "Z order(s) and Layers"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/29055#post-143322</link>
			<pubDate>Wed, 08 Feb 2012 21:36:09 +0000</pubDate>
			<dc:creator>mijator</dc:creator>
			<guid isPermaLink="false">143322@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Just wondering if I am right about the priority of z orders and layers...</p>
<p>&#62;&#62;&#62;<br />
That is:</p>
<p>Layer 1 : z:0</p>
<p>CCSprite *a-sprite z:100  // a-sprite is contained within Layer 1 so even though it has an individual z order of 100, it stays within the z:0 layer and all objects (on different layers) are above it if the layer they are on is greater than z:0 (see below)</p>
<p>//it also means I can have 99 more sprite "sub layers" within layer 1 before things start to get confusing</p>
<p>Layer 2 z:1  // everything in this layer is above all of the objects in Layer 1</p>
<p>CCSprite *b-sprite z:100 //i.e., even though they have the same z value, b-sprite is NOT in the same layer as a-sprite because it has been created in layer 2...</p>
<p>&#62;&#62;&#62;<br />
Am I right with the above?
</p></description>
		</item>
		<item>
			<title>saber on "100% working solution for the pinch-zoom &amp; pan-move with boundaries control??"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/19178/page/8#post-142978</link>
			<pubDate>Tue, 07 Feb 2012 02:03:07 +0000</pubDate>
			<dc:creator>saber</dc:creator>
			<guid isPermaLink="false">142978@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>thank you, it's work well,except double tap.
</p></description>
		</item>
		<item>
			<title>GTC on "Pinch-Zoom like Fieldrunners"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/2229/page/2#post-142458</link>
			<pubDate>Fri, 03 Feb 2012 06:52:03 +0000</pubDate>
			<dc:creator>GTC</dc:creator>
			<guid isPermaLink="false">142458@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Ok sure, in home after 6 o'clock !
</p></description>
		</item>
		<item>
			<title>elsevero on "Pinch-Zoom like Fieldrunners"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/2229/page/2#post-142402</link>
			<pubDate>Thu, 02 Feb 2012 22:28:07 +0000</pubDate>
			<dc:creator>elsevero</dc:creator>
			<guid isPermaLink="false">142402@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>@GTC: One thing to remark here: </p>
<p>CGPoint centerPointInParentNodeSpace = [self convertPoint:centerPoint fromNode:theParallaxNode];</p>
<p>Can you share this</p>
<p><code>[self convertPoint:centerPoint fromNode:theParallaxNode];</code></p>
<p>method also?
</p></description>
		</item>
		<item>
			<title>Tough Guy on "someLayer.opacity not working"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/540#post-142296</link>
			<pubDate>Thu, 02 Feb 2012 11:40:20 +0000</pubDate>
			<dc:creator>Tough Guy</dc:creator>
			<guid isPermaLink="false">142296@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>@riq If you could please put some sample code to insert a colorlayer and add a sprite into it. I've been searching it for a while. Thanks in advance.
</p></description>
		</item>
		<item>
			<title>GTC on "Pinch-Zoom like Fieldrunners"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/2229/page/2#post-142005</link>
			<pubDate>Tue, 31 Jan 2012 15:22:23 +0000</pubDate>
			<dc:creator>GTC</dc:creator>
			<guid isPermaLink="false">142005@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>So, this is my fixed handlePitchZoom.</p>
<pre><code>- (void)handlePitchZoom:(NSSet *)touches withEvent:(UIEvent *)event {

    UITouch* touch1 = [[[event allTouches] allObjects] objectAtIndex:0];
    UITouch* touch2 = [[[event allTouches] allObjects] objectAtIndex:1];

    // calculate scale value
    double prevDistance = ccpDistance([touch1 previousLocationInView:[touch1 view]], [touch2 previousLocationInView:[touch2 view]]);
    double newDistance  = ccpDistance([touch1 locationInView:[touch1 view]], [touch2 locationInView:[touch2 view]]); 

    CGFloat relation = newDistance / prevDistance;
    CGFloat newScale = self.scale * relation;

    if ((newScale &#62;= minScale) &#38;&#38; (newScale &#60;= maxScale)) {

        CGPoint touch1Location = [GST.layerNode convertTouchToNodeSpace:touch1];
        CGPoint touch2Location = [GST.layerNode convertTouchToNodeSpace:touch2];

        // calculate center point between two touches
        CGPoint centerPoint = ccpMidpoint(touch1Location, touch2Location);

		// store center point location (ScrollableView space)
        CGPoint centerPointInParentNodeSpace = [self convertPoint:centerPoint fromNode:GST.layerNode];
		CGPoint oldPoint = ccp(centerPointInParentNodeSpace.x * (self.scale), centerPointInParentNodeSpace.y * (self.scale));
		self.scale = newScale;

		CGPoint newPoint = ccp(centerPointInParentNodeSpace.x * (self.scale), centerPointInParentNodeSpace.y * (self.scale));
		CGPoint diff = ccp(oldPoint.x - newPoint.x , oldPoint.y - newPoint.y);

        [GST.layerNode setPosition:ccp(GST.layerNode.position.x + (diff.x*(1/self.scale)), GST.layerNode.position.y + (diff.y*(1/self.scale)))];
    }
}</code></pre>
<p>The problem was that the original code just scale the outermost layer but I needed to scale my working layer also which is the part of CCParallaxNode.</p>
<p>So this is the key</p>
<pre><code>[GST.layerNode setPosition:ccp(GST.layerNode.position.x + (diff.x*(1/self.scale)), GST.layerNode.position.y + (diff.y*(1/self.scale)))];</code></pre>
<p>I also adopted some position changing and scaling for my working node (GST.layerNode).
</p></description>
		</item>
		<item>
			<title>GTC on "Pinch-Zoom like Fieldrunners"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/2229/page/2#post-141817</link>
			<pubDate>Mon, 30 Jan 2012 06:07:39 +0000</pubDate>
			<dc:creator>GTC</dc:creator>
			<guid isPermaLink="false">141817@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I'll post it as soon as possible because I'm not with my computer ;)</p>
<p>Thanks!
</p></description>
		</item>
		<item>
			<title>dgtheman on "Pinch, Zoom, and Boundries? cocoswd 0.99.5??"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28737#post-141685</link>
			<pubDate>Sun, 29 Jan 2012 00:11:34 +0000</pubDate>
			<dc:creator>dgtheman</dc:creator>
			<guid isPermaLink="false">141685@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Alright thanks Stepan! Ill probably end up using CCLayerPanZoom. It seems relatively simple to use.
</p></description>
		</item>
		<item>
			<title>Stepan Generalov on "Pinch, Zoom, and Boundries? cocoswd 0.99.5??"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28737#post-141642</link>
			<pubDate>Sat, 28 Jan 2012 16:08:37 +0000</pubDate>
			<dc:creator>Stepan Generalov</dc:creator>
			<guid isPermaLink="false">141642@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>CCLayerPanZoom: <a href="https://github.com/cocos2d/cocos2d-iphone-extensions/tree/master/Extensions/CCLayerPanZoom" rel="nofollow">https://github.com/cocos2d/cocos2d-iphone-extensions/tree/master/Extensions/CCLayerPanZoom</a><br />
or<br />
CCPanZoomController: <a href="http://www.cocos2d-iphone.org/forum/topic/19178" rel="nofollow">http://www.cocos2d-iphone.org/forum/topic/19178</a>
</p></description>
		</item>
		<item>
			<title>Stepan Generalov on "Pinch, Zoom, and Boundries? cocoswd 0.99.5??"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28737#post-141643</link>
			<pubDate>Sat, 28 Jan 2012 16:08:37 +0000</pubDate>
			<dc:creator>Stepan Generalov</dc:creator>
			<guid isPermaLink="false">141643@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>CCLayerPanZoom: <a href="https://github.com/cocos2d/cocos2d-iphone-extensions/tree/master/Extensions/CCLayerPanZoom" rel="nofollow">https://github.com/cocos2d/cocos2d-iphone-extensions/tree/master/Extensions/CCLayerPanZoom</a><br />
or<br />
CCPanZoomController: <a href="http://www.cocos2d-iphone.org/forum/topic/19178" rel="nofollow">http://www.cocos2d-iphone.org/forum/topic/19178</a>
</p></description>
		</item>
		<item>
			<title>dgtheman on "Pinch, Zoom, and Boundries? cocoswd 0.99.5??"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28737#post-141621</link>
			<pubDate>Sat, 28 Jan 2012 11:18:07 +0000</pubDate>
			<dc:creator>dgtheman</dc:creator>
			<guid isPermaLink="false">141621@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I have searched forever for a good solution to pinching/zooming and a standard algrithm for detecting the boundries on a map but have not come up with any good results. I found some but the -(void)ccTouchesMoved:withEvent: method doesnt seem to work anymore...and I have multiple touches enabled. Also, I have seen the UIPinchGestureRecognizer but it does not seem to be working for landscape mode? And one more thing...this is probably the most important...can someone provide me an alogrithm for detecting the edges of a map? So, if the user scrolls the layer moves and it does not go pass a certain boundry. The thing is I need it to work with scale as well and it is NOT a tiled map.</p>
<p>Thanks In Advance! I would appreciate any help!!
</p></description>
		</item>
		<item>
			<title>mobilebros on "100% working solution for the pinch-zoom &amp; pan-move with boundaries control??"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/19178/page/8#post-141414</link>
			<pubDate>Thu, 26 Jan 2012 20:36:29 +0000</pubDate>
			<dc:creator>mobilebros</dc:creator>
			<guid isPermaLink="false">141414@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>@<a href='http://www.cocos2d-iphone.org/forum/profile/61215'>xmawiel</a> - If the boundingRect height matches the windowRect height, there should be no movement. Also you could limit the y-value of the point you give to centerOnPoint. Other than that you'd have to hack it.
</p></description>
		</item>
		<item>
			<title>xmawiel on "100% working solution for the pinch-zoom &amp; pan-move with boundaries control??"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/19178/page/8#post-141255</link>
			<pubDate>Wed, 25 Jan 2012 20:53:08 +0000</pubDate>
			<dc:creator>xmawiel</dc:creator>
			<guid isPermaLink="false">141255@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>How do I limit this class to only pan in the x axis?<br />
Also, Is there a way to only "CenterOnPoint" only in the x axis?
</p></description>
		</item>
		<item>
			<title>3ncrypt0 on "Draw health bar after calling -(void) initializeControls in ProjektLayer.m"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28576#post-140886</link>
			<pubDate>Mon, 23 Jan 2012 20:16:23 +0000</pubDate>
			<dc:creator>3ncrypt0</dc:creator>
			<guid isPermaLink="false">140886@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hi,</p>
<p>that was my first idea, but I got always an error, but I was able to solve the problem.</p>
<p>I ask yet another question: first my code:</p>
<pre><code>-(BOOL)ccTouchBegan:(UITouch *)touch withEvent:(UIEvent *)event{
    CGPoint location = [self convertTouchToNodeSpace: touch];
    if (startMenu == YES) {
        if (CGRectContainsPoint([playBtn boundingBox], location)) {
            [self removeChild:playBtn cleanup:NO];
            [self loadLevelMenu];
            startMenu = NO;
            return YES;
        }
    }
    else{
        for (uint i = 0; i &#60; [levelCardArray count]; i++) {
            if (CGRectContainsPoint([[levelCardArray objectAtIndex:i] boundingBox], location)) {
                NSLog(@&#34;Ergebnis: %i&#34;, i);
                return YES;
            }
        }
    }

    return NO;
}</code></pre>
<p>I get the warning: Multiple methods named boundingBox found</p>
<p>Why?
</p></description>
		</item>
		<item>
			<title>shefyg on "Draw health bar after calling -(void) initializeControls in ProjektLayer.m"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28576#post-140781</link>
			<pubDate>Mon, 23 Jan 2012 06:03:47 +0000</pubDate>
			<dc:creator>shefyg</dc:creator>
			<guid isPermaLink="false">140781@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Not sure whats the problem, but you should consider separating between GamePlay layer and Hud Layer.</p>
<p> Making a Hud layer on top, that would be the parent of all GUI elements, is always a good idea.
</p></description>
		</item>
		<item>
			<title>3ncrypt0 on "Draw health bar after calling -(void) initializeControls in ProjektLayer.m"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28576#post-140713</link>
			<pubDate>Sun, 22 Jan 2012 21:48:41 +0000</pubDate>
			<dc:creator>3ncrypt0</dc:creator>
			<guid isPermaLink="false">140713@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hey guys,</p>
<p>i have a question: I will draw a health bar and time bar in my 3DWorld. But i will draw it after calling the -(void) initializeControls in the MyProjectLayer.m. First, i called a Level menu. Now i will select a level an then i will show my 3D Game World. It works fine, but how can i add a health bar into the 3D World, after calling the -(void) initializeControls? When i do this in the MyProjectLayer.m:</p>
<pre><code>-(void) initializeControls {
    self.isTouchEnabled = YES;
    [self showPoints];

}

-(void)showPoints{
    CCSprite *healthBar = [CCSprite spriteWithFile:@&#34;SpielenBtn.png&#34;];
    healthBar.position = ccp(50,50);

    [self addChild:healthBar];
    NSLog(@&#34;Jetzt&#34;);
}</code></pre>
<p>Then it will show the healthBar, but from the beginning. So, when i call the method showPoints in the MyProjectWorld.mm</p>
<pre><code>layer = [[MyProjectLayer alloc] init];
    [layer showPoints];</code></pre>
<p>then it will not show the health or points bar. I am not sure, where`s the problem, but i think the problem is the z-order. What can i do? Any ideas? Or do I do it completely wrong?</p>
<p>Thanks
</p></description>
		</item>

	</channel>
</rss>

