<?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: Touch - Recent Posts</title>
		<link>http://www.cocos2d-iphone.org/forum/tags/touch</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:13:01 +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/touch" rel="self" type="application/rss+xml" />

		<item>
			<title>breskit on "Am I doing this the right way?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28957#post-143424</link>
			<pubDate>Thu, 09 Feb 2012 10:26:25 +0000</pubDate>
			<dc:creator>breskit</dc:creator>
			<guid isPermaLink="false">143424@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>After much scratching of my head I've finally got this to work as it should.  After much confusion over what child items I was trying to add (the wrong ones!) and playing around with sprite anchor points, I've finally managed to get my shapes connected to my body, and have the sprites displayed accordingly for each shape.</p>
<p><img src="http://i684.photobucket.com/albums/vv207/breskit/cross-1.jpg" /></p>
<p>The cross rotates around the center wheel and the arms rotate around in the correct places.<br />
The advantage I have for this is that I now have many less chipmunk bodies in my project, and less constraints to move them all around.</p>
<p>Thanks again for your help Scott.</p>
<p>EDIT:  I know I still have four shapes in the above diagram, but will change that to using two once I have created new sprites for them.
</p></description>
		</item>
		<item>
			<title>slembcke on "Am I doing this the right way?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28957#post-143293</link>
			<pubDate>Wed, 08 Feb 2012 16:13:42 +0000</pubDate>
			<dc:creator>slembcke</dc:creator>
			<guid isPermaLink="false">143293@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>If [self parent] is returning nil, then addChild: will silently fail. What is 'self' and why are you adding more sprites to the parent of self? Has 'self' actually been added to another node?
</p></description>
		</item>
		<item>
			<title>breskit on "Am I doing this the right way?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28957#post-143264</link>
			<pubDate>Wed, 08 Feb 2012 13:20:42 +0000</pubDate>
			<dc:creator>breskit</dc:creator>
			<guid isPermaLink="false">143264@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p><code>You could sync a single node with 4 child sprites to the body, or you could sync the 4 sprites separately</code></p>
<p>Can anyone tell me how to do this?  I've tried adding a sprite to another using</p>
<p><code>[[self parent] addChild:arm1];</code></p>
<p>I then add my sprite to the batchnode</p>
<p><code>[batchnode addChild:mycross z:zdepth];</code></p>
<p>but I still cannot see the sprite.  I notice that my cross object has no children (i.e. [cross children].count = 0).  So could these issues be related to the way I have subclassed CCSprite?   I have the situation where I inherit CROSS -&#62; CPSPRITE -&#62; CCSPRITE</p>
<p>If I add a parent sprite to a batchnode, do all of it's children automatically get added or do I have to add each child?</p>
<p>Once I crack this problem I should be on my merry way!</p>
<p>Thanks agian.<br />
Tony B
</p></description>
		</item>
		<item>
			<title>breskit on "Am I doing this the right way?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28957#post-143227</link>
			<pubDate>Wed, 08 Feb 2012 08:21:54 +0000</pubDate>
			<dc:creator>breskit</dc:creator>
			<guid isPermaLink="false">143227@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>The reason for the red lines is that I have 4 shapes (one for each arm).  I suppose in this example I could simply get away with just two (makes better sense).</p>
<p>What I was trying to do is simply re-use the textures I already have loaded in my project (as you see above) repeating this 4 times.</p>
<p>I will play around with adding child sprites to my node, which is not something I've yet tried.  If I apply a rotation to the parent sprite, will the child sprites also rotate and keep their position too?
</p></description>
		</item>
		<item>
			<title>slembcke on "Am I doing this the right way?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28957#post-143154</link>
			<pubDate>Tue, 07 Feb 2012 22:11:03 +0000</pubDate>
			<dc:creator>slembcke</dc:creator>
			<guid isPermaLink="false">143154@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>You could sync a single node with 4 child sprites to the body, or you could sync the 4 sprites separately. You could also create a single sprite for it if you didn't care about the wasted texture space. I assume you are just synchronizing the position/angle of the body to the sprite. Set the sprite's anchor point accordingly.</p>
<p>Why are there so many red lines in the center? How many shapes do you have there? You really only need two, although it wouldn't really affect the performance unless you had a ton of those in the game.
</p></description>
		</item>
		<item>
			<title>breskit on "Am I doing this the right way?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28957#post-143131</link>
			<pubDate>Tue, 07 Feb 2012 21:06:18 +0000</pubDate>
			<dc:creator>breskit</dc:creator>
			<guid isPermaLink="false">143131@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I'm getting there, eventually.</p>
<p>I've managed to get my shapes connected to the same body now and this has been verified using the debug node draw.<br />
The only issue I now seem to have is the graphical visualisation of all the shapes.</p>
<p>Before any changes I had each sprite as a separate chipmunk body/shape and these were added to my batchnode without any problem.  Essentially 4 different sprites, each with their own location/rotation and controlled by a pair of constraints.</p>
<p>All I see now is just one of my "arms" or my cross, placed in the centre of my body where I was expecting (hoping) to see 4 arms in the same position of the shapes.</p>
<p>Now that I've created the shapes together on the one body, how do I get the sprites to show in the correct place, or do I just create a new sprite to represent the whole lot?</p>
<p>Here's the image of what I've managed to create.  The red outline should be filled with the grey boxes.<br />
<img src="http://i684.photobucket.com/albums/vv207/breskit/cross.jpg" />
</p></description>
		</item>
		<item>
			<title>slembcke on "Am I doing this the right way?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28957#post-143045</link>
			<pubDate>Tue, 07 Feb 2012 16:01:25 +0000</pubDate>
			<dc:creator>slembcke</dc:creator>
			<guid isPermaLink="false">143045@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Well, the shapes are still defined relative to the center of gravity of the body. If they are all centered on the body, it's trivial and you don't really even need any helper programs to do it. You also don't need to make 4 shapes for each arm, it's fine if they overlap. Use cpBoxShapeNew() if they will be centered over the center of gravity, or cpBoxShapeNew2() if not. When using cpBoxShapeNew2(), the bounding box is relative to the center of gravity.
</p></description>
		</item>
		<item>
			<title>breskit on "Am I doing this the right way?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28957#post-142921</link>
			<pubDate>Mon, 06 Feb 2012 20:06:30 +0000</pubDate>
			<dc:creator>breskit</dc:creator>
			<guid isPermaLink="false">142921@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>What I've not worked out is how to calculate the correct vertices.</p>
<p>When I create my separate shapes/bodies, it's straightforward as I create the items normally, then just apply a rotation to them to put them in the correct position/layout.</p>
<p>Now, picture a cross, with four arms at right angles - top, right, down and left, and a wheel in the centre.<br />
The wheel would represent the centre of my body and I create a circle shape added to it.</p>
<p>Using vertex helper I can find out the vertices for each "arm", but am not sure how I integrate these into a single shape.</p>
<p>Is there anything available that will help me work this out or is there a simple formula I should follow in order to work them out correctly?</p>
<p>I'm lucky that I have the debug node working within my project to help verify the bodies &#38; shapes.  Just need a pointer in the right direction to create these shapes.</p>
<p>I see what you mean about the springiness with the constraints.</p>
<p>Thanks again.<br />
Tony B
</p></description>
		</item>
		<item>
			<title>slembcke on "Am I doing this the right way?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28957#post-142867</link>
			<pubDate>Mon, 06 Feb 2012 15:36:26 +0000</pubDate>
			<dc:creator>slembcke</dc:creator>
			<guid isPermaLink="false">142867@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Yes, you just simply create more than one shape that is attached to the same body by passing the body to more than one shape when creating it.</p>
<p>As for constraints, you don't need any when they are on the same body. Constraints connect bodies together, not shapes. Constraints unavoidably make things a little springy, so you want to have as few as possible (or none). By putting the shapes on the same body they are already perfectly rigidly connected.
</p></description>
		</item>
		<item>
			<title>breskit on "Am I doing this the right way?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28957#post-142831</link>
			<pubDate>Mon, 06 Feb 2012 08:54:47 +0000</pubDate>
			<dc:creator>breskit</dc:creator>
			<guid isPermaLink="false">142831@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I think I've answered my own question above, looking at an example I've found.  The offsets for my shapes are simply based on the vertices I pass in.</p>
<p>Just need to recalculate the vertices I use for each shape.
</p></description>
		</item>
		<item>
			<title>breskit on "Am I doing this the right way?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28957#post-142829</link>
			<pubDate>Mon, 06 Feb 2012 08:25:16 +0000</pubDate>
			<dc:creator>breskit</dc:creator>
			<guid isPermaLink="false">142829@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Could you please give me an example of how I add a shape to a body?</p>
<p>I currently use this (sort of) method to create my shapes &#38; bodies.</p>
<pre><code>float mass = objectmass;
        if (collisionType == kCollisionTypeLift) {
            body = cpBodyNew(mass, INFINITY);
        } else {
            body = cpBodyNew(mass, cpMomentForBox(mass, self.contentSize.width, self.contentSize.height));
        }
        body-&#62;p = location;
        cpSpaceAddBody(space, body);

        shape = cpPolyShapeNew(body, numVerts, verts, cpvzero);
        shape-&#62;e = objectElastic;
        shape-&#62;u = objectFriction;
        shape-&#62;data = self;
        shape-&#62;collision_type = collisionType;
        cpSpaceAddShape(space, shape);</code></pre>
<p>With this I can see that the body and the shape are added into the Chipmunk space, but having read the documentation, it's not clear to me how I add more shapes to the same body.  Would I just repeat the bottom half of my method above to add more shapes to the body? As so:</p>
<pre><code>shape = cpPolyShapeNew(body, numVerts, verts, cpvzero);
        shape-&#62;e = objectElastic;
        shape-&#62;u = objectFriction;
        shape-&#62;data = self;
        shape-&#62;collision_type = collisionType;
        cpSpaceAddShape(space, shape);</code></pre>
<p>If I did that, how would I set the offset of the shape, as I thought positioning was done on the body? (body-&#62;p)</p>
<p>You could be right in what you say about the constraints as I have had to create 10 constraints per cross object. Sometimes I have 4 or 5 on screen, which is quite a few constraints!  Would be better if I only needed two!!
</p></description>
		</item>
		<item>
			<title>slembcke on "Am I doing this the right way?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28957#post-142802</link>
			<pubDate>Mon, 06 Feb 2012 02:13:53 +0000</pubDate>
			<dc:creator>slembcke</dc:creator>
			<guid isPermaLink="false">142802@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Yes, probably a significant performance gain. Though I'm just guessing. The bigger part is that you don't need any constraints to hold the stuff together, and it won't get all spongy from having to solve all the constraints. It also would be a fraction as much code to set it all up.
</p></description>
		</item>
		<item>
			<title>breskit on "Am I doing this the right way?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28957#post-142784</link>
			<pubDate>Sun, 05 Feb 2012 22:01:09 +0000</pubDate>
			<dc:creator>breskit</dc:creator>
			<guid isPermaLink="false">142784@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Thanks for the reply.</p>
<p>I've been doing some digging today and found that the targeted touch despatchers weren't being cleaned up properly which left me with many touch delegates, not attached to any objects, looking for a touch to occur.</p>
<p>I've now modified my project so that I clean everything up and things seem to be behaving much better now.</p>
<p>Scott, can I ask - is there any performance gain from adding multiple shapes to a body rather than having separate shapes &#38; bodies?  I ask as the class I use to create the chipmunk bodies create everything in that manner.  If there is a gain, then I would need to amend my class to add a shape to an existing body.  Is it worth it?
</p></description>
		</item>
		<item>
			<title>slembcke on "Am I doing this the right way?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28957#post-142776</link>
			<pubDate>Sun, 05 Feb 2012 21:02:26 +0000</pubDate>
			<dc:creator>slembcke</dc:creator>
			<guid isPermaLink="false">142776@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>You can attach more than one shape to a body. They can even overlap without issue. Just make a pair of boxes. To calculate the moment of inertia for a compound object, just add the individual moments together.
</p></description>
		</item>
		<item>
			<title>breskit on "Am I doing this the right way?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28957#post-142728</link>
			<pubDate>Sun, 05 Feb 2012 09:26:25 +0000</pubDate>
			<dc:creator>breskit</dc:creator>
			<guid isPermaLink="false">142728@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hi folks,</p>
<p>Apologies for the long post, but I'm a little stuck!</p>
<p>I just wanted to ask if some of you more experienced folks can tell me if I am coding my project the right way?  I think I have a couple of areas on my project that I may not be handling in the best way, so here's a question on the first.</p>
<p>In my project I'm using Chipmunk for physics and have created a number of "objects" that rotate.  One such example is a cross.  As the cross is a convex shape I have created each arm as a separate shape, so have a total of 4 shapes in my cross object (well, 5 actually as I also have a centre wheel).  These arms are joined by pivot joints around the centre of the cross and are rotated by a simple motor joints.</p>
<p>The touch event on the cross stops/starts it rotating (sets the motor angle to 0/45 accordingly).</p>
<p>My cross object is defined as so:-</p>
<pre><code>@interface _cross : CPSprite &#60;CCTargetedTouchDelegate&#62; {
    CPSprite *arm1;
    CPSprite *arm2;
    CPSprite *arm3;
    CPSprite *arm4;
    CPSprite *wheel;
    float objectMass;
    BOOL isMoving;
    cpConstraint *c1;
    cpConstraint *c2;
    cpConstraint *c3;
    cpConstraint *c4;
    cpConstraint *c5;
    cpConstraint *c6;
    cpConstraint *c7;
    cpConstraint *c8;
    cpConstraint *c9;
    cpConstraint *c10;
    float rotationAngle;
    cpSpace *mSpace;
    cpBody *mGround;

    CGRect rect1;
    CGRect rect2;
    CGRect rect3;
    CGRect rect4;
    CGRect rect5;

}</code></pre>
<p>Touch event for the cross:</p>
<pre><code>-(BOOL) containsTouch:(UITouch*) touch {

    CGPoint locationTouched = [arm1 convertTouchToNodeSpace:touch];
    BOOL isTouched1 = CGRectContainsPoint(rect1, locationTouched);

    locationTouched = [arm2 convertTouchToNodeSpace:touch];
    BOOL isTouched2 = CGRectContainsPoint(rect2, locationTouched);

    locationTouched = [arm3 convertTouchToNodeSpace:touch];
    BOOL isTouched3 = CGRectContainsPoint(rect3, locationTouched);

    locationTouched = [arm4 convertTouchToNodeSpace:touch];
    BOOL isTouched4 = CGRectContainsPoint(rect4, locationTouched);

    locationTouched = [wheel convertTouchToNodeSpace:touch];
    BOOL isTouched5 = CGRectContainsPoint(rect5, locationTouched);

    return isTouched1 &#124;&#124; isTouched2 &#124;&#124; isTouched3 &#124;&#124; isTouched4 &#124;&#124; isTouched5;
}

-(BOOL) ccTouchBegan:(UITouch *)touch withEvent:(UIEvent *)event {
    if (![self containsTouch:touch]) return NO;
    [self toggleMoving:mSpace withGround:mGround];
    return YES;
}</code></pre>
<p>Inside CPSprite I have an update method:</p>
<pre><code>- (void)update {
    self.position = body-&#62;p;
    self.rotation = CC_RADIANS_TO_DEGREES(-1 * body-&#62;a);
}</code></pre>
<p>And my game loop, I call the update for every CPSprite:</p>
<pre><code>-(void) step: (ccTime) delta {
    int steps = 1;
    cpFloat dt = 1.0f/60.0f/(cpFloat)steps;

    for(int i=0; i&#60;steps; i++){
        cpSpaceStep(space, dt);
    }

    for (CPSprite *sprite in batchNode.children) {

        if (sprite) {
            [sprite update];
        }
        if ([sprite isKindOfClass:[rock class]]) {
        }
    } 

    // need to check if level complete
    CGRect image_rect1 = CGRectMake(theEndGate.target.position.x,theEndGate.target.position.y,35,35);

    for (rock *arock in _rocks) {
        float rockw = arock.boundingBox.size.width;
        CGRect image_rect2 = CGRectMake(arock.position.x, arock.position.y, rockw, rockw);

        if(CGRectIntersectsRect(image_rect1, image_rect2)) {
            if (!endGateHit) {
                endGateHit = YES;
                [self addEndgatePD];
                [self endScene:TRUE];
            }
        }

    }
    cpSpaceReindexStatic(space);
}</code></pre>
<p>The CPSprite class allows me to create my CCSprite and Chipmunk body/shape. The touch delegate gives me the targeted touches agains this cross object.<br />
As part of the cross 'init' I calculate the CGRect properties for each piece of the cross so I don't have to calculate this each time I look for a touch.  The position and rotation of these are updated within CPSprite.</p>
<p>The questions I have now are:</p>
<p>1.  In pre-calculating the CGRect for the cross arms, do I need to recalculate these each time for the touch event? I don't think I do as the position/rotation appears to be updated OK.</p>
<p>2. Have I created the arms for the cross in the best way - using separate Chipmunk bodies/sprites/etc, or should I be trying to use a single Chipmunk body in someway for the whole object?</p>
<p>3. Is my main update call within the step: the most efficient way of handling this?  On some levels of my project there are as few as 12 sprites to update, but on others there can me as many as 80+.  Performance/FPS still seem quite good though (around 52fps in most cases).</p>
<p>My problem may just be down to my fat fingers not hitting the right place on the screen to toggle the moving (seems accurate when I use the mouse in simulator). Either that or I'm not calculating/using something correctly.
</p></description>
		</item>
		<item>
			<title>popsalicious on "Touch Counter"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28945#post-142701</link>
			<pubDate>Sat, 04 Feb 2012 21:45:21 +0000</pubDate>
			<dc:creator>popsalicious</dc:creator>
			<guid isPermaLink="false">142701@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Also I'm converting to the touchDelegate and CCTouchBegan instead of CCTouchesBegan.
</p></description>
		</item>
		<item>
			<title>popsalicious on "Touch Counter"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28945#post-142699</link>
			<pubDate>Sat, 04 Feb 2012 21:44:29 +0000</pubDate>
			<dc:creator>popsalicious</dc:creator>
			<guid isPermaLink="false">142699@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Thanks, I'm trying that now.  The tapCount seemed like it might work but I want to make sure that it only counts taps within the sprite's bounding box (which as you can see I had to fudge a little bit), and I'm not sure how to do that or how to reset the tapCount after a certain number of taps or certain amount of time.
</p></description>
		</item>
		<item>
			<title>Bananni on "Touch Counter"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28945#post-142697</link>
			<pubDate>Sat, 04 Feb 2012 21:37:11 +0000</pubDate>
			<dc:creator>Bananni</dc:creator>
			<guid isPermaLink="false">142697@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>pokeCount will never reach 2 if you set it first to 0 and then only count 1 up and never touch it again, move it to your interface file would solve it.<br />
(UITouch has a tapCount value if that would also help)
</p></description>
		</item>
		<item>
			<title>popsalicious on "Touch Counter"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28945#post-142692</link>
			<pubDate>Sat, 04 Feb 2012 21:10:19 +0000</pubDate>
			<dc:creator>popsalicious</dc:creator>
			<guid isPermaLink="false">142692@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I'm pretty new to cocos2d, so sorry if this is a super obvious question or I'm just not thinking about it the right way, but I'm trying to make a touch counter in a game.  The idea is that after one touch on a sprite, something happens.  After another touch, a different thing happens.  And after the third touch, yet another thing happens, and the counter returns to 0.  I tried assigning a value to an int pokeCount and having that change each time a touch happened on the sprite (pokeCount++), but it wasn't working for me (if I had the thing happen at pokeCount == 1 it'd work, but pokeCount == 2 didn't).  Any ideas?  Should I make the pokeCount a property of the layer and change it that way?</p>
<p>Here's the code I was trying out:<br />
<pre><code>- (void) ccTouchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
    UITouch *touch = [touches anyObject];
    CGPoint poke=[touch locationInView:[touch view]];
    poke = [[CCDirector sharedDirector] convertToGL:poke];
    poke = [_fatcat convertToNodeSpace:poke];
    int pokeCount = 0;

    if (poke.x&#60;_fatcat.contentSize.width &#38;&#38; poke.x&#62;0 &#38;&#38; poke.y&#60;_fatcat.contentSize.height &#38;&#38; poke.y&#62;4)
        {
            pokeCount++;
            if(pokeCount == 2){
            [self doSomethingElse];
        }
    }
}</code></pre></description>
		</item>
		<item>
			<title>Stepan Generalov on "CCLayerPanZoom touch restrictions"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28906#post-142638</link>
			<pubDate>Sat, 04 Feb 2012 11:01:01 +0000</pubDate>
			<dc:creator>Stepan Generalov</dc:creator>
			<guid isPermaLink="false">142638@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Looks like @<a href='http://www.cocos2d-iphone.org/forum/profile/19783'>bryce</a>'s answer is for CCPanZoomController, but the same idea should work with CCLayerPanZoom - just remove it from CCTouchDispatcher to pause &#38; readd to resume again.</p>
<p>You can write special methods for this, as an addition for CCLayerPanZoom and provide a patch.<br />
Or if you can create an issue on the GitHub.</p>
<p>Thanks!
</p></description>
		</item>
		<item>
			<title>bryce on "CCLayerPanZoom touch restrictions"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28906#post-142484</link>
			<pubDate>Fri, 03 Feb 2012 10:27:08 +0000</pubDate>
			<dc:creator>bryce</dc:creator>
			<guid isPermaLink="false">142484@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Just disable it, then re-enable it:<br />
<pre><code>// Disable and pop up alert
[_controller disable];

// Re-enable when pop up is closed
[_controller enableWithTouchPriority:99 swallowsTouches:NO];</code></pre></description>
		</item>
		<item>
			<title>praveencastelino on "CCLayerPanZoom touch restrictions"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28906#post-142457</link>
			<pubDate>Fri, 03 Feb 2012 06:49:42 +0000</pubDate>
			<dc:creator>praveencastelino</dc:creator>
			<guid isPermaLink="false">142457@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>is there any way for CCLayerPanZoom to stop receiving the touches. I dont want the CCLayerPanZoom to pan or zoom when custom modal alert is shown.
</p></description>
		</item>
		<item>
			<title>kosa_nostra on "Touches and CCLayer"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28861#post-142410</link>
			<pubDate>Thu, 02 Feb 2012 23:48:26 +0000</pubDate>
			<dc:creator>kosa_nostra</dc:creator>
			<guid isPermaLink="false">142410@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Well, thats what I decided to do, thank you for your time anyway.<br />
Cheers,<br />
Kosa
</p></description>
		</item>
		<item>
			<title>Duckwit on "Trouble drawing after touch"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28889#post-142398</link>
			<pubDate>Thu, 02 Feb 2012 22:01:14 +0000</pubDate>
			<dc:creator>Duckwit</dc:creator>
			<guid isPermaLink="false">142398@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Yeah, store the coordinates for the lines/strokes/points/coordinates you are recording from the touch input in an instance variable or array then loop through them in the<br />
<pre><code>-(void)draw</code></pre>
<p>method. ;)
</p></description>
		</item>
		<item>
			<title>JackBixby on "Trouble drawing after touch"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28889#post-142395</link>
			<pubDate>Thu, 02 Feb 2012 21:54:05 +0000</pubDate>
			<dc:creator>JackBixby</dc:creator>
			<guid isPermaLink="false">142395@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Can you only draw in the -(void)draw method? If so is there a workaround?
</p></description>
		</item>
		<item>
			<title>JackBixby on "Trouble drawing after touch"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28889#post-142389</link>
			<pubDate>Thu, 02 Feb 2012 21:09:18 +0000</pubDate>
			<dc:creator>JackBixby</dc:creator>
			<guid isPermaLink="false">142389@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hey all. I'm trying to draw a line after the user touches on the screen, but that's not working. All of the drawing in my draw method works. But none of the drawing in my drawLine method (called after a touch has ended) works. I know that the touching/method calling as the console displays "test." Here's my code:</p>
<p><a href="http://pastebin.com/tGT7qB7P" rel="nofollow">http://pastebin.com/tGT7qB7P</a></p>
<p>Thanks in advance
</p></description>
		</item>
		<item>
			<title>LittleBitStudio on "Touches and CCLayer"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28861#post-142247</link>
			<pubDate>Thu, 02 Feb 2012 04:35:09 +0000</pubDate>
			<dc:creator>LittleBitStudio</dc:creator>
			<guid isPermaLink="false">142247@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Did you set the contentSize of each layer to be only half the screen? if so, can you just check if the touch location is inside the layer's boundingBox using CGRectContainsPoint, and ignore any touch outside of the layer's rect.
</p></description>
		</item>
		<item>
			<title>kosa_nostra on "Touches and CCLayer"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28861#post-142223</link>
			<pubDate>Wed, 01 Feb 2012 23:23:34 +0000</pubDate>
			<dc:creator>kosa_nostra</dc:creator>
			<guid isPermaLink="false">142223@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hi everyone,</p>
<p>I'm working on a game and get confused by something: I have 2 CCLayers, one on the right and one on the left of the screen. Each one are their own touch delegate. My problem is when I touch the left screen, the event is caught by both of my layers.</p>
<p>Basically, I don't understand why a touch in a layer is not caught only in this layer. It's like both of my layers take the entire screen.</p>
<p>Any help, recommandation ?</p>
<p>Cheers,<br />
Kosa
</p></description>
		</item>
		<item>
			<title>elsevero on "how to remove a overlapped sprite."</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28537#post-141833</link>
			<pubDate>Mon, 30 Jan 2012 09:00:15 +0000</pubDate>
			<dc:creator>elsevero</dc:creator>
			<guid isPermaLink="false">141833@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>@<a href='http://www.cocos2d-iphone.org/forum/profile/57693'>breskit</a>: I've replaced with CCCallFuncN and doesn't work...</p>
<p>@<a href='http://www.cocos2d-iphone.org/forum/profile/20192'>Birkemose</a>: Tried your code but it doesn't work either, maybe I'm not use it correctly; Can you explain? Thanks!</p>
<p>Would look like this?</p>
<pre><code>for ( int index = selectedSpritesArray.count - 1; index &#62;= 0; index -- ) {
        selectedSprite = [ selectedSpritesArray objectAtIndex:index ];
        if (CGRectContainsPoint(selectedSprite.boundingBox, touchLocation) ) {
            [selectedSpritesArray removeObjectAtIndex: index ];
        newSprite = selectedSprite;
        break;
        }
    }</code></pre></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>

	</channel>
</rss>

