Merge pull request #4577 from dabingnn/develop_transitionScene

Develop transition scene
This commit is contained in:
minggo 2013-12-20 03:35:16 -08:00
commit b151a657af
1 changed files with 4 additions and 3 deletions

View File

@ -36,6 +36,7 @@ THE SOFTWARE.
#include "CCLayer.h"
#include "CCRenderTexture.h"
#include "CCNodeGrid.h"
#include "CCNewRenderTexture.h"
NS_CC_BEGIN
@ -1257,7 +1258,7 @@ TransitionCrossFade* TransitionCrossFade::create(float t, Scene* scene)
return nullptr;
}
void TransitionCrossFade:: draw()
void TransitionCrossFade::draw()
{
// override draw since both scenes (textures) are rendered in 1 scene
}
@ -1273,7 +1274,7 @@ void TransitionCrossFade::onEnter()
LayerColor* layer = LayerColor::create(color);
// create the first render texture for inScene
RenderTexture* inTexture = RenderTexture::create((int)size.width, (int)size.height);
RenderTexture* inTexture = NewRenderTexture::create((int)size.width, (int)size.height);
if (nullptr == inTexture)
{
@ -1290,7 +1291,7 @@ void TransitionCrossFade::onEnter()
inTexture->end();
// create the second render texture for outScene
RenderTexture* outTexture = RenderTexture::create((int)size.width, (int)size.height);
RenderTexture* outTexture = NewRenderTexture::create((int)size.width, (int)size.height);
outTexture->getSprite()->setAnchorPoint( Point(0.5f,0.5f) );
outTexture->setPosition( Point(size.width/2, size.height/2) );
outTexture->setAnchorPoint( Point(0.5f,0.5f) );