<?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: onEnterTransitionDidFinish - Recent Topics</title>
		<link>http://www.cocos2d-iphone.org/forum/tags/onentertransitiondidfinish</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:48:28 +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/onentertransitiondidfinish/topics" rel="self" type="application/rss+xml" />

		<item>
			<title>griga on "replaceScene with CCTransition in onEnterTransitionDidFinish"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28188#post-138683</link>
			<pubDate>Sun, 08 Jan 2012 22:34:58 +0000</pubDate>
			<dc:creator>griga</dc:creator>
			<guid isPermaLink="false">138683@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hi everyone! Has anyone encountered the same bug/behavior?<br />
Steps to reproduce problem:<br />
- First of all my every scene is replaced with transition (CCTransitionFade);<br />
- I have RootScene, SceneA and SceneB classes.<br />
- I call pseudocode: [ccdirector replaceScene:transitionScene1WithSceneA]; // let this transition be named "transition1"<br />
- Then I want to wait until transition is finished.<br />
- When transition is finished I want to call another [ccdirector replaceScene:transitionScene2WithSceneB] // let this transition be named "transition2"<br />
   So I override SceneA#<a href='http://www.cocos2d-iphone.org/forum/tags/onentertransitiondidfinish'>onEnterTransitionDidFinish</a> method:<br />
<pre><code>// SceneA class
-(void) onEnterTransitionDidFinish {
    [super onEnterTransitionDidFinish];
    [CCDirector sharedDirector] replaceScene:[CCTransitionFade transitionWithDuration:transitionDuration_
                                                                                                                           scene:[SceneB node]
                                                                                                                     withColor:ccc3(0, 0, 0)];
}</code></pre>
<p>setNextScene with transitions works in several stages.. Between them replaceSceen from transition is called.<br />
But replaceScene with transition in onEnterTransitionDidFinish causes the problem in CCDirector#<a href='http://www.cocos2d-iphone.org/forum/tags/setnextscene'>setNextScene</a>:<br />
<pre><code>-(void) setNextScene  //! Is called when transition1 is finished (runningScene_ = transition1
                                    //! and nextScene_ is an instance of SceneA class
{
	Class transClass = [CCTransitionScene class];
	BOOL runningIsTransition = [runningScene_ isKindOfClass:transClass]; //! YES
	BOOL newIsTransition = [nextScene_ isKindOfClass:transClass];            //! NO

	// If it is not a transition, call onExit/cleanup
	if( ! newIsTransition ) {
		[runningScene_ onExit];      //! &#60;---- here is -onEnterTransitionDidFinish message to my instance of SceneA class is send
                                                          //! so you remember I have called -replaceScene: in onEnterTransitionDidFinish and now
                                                          //! nextScene_ is transition2 scene.

		// issue #709. the root node (scene) should receive the cleanup message too
		// otherwise it might be leaked.
		if( sendCleanupToScene_)
			[runningScene_ cleanup];
	}

	[runningScene_ release];

	runningScene_ = [nextScene_ retain];
	nextScene_ = nil;

	if( ! runningIsTransition ) {
		[runningScene_ onEnter];
		[runningScene_ onEnterTransitionDidFinish];
	}
}</code></pre>
<p>When transition2 is finished i have RootScene present at the screen, SceneA present at the screen doing animations (onExit was not called) and SceneB at the screen too.<br />
If I call replaceScene with delay everything is ok.<br />
The question is it an expected behavior of replaceScene in onEnterTransitionDidFinish? How can I know when transition is completely finished and I can call replaceScene: without worry of crashing and wasting time for waiting?<br />
Will appreciate any help :)
</p></description>
		</item>
		<item>
			<title>MrAzulay on "SIGABRT on [CCDirector sharedDirector] replaceScene"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/22124#post-122923</link>
			<pubDate>Tue, 25 Oct 2011 14:05:33 +0000</pubDate>
			<dc:creator>MrAzulay</dc:creator>
			<guid isPermaLink="false">122923@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I get SIGABRT on this row:<br />
[scenesStack_ replaceObjectAtIndex:index-1 withObject:scene];</p>
<p>I tried to figure this out for hours but dont understand it<br />
Loading the scene with appdelegate works without any problem but with replaceScene i get this problem.</p>
<p><a href="http://pastebin.com/wCyEPwfw" rel="nofollow">http://pastebin.com/wCyEPwfw</a><br />
This is all the code that exists in the layer that tries to replace the scene.</p>
<p>Pleease help!
</p></description>
		</item>
		<item>
			<title>finder39 on "weird issue with accelerometer"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/6548#post-38248</link>
			<pubDate>Fri, 21 May 2010 00:59:11 +0000</pubDate>
			<dc:creator>finder39</dc:creator>
			<guid isPermaLink="false">38248@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I am having a strange issue where as i move from one level to the next (scene) once one has been accelerometer enables, all the ones following can't be. I need in all, and if i disable in level 1, level two is and thats it, and so on.</p>
<p>any ideas?</p>
<p>self.isAccelerometerEnabled = YES;</p>
<p>thats what i use
</p></description>
		</item>
		<item>
			<title>degborta on "Particle snow transition"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/2496#post-15607</link>
			<pubDate>Fri, 16 Oct 2009 06:34:18 +0000</pubDate>
			<dc:creator>degborta</dc:creator>
			<guid isPermaLink="false">15607@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I am playing around with the particle examples and using it on one of my layers in my testproject.</p>
<p>Everything is working great but I have a question.</p>
<p>In my project I have a Layer that fades into another Layer (the one that should have the snow on it). I am adding the snow particles on init in the second layer.</p>
<p>When the transition between the scenes is finished, the snow particles haven't reached that far. They are on the top third part of the screen. It takes a second or two before they reach bottom. </p>
<p>This makes it pretty obvious that I just started the snow animation. I would like it to cover the whole screen with particles, so when the transition finishes it appears it has been snowing for a long time. But I am clueless to what I should do or look into.</p>
<p>Any tips or ideas are greatly appreciated.
</p></description>
		</item>
		<item>
			<title>jotajota on "Scene Transition"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/316#post-1792</link>
			<pubDate>Fri, 26 Jun 2009 08:27:15 +0000</pubDate>
			<dc:creator>jotajota</dc:creator>
			<guid isPermaLink="false">1792@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hi there,</p>
<p>Using different combinations of push/replace MoveFromRight/SlideFromRight, I always get the transition to the new scene some how not right. Sometimes the new scene starts showing in the middle of the screen. Sometimes accelerates abruptly at the beginning of it...</p>
<p>I want them to be half a second long. Could this be a problem?<br />
Any other pointers?</p>
<p>Gracias amigos.
</p></description>
		</item>

	</channel>
</rss>

