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

		<item>
			<title>javy on "Screen Shake - Best way to implement?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/2754#post-17094</link>
			<pubDate>Sun, 01 Nov 2009 16:12:44 +0000</pubDate>
			<dc:creator>javy</dc:creator>
			<guid isPermaLink="false">17094@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I was toying with the idea of how to make a screen shake.  At first I thought of having a special class that would take a reference to a scene and then move the position of a whole scene with each tick of its selector.</p>
<p>Then I was reading about the camera - even though I haven't used it yet.</p>
<p>In a single-screen app, the camera sounds about right.  A 'Shake' class would move the camera via it's scheduled calls until the shake was complete.  Custom patterns could be made in simple CGPoint arrays for speed of processing.</p>
<p>But before I write all this code, is there a screen shake style functionality built-in already? I'd hate to re-invent the wheel.  A solid search of the forums turned up nothing.</p>
<p>If it doesn't exist, does my initial design of the class seem good?</p>
<p>Any constructive feedback welcomed!
</p></description>
		</item>
		<item>
			<title>coolbloke1324 on "Scaling a CocosNode from the center (0.8.2)"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/3825#post-22878</link>
			<pubDate>Sun, 10 Jan 2010 17:43:03 +0000</pubDate>
			<dc:creator>coolbloke1324</dc:creator>
			<guid isPermaLink="false">22878@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hi all, I'm using 0.8.2.</p>
<p>I've created a CocosNode:</p>
<p><code>_gameBoard = [CocosNode node];</code></p>
<p>Then added that node to the scene:</p>
<p><code>[self addChild:_gameBoard];</code></p>
<p>After this, I've added a number of child sprites to _gameBoard.</p>
<p>My main issue is that when I use <code>_gameBoard.scale = 0.5f;</code> the scale effect occurs from bottom-left of the iphone screen. I need to scale from the middle of the _gameBoard.</p>
<p>I've tried:</p>
<p><code>[_gameBoard setAnchorPoint:ccp(0.5f, 0.5f)];</code></p>
<p>With no success.</p>
<p>Any ideas guys?</p>
<p>Many thanks!
</p></description>
		</item>
		<item>
			<title>Bongeh on "Animation from cocosnode object"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/3242#post-20071</link>
			<pubDate>Wed, 02 Dec 2009 11:07:42 +0000</pubDate>
			<dc:creator>Bongeh</dc:creator>
			<guid isPermaLink="false">20071@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I have a sprite manager cocosnode which is suposed to control enemy actions and animations. Sprite manager gets added to game layer as a child. When trying to call animations on sprite objects they fail to run and the conditions state they must run. Can you call an animation from outside a layer or does it have to be called from within it?</p>
<p>Thanks
</p></description>
		</item>
		<item>
			<title>Anny on "TargetedTouchDelegate and Sprite — now TouchableSprite"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/3196#post-19751</link>
			<pubDate>Sat, 28 Nov 2009 23:44:58 +0000</pubDate>
			<dc:creator>Anny</dc:creator>
			<guid isPermaLink="false">19751@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hi again,</p>
<p>Getting pretty comfortable with cocos2d now, but I am having one issue, and some clarification would be appreciated.</p>
<p>I am attempting to load an image and then make it clickable (i.e. using it as a button). However, <code>Class &#39;Sprite&#39; does not implement the &#39;TargetedTouchDelegate&#39; protocol</code>. Since this is the case, what exactly implements TargetedTouchDelegate?</p>
<p>FWIW, I have the impression that anything that subclasses CocosNode implements it, I'm just not totally sure. While I'm here, what is a recommended way to implement a button that manages its own touch events?</p>
<p>Thanks
</p></description>
		</item>
		<item>
			<title>davey on "[CocosNode visit] crashed?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/3198#post-19757</link>
			<pubDate>Sun, 29 Nov 2009 02:18:25 +0000</pubDate>
			<dc:creator>davey</dc:creator>
			<guid isPermaLink="false">19757@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>This never happened in debug mode, but in adhoc, I have gotten this both on 3G and 3GS from fresh install of the app, but not everytime. It crashed right after I touched (drag) the game.<br />
I'm not sure what caused this. Any ideas?</p>
<pre><code>Thread 0 Crashed:
0   libSystem.B.dylib             	0x0007e9ac __kill + 8
1   libSystem.B.dylib             	0x0007e99c kill + 4
2   libSystem.B.dylib             	0x0007e98e raise + 10
3   libSystem.B.dylib             	0x0009363a abort + 34
4   libstdc++.6.dylib             	0x000453b0 __gnu_cxx::__verbose_terminate_handler() + 376
5   libobjc.A.dylib               	0x00005858 _objc_terminate + 104
6   libstdc++.6.dylib             	0x00043776 __cxxabiv1::__terminate(void (*)()) + 46
7   libstdc++.6.dylib             	0x000437ca std::terminate() + 10
8   libstdc++.6.dylib             	0x00043896 __cxa_throw + 74
9   libobjc.A.dylib               	0x00004714 objc_exception_throw + 64
10  CoreFoundation                	0x000930c4 __NSFastEnumerationMutationHandler + 124
11  libobjc.A.dylib               	0x000085e6 objc_enumerationMutation + 18
12  BombMine                       	0x00056148 -[CocosNode visit] (CocosNode.m:439)
13  BombMine                       	0x00056170 -[CocosNode visit] (CocosNode.m:441)
14  BombMine                       	0x00056170 -[CocosNode visit] (CocosNode.m:441)
15  BombMine                       	0x00056170 -[CocosNode visit] (CocosNode.m:441)
16  BombMine                       	0x000589f4 -[Director mainLoop] (Director.m:241)
17  Foundation                    	0x0000ccfe __NSFireTimer + 130
18  CoreFoundation                	0x00056bac CFRunLoopRunSpecific + 2112
19  CoreFoundation                	0x00056356 CFRunLoopRunInMode + 42
20  GraphicsServices              	0x00003cb8 GSEventRunModal + 108
21  GraphicsServices              	0x00003d64 GSEventRun + 56
22  UIKit                         	0x00002768 -[UIApplication _run] + 384
23  UIKit                         	0x0000146c UIApplicationMain + 688
24  BombMine                       	0x00002ed4 main (main.m:14)
25  BombMine                       	0x00002e54 start + 44</code></pre></description>
		</item>
		<item>
			<title>derekvanvliet on "Can AtlasSprites be children of any node?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/1378#post-8280</link>
			<pubDate>Mon, 17 Aug 2009 02:39:23 +0000</pubDate>
			<dc:creator>derekvanvliet</dc:creator>
			<guid isPermaLink="false">8280@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Is it true that AtlasSprites can only be children of AtlasSpriteManager nodes? I'm noticing that mine disappear when I child them to anything else, like a layer, for instance.
</p></description>
		</item>
		<item>
			<title>hanburyn on "game live not listed"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/2853#post-17656</link>
			<pubDate>Fri, 06 Nov 2009 18:35:11 +0000</pubDate>
			<dc:creator>hanburyn</dc:creator>
			<guid isPermaLink="false">17656@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>hi</p>
<p>I've changed the game ready status to true a few days ago for sevens and it still isnt listed in your game section
</p></description>
		</item>
		<item>
			<title>neromid on "Does AtlasSpriteManager.position move it&#039;s children?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/915#post-5406</link>
			<pubDate>Sun, 26 Jul 2009 15:42:46 +0000</pubDate>
			<dc:creator>neromid</dc:creator>
			<guid isPermaLink="false">5406@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>The title of this post really reveals everything I have to ask, but it's really bugging me.  I noticed AtlasSpriteManager, like most things, is a subclass of CocosNode, which has, as most everyone knows, a position property.  <strong>If I change the AtlasSpriteManager's position, will the position of it's children be moved as well?</strong>
</p></description>
		</item>
		<item>
			<title>TD on "MenuItemSprite: Scaling of child-nodes?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/2595#post-16124</link>
			<pubDate>Wed, 21 Oct 2009 14:52:49 +0000</pubDate>
			<dc:creator>TD</dc:creator>
			<guid isPermaLink="false">16124@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>A MenuItemSprite has three instance variables:</p>
<p>CocosNode&#60;CocosNodeRGBA&#62; *normalImage_, *selectedImage_, *disabledImage_;</p>
<p>I only want to scale this buttonimages, without any labels or other child nodes in the item, but it doesn't work. I tried something like:</p>
<p>[self.normalImage setScaleX:scaleX];</p>
<p>Anyone has an idea? What do I wrong?
</p></description>
		</item>
		<item>
			<title>crmagicxxx on "getChildByTag vs direct access"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/1502#post-9206</link>
			<pubDate>Mon, 24 Aug 2009 13:29:56 +0000</pubDate>
			<dc:creator>crmagicxxx</dc:creator>
			<guid isPermaLink="false">9206@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I see everybody uses getChildByTag to get desired CocosNode object from the scene. It's simple iterating function, getting all the children and comparing to wanted one by the tag. </p>
<p>What if you need that child in a scheduled method that runs very frequently and you have e.g. 100 CocosNode objects in your scene? So every single step you're iterating through all 100 objects (if your object happens to be the last one).</p>
<p>Anybody made some performance tests to see how that method compares to direct access to CocosNode object via property/retain?
</p></description>
		</item>
		<item>
			<title>adpro on "set isTouchEnabled for one layer from another layer"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/1461#post-8906</link>
			<pubDate>Fri, 21 Aug 2009 17:35:56 +0000</pubDate>
			<dc:creator>adpro</dc:creator>
			<guid isPermaLink="false">8906@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hello,</p>
<p>I'm basically just wondering if there is a way to set isTouchEnabled on a layer from another layer.</p>
<p>Basically this is what I have.</p>
<p>Layer1<br />
 adds two other layers - Layer2 and Layer3</p>
<p>Layer2<br />
 handles touches to begin with - working well</p>
<p>Layer3<br />
 handle touches when it needs to</p>
<p>Now, I'm at work and not on my mac, but what I am trying to do is setup a 'menu' type layer that opens up on top of the other layer - I want only this menu layer to be touch enabled.</p>
<p>So, through Layer1, I load both layers (the menu one doesn't take up much memory) and I set Layer3 (menu layer) to have a greater Z value than Layer2 - so, it pops up in front.</p>
<p>Now, this works fine if I handle all the touches through Layer2, but I don't want to do that.  I want Layer3 to handle touches.</p>
<p>I hope this makes sense.</p>
<p>Either way, I have tried to do something along the lines of:</p>
<p>Layer3.isTouchEnabled = YES;<br />
Layer2.isTouchEnabled = NO;</p>
<p>It tells me I can't do this.</p>
<p>So, if I were to set a CocosNode in Layer1 for Layer2 and Layer3, is there a way to set something in that node to have isTouchEnabled changed?</p>
<p>If not, I'll have to explore other options.  Any suggestions?</p>
<p>I hope this all makes sense.  I can provide some code in a few hours.
</p></description>
		</item>
		<item>
			<title>tombo on "Rotation Weirdness"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/1251#post-7589</link>
			<pubDate>Tue, 11 Aug 2009 10:25:43 +0000</pubDate>
			<dc:creator>tombo</dc:creator>
			<guid isPermaLink="false">7589@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Ok, I asked a similar question yesterday but for some reason when I post a topic and set it to my favorites it's automatically a link back to the front of the forum??</p>
<p>Anyways, this is a simpler question, (where "cube.png" is a 16x16 square image)</p>
<pre><code>Sprite *s = [Sprite spriteWithFile:@&#34;cube.png&#34;];
CGPoint prePos = [s convertToWorldSpace:CGPointZero];

[gTouchPiece setRotation:(float)[(CocosNode *)s rotation]+90];

CGPoint postPos = [s convertToWorldSpace:CGPointZero];</code></pre>
<p>This will produce different values for prePos and postPos but the object is not moving and its anchor is in the middle?</p>
<p>Any help or suggestion as to how to adjust postPos would be a big help, thanks!
</p></description>
		</item>
		<item>
			<title>Decept on "Getting a node&#039;s scheduled timer"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/1233#post-7440</link>
			<pubDate>Mon, 10 Aug 2009 13:36:45 +0000</pubDate>
			<dc:creator>Decept</dc:creator>
			<guid isPermaLink="false">7440@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I have a type of object that is continously created during my game and each object has a scheduled message that will fire only once. Now I want to visually display an object's internal timer's remaining time. I've been digging around in the source but I can't find a way to do what I want.</p>
<p>As far as I can see it shouldn't be a problem adding a getter function to CocosNode to retreive the timer and in Timer add a getter for the remaining time.</p>
<p>I have two questions though:<br />
1. Is there perhaps a better way to do this?<br />
2. Is it legal to make modifications to the engine?
</p></description>
		</item>
		<item>
			<title>tombo on "Rotation&#039;s affect on contentSize"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/1230#post-7412</link>
			<pubDate>Mon, 10 Aug 2009 09:21:30 +0000</pubDate>
			<dc:creator>tombo</dc:creator>
			<guid isPermaLink="false">7412@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I have a CocosNode object called Piece thats filled cube shaped sprites which resembles a tetris piece. After Piece is created its anchorPoint is in the center but after performing rotation weird position errors are resulting that I think have something to do with the rotation not swapping contentsize. I'm somewhat of a noob and was hoping to save anymore headsmashing.</p>
<p>Thanks guys and I can post some code if need be!
</p></description>
		</item>
		<item>
			<title>derekvanvliet on "Best way to iterate through node children?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/754#post-4442</link>
			<pubDate>Sun, 19 Jul 2009 18:33:40 +0000</pubDate>
			<dc:creator>derekvanvliet</dc:creator>
			<guid isPermaLink="false">4442@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I want to iterate through the children of a layer. What is the best way to do this? I tried retrieving the layer's children array property but that didn't work.
</p></description>
		</item>
		<item>
			<title>wcrtr on "scheduler question &amp; addChild"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/945#post-5655</link>
			<pubDate>Tue, 28 Jul 2009 04:08:58 +0000</pubDate>
			<dc:creator>wcrtr</dc:creator>
			<guid isPermaLink="false">5655@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>quick question I haven't been able to find a quick answer to:</p>
<p>if you add a scheduler to a node, do you have to add that node to a parent node for the scheduler to run?  I'm trying to run a scheduler on a node without actually adding that node.  Is this the expected behavior?  Should I just use an NSTimer instead?</p>
<p>thanks,<br />
w
</p></description>
		</item>
		<item>
			<title>DogCow on "TileMapAtlas Seams only on &quot;fractional&quot; position."</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/350#post-1996</link>
			<pubDate>Sun, 28 Jun 2009 05:02:42 +0000</pubDate>
			<dc:creator>DogCow</dc:creator>
			<guid isPermaLink="false">1996@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Here's the deal sparky.  Using 0.7.3.   I've got a 2d projection matrix with texture2d set to aliasing, (see code below) but I am still getting seams (gaps) between tiles if I position my TileMapAtlas between pixels (on a fraction position, like 0, 0.5).  I find that when using MoveBy I'll frequently end up w/ my TileMap on a fractional position.  I am contemplating hacks to fix this and am curious if anyone w/ more experience has any suggestions or input.  The hacks I am thinking about using are:</p>
<p>1- Change the "setPosition" method of CocosNode to round the position.</p>
<blockquote><p>
-(void) setPosition:(CGPoint) pos<br />
{<br />
	position.x = round(pos.x);<br />
	position.y = round(pos.y);<br />
}
</p></blockquote>
<p>2- Implement a "setPosition" method on TileMapAtlas that rounds the position<br />
2a- or inherit a new "WholeNumberTileMapAtlas" that will round it's position when being set.<br />
3- Rework all the "MoveBy" type functions to only move by whole pixels (no fractional positions).</p>
<p>Any suggestions on how to best go about this?  I'm concerned that the rounding of position may break other things.  Any feedback would be much appreciated.</p>
<blockquote><p>
[[Director sharedDirector] set2Dprojection];<br />
[Texture2D setAliasTexParameters];<br />
TileMapAtlas* tilemap1 = [TileMapAtlas tileMapAtlasWithTileFile:@"tiles.png"<br />
														mapFile:@"level.tga"<br />
													  tileWidth:32<br />
													 tileHeight:32];<br />
[tilemap1 setPosition:ccp(0,0.5)];<br />
[self addChild:tilemap1];<br />
[Texture2D restoreTexParameters];
</p></blockquote></description>
		</item>
		<item>
			<title>ghostradio on "removeAllChildrenWithCleanup:YES - is this recursive?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/379#post-2136</link>
			<pubDate>Mon, 29 Jun 2009 21:37:27 +0000</pubDate>
			<dc:creator>ghostradio</dc:creator>
			<guid isPermaLink="false">2136@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Do I need to manually implement a cleanUp method on everything I build that extends CocosNode? I'm calling removeAllChildrenWithCleanup:YES on a Scene, but it doesn't appear to go any deeper than the Scene's immediate children and enter their cleanup methods.
</p></description>
		</item>
		<item>
			<title>gravity on "Working with the schedule message for CocosNode"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/599#post-3603</link>
			<pubDate>Sun, 12 Jul 2009 02:01:07 +0000</pubDate>
			<dc:creator>gravity</dc:creator>
			<guid isPermaLink="false">3603@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I have a layer (ballLayer) where pretty much most of my game takes place. In this layer, I want to add two kinds of balls, one explodes after three seconds.</p>
<p>So I've setup the class (subclassing CocosNode), all I need to do is </p>
<p>&#62; Ball *ball = [[Ball alloc] initWithStuff:etc]; </p>
<p>and I've instantiated the ball (done in my ballLayer.m). </p>
<p>I figure that it'd be easier if I had my class take care of its action for me, so I gave it a message:</p>
<p>&#62; [ball explode];</p>
<p>where explode is a method in the Ball.m :</p>
<p>&#62; -(void) explode {<br />
&#62;    [self schedule: @selector(tick:) interval: 1.0f/60.0f];<br />
&#62; }</p>
<p>Now here's where I'm getting held up. I'm getting nothing in my -(void)tick:(ccTime)dt {...} function. I can even change the tick to "tickYou" and it doesn't even throw up an error or stop the program while running. </p>
<p>The most likely explanation is that I'm misunderstanding what CocosNode is, or how to setup a schedule. I can do it just fine in my main game layer class, but when I try to set one up for the instance of the ball itself, I've got nothing.</p>
<p>Any help, comments, suggestions, vulgar remarks about my dumb mistake are appreciated (I'm still new to programming). Thanks!
</p></description>
		</item>
		<item>
			<title>Acceleroto on "Occurro!  - just submitted!"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/276#post-1462</link>
			<pubDate>Wed, 24 Jun 2009 07:31:32 +0000</pubDate>
			<dc:creator>Acceleroto</dc:creator>
			<guid isPermaLink="false">1462@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I just submitted my next game, Occurro! - running on Cocos2D iPhone 0.7.3.  It's a top-down space shooter that I've been working on in my spare time for the last 4 months.  I got a few people addicted to it at WWDC...I'm hoping I can get the rest of the world addicted to it in a couple weeks.  :)</p>
<p>I just posted a few screenshots here:<br />
<a href="http://bit.ly/occurroscreenshots" rel="nofollow">http://bit.ly/occurroscreenshots</a></p>
<p>A teaser video from an early version of the game is here:<br />
<a href="http://bit.ly/occurrovideo" rel="nofollow">http://bit.ly/occurrovideo</a></p>
<p>-Bryan
</p></description>
		</item>

	</channel>
</rss>

