mirror of https://github.com/axmolengine/axmol.git
fix transition scene CrossFade
This commit is contained in:
parent
87f62bc8a0
commit
ef5b072182
|
@ -36,6 +36,7 @@ THE SOFTWARE.
|
||||||
#include "CCLayer.h"
|
#include "CCLayer.h"
|
||||||
#include "CCRenderTexture.h"
|
#include "CCRenderTexture.h"
|
||||||
#include "CCNodeGrid.h"
|
#include "CCNodeGrid.h"
|
||||||
|
#include "CCNewRenderTexture.h"
|
||||||
|
|
||||||
|
|
||||||
NS_CC_BEGIN
|
NS_CC_BEGIN
|
||||||
|
@ -1257,7 +1258,7 @@ TransitionCrossFade* TransitionCrossFade::create(float t, Scene* scene)
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TransitionCrossFade:: draw()
|
void TransitionCrossFade::draw()
|
||||||
{
|
{
|
||||||
// override draw since both scenes (textures) are rendered in 1 scene
|
// override draw since both scenes (textures) are rendered in 1 scene
|
||||||
}
|
}
|
||||||
|
@ -1273,7 +1274,7 @@ void TransitionCrossFade::onEnter()
|
||||||
LayerColor* layer = LayerColor::create(color);
|
LayerColor* layer = LayerColor::create(color);
|
||||||
|
|
||||||
// create the first render texture for inScene
|
// 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)
|
if (nullptr == inTexture)
|
||||||
{
|
{
|
||||||
|
@ -1290,7 +1291,7 @@ void TransitionCrossFade::onEnter()
|
||||||
inTexture->end();
|
inTexture->end();
|
||||||
|
|
||||||
// create the second render texture for outScene
|
// 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->getSprite()->setAnchorPoint( Point(0.5f,0.5f) );
|
||||||
outTexture->setPosition( Point(size.width/2, size.height/2) );
|
outTexture->setPosition( Point(size.width/2, size.height/2) );
|
||||||
outTexture->setAnchorPoint( Point(0.5f,0.5f) );
|
outTexture->setAnchorPoint( Point(0.5f,0.5f) );
|
||||||
|
|
Loading…
Reference in New Issue