2012-03-26 16:46:23 +08:00
|
|
|
/****************************************************************************
|
2012-09-24 21:22:20 +08:00
|
|
|
Copyright (c) 2010-2012 cocos2d-x.org
|
2012-03-26 16:46:23 +08:00
|
|
|
Copyright (c) 2009 Lam Pham
|
|
|
|
Copyright (c) 2012 Ricardo Quesada
|
|
|
|
|
|
|
|
http://www.cocos2d-x.org
|
|
|
|
|
|
|
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
of this software and associated documentation files (the "Software"), to deal
|
|
|
|
in the Software without restriction, including without limitation the rights
|
|
|
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
copies of the Software, and to permit persons to whom the Software is
|
|
|
|
furnished to do so, subject to the following conditions:
|
|
|
|
|
|
|
|
The above copyright notice and this permission notice shall be included in
|
|
|
|
all copies or substantial portions of the Software.
|
|
|
|
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
|
|
THE SOFTWARE.
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
#include "CCTransitionProgress.h"
|
|
|
|
#include "CCDirector.h"
|
2013-10-14 14:01:00 +08:00
|
|
|
#include "CCRenderTexture.h"
|
|
|
|
#include "CCProgressTimer.h"
|
2012-03-26 16:46:23 +08:00
|
|
|
#include "CCLayer.h"
|
2013-10-14 14:01:00 +08:00
|
|
|
#include "CCActionInstant.h"
|
|
|
|
#include "CCActionProgressTimer.h"
|
2012-03-26 16:46:23 +08:00
|
|
|
|
|
|
|
NS_CC_BEGIN
|
|
|
|
|
|
|
|
enum {
|
2013-06-20 14:13:12 +08:00
|
|
|
kSceneRadial = 0xc001,
|
2012-03-26 16:46:23 +08:00
|
|
|
};
|
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
TransitionProgress::TransitionProgress()
|
2013-06-15 14:03:30 +08:00
|
|
|
: _to(0.0f)
|
|
|
|
, _from(0.0f)
|
|
|
|
, _sceneToBeModified(NULL)
|
2012-03-26 16:46:23 +08:00
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
TransitionProgress* TransitionProgress::create(float t, Scene* scene)
|
2012-11-01 22:12:13 +08:00
|
|
|
{
|
2013-06-20 14:13:12 +08:00
|
|
|
TransitionProgress* pScene = new TransitionProgress();
|
2012-11-01 22:12:13 +08:00
|
|
|
if(pScene && pScene->initWithDuration(t, scene))
|
|
|
|
{
|
|
|
|
pScene->autorelease();
|
|
|
|
return pScene;
|
|
|
|
}
|
|
|
|
CC_SAFE_DELETE(pScene);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
// TransitionProgress
|
|
|
|
void TransitionProgress::onEnter()
|
2012-03-26 16:46:23 +08:00
|
|
|
{
|
2013-06-20 14:13:12 +08:00
|
|
|
TransitionScene::onEnter();
|
2012-03-26 16:46:23 +08:00
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
setupTransition();
|
|
|
|
|
|
|
|
// create a transparent color layer
|
|
|
|
// in which we are going to add our rendertextures
|
2013-07-12 06:24:23 +08:00
|
|
|
Size size = Director::getInstance()->getWinSize();
|
2012-03-26 16:46:23 +08:00
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
// create the second render texture for outScene
|
2013-06-20 14:13:12 +08:00
|
|
|
RenderTexture *texture = RenderTexture::create((int)size.width, (int)size.height);
|
2013-07-12 14:11:55 +08:00
|
|
|
texture->getSprite()->setAnchorPoint(Point(0.5f,0.5f));
|
|
|
|
texture->setPosition(Point(size.width/2, size.height/2));
|
|
|
|
texture->setAnchorPoint(Point(0.5f,0.5f));
|
2012-03-26 16:46:23 +08:00
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
// render outScene to its texturebuffer
|
2013-12-05 03:54:57 +08:00
|
|
|
texture->beginWithClear(0, 0, 0, 1);
|
2013-06-15 14:03:30 +08:00
|
|
|
_sceneToBeModified->visit();
|
2012-04-19 14:35:52 +08:00
|
|
|
texture->end();
|
2012-03-26 16:46:23 +08:00
|
|
|
|
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
// Since we've passed the outScene to the texture we don't need it.
|
2013-06-15 14:03:30 +08:00
|
|
|
if (_sceneToBeModified == _outScene)
|
2012-03-26 16:46:23 +08:00
|
|
|
{
|
2012-04-19 14:35:52 +08:00
|
|
|
hideOutShowIn();
|
2012-03-26 16:46:23 +08:00
|
|
|
}
|
2012-04-19 14:35:52 +08:00
|
|
|
// We need the texture in RenderTexture.
|
2013-06-20 14:13:12 +08:00
|
|
|
ProgressTimer *pNode = progressTimerNodeWithRenderTexture(texture);
|
2012-03-26 16:46:23 +08:00
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
// create the blend action
|
2013-06-20 14:13:12 +08:00
|
|
|
ActionInterval* layerAction = (ActionInterval*)Sequence::create(
|
|
|
|
ProgressFromTo::create(_duration, _from, _to),
|
2013-07-16 03:43:22 +08:00
|
|
|
CallFunc::create(CC_CALLBACK_0(TransitionScene::finish,this)),
|
2012-03-26 16:46:23 +08:00
|
|
|
NULL);
|
2012-04-19 14:35:52 +08:00
|
|
|
// run the blend action
|
|
|
|
pNode->runAction(layerAction);
|
2012-03-26 16:46:23 +08:00
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
// add the layer (which contains our two rendertextures) to the scene
|
2013-06-20 14:13:12 +08:00
|
|
|
addChild(pNode, 2, kSceneRadial);
|
2012-03-26 16:46:23 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// clean up on exit
|
2013-06-20 14:13:12 +08:00
|
|
|
void TransitionProgress::onExit()
|
2012-03-26 16:46:23 +08:00
|
|
|
{
|
2012-04-19 14:35:52 +08:00
|
|
|
// remove our layer and release all containing objects
|
2013-06-20 14:13:12 +08:00
|
|
|
removeChildByTag(kSceneRadial, true);
|
|
|
|
TransitionScene::onExit();
|
2012-03-26 16:46:23 +08:00
|
|
|
}
|
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
void TransitionProgress::sceneOrder()
|
2012-03-26 16:46:23 +08:00
|
|
|
{
|
2013-06-15 14:03:30 +08:00
|
|
|
_isInSceneOnTop = false;
|
2012-03-26 16:46:23 +08:00
|
|
|
}
|
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
void TransitionProgress::setupTransition()
|
2012-03-26 16:46:23 +08:00
|
|
|
{
|
2013-06-15 14:03:30 +08:00
|
|
|
_sceneToBeModified = _outScene;
|
|
|
|
_from = 100;
|
|
|
|
_to = 0;
|
2012-03-26 16:46:23 +08:00
|
|
|
}
|
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
ProgressTimer* TransitionProgress::progressTimerNodeWithRenderTexture(RenderTexture* texture)
|
2012-03-26 16:46:23 +08:00
|
|
|
{
|
2013-07-20 13:01:27 +08:00
|
|
|
CCASSERT(false, "override me - abstract class");
|
2012-04-19 14:35:52 +08:00
|
|
|
return NULL;
|
2012-03-26 16:46:23 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
// TransitionProgressRadialCCW
|
2012-03-26 16:46:23 +08:00
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
ProgressTimer* TransitionProgressRadialCCW::progressTimerNodeWithRenderTexture(RenderTexture* texture)
|
2012-03-26 16:46:23 +08:00
|
|
|
{
|
2013-07-12 06:24:23 +08:00
|
|
|
Size size = Director::getInstance()->getWinSize();
|
2012-03-26 16:46:23 +08:00
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
ProgressTimer* pNode = ProgressTimer::create(texture->getSprite());
|
2012-03-26 16:46:23 +08:00
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
// but it is flipped upside down so we flip the sprite
|
2013-09-16 20:38:03 +08:00
|
|
|
pNode->getSprite()->setFlippedY(true);
|
2013-07-26 17:28:18 +08:00
|
|
|
pNode->setType(ProgressTimer::Type::RADIAL);
|
2012-04-19 14:35:52 +08:00
|
|
|
|
|
|
|
// Return the radial type that we want to use
|
2012-06-15 15:10:40 +08:00
|
|
|
pNode->setReverseDirection(false);
|
2012-04-19 14:35:52 +08:00
|
|
|
pNode->setPercentage(100);
|
2013-07-12 14:11:55 +08:00
|
|
|
pNode->setPosition(Point(size.width/2, size.height/2));
|
|
|
|
pNode->setAnchorPoint(Point(0.5f,0.5f));
|
2012-04-19 14:35:52 +08:00
|
|
|
|
|
|
|
return pNode;
|
2012-03-26 16:46:23 +08:00
|
|
|
}
|
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
TransitionProgressRadialCCW* TransitionProgressRadialCCW::create(float t, Scene* scene)
|
2012-11-01 22:12:13 +08:00
|
|
|
{
|
2013-06-20 14:13:12 +08:00
|
|
|
TransitionProgressRadialCCW* pScene = new TransitionProgressRadialCCW();
|
2012-11-01 22:12:13 +08:00
|
|
|
if(pScene && pScene->initWithDuration(t, scene))
|
|
|
|
{
|
|
|
|
pScene->autorelease();
|
|
|
|
return pScene;
|
|
|
|
}
|
|
|
|
CC_SAFE_DELETE(pScene);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
// TransitionProgressRadialCW
|
|
|
|
TransitionProgressRadialCW* TransitionProgressRadialCW::create(float t, Scene* scene)
|
2012-11-01 22:12:13 +08:00
|
|
|
{
|
2013-06-20 14:13:12 +08:00
|
|
|
TransitionProgressRadialCW* pScene = new TransitionProgressRadialCW();
|
2012-11-01 22:12:13 +08:00
|
|
|
if(pScene && pScene->initWithDuration(t, scene))
|
|
|
|
{
|
|
|
|
pScene->autorelease();
|
|
|
|
return pScene;
|
|
|
|
}
|
|
|
|
CC_SAFE_DELETE(pScene);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
ProgressTimer* TransitionProgressRadialCW::progressTimerNodeWithRenderTexture(RenderTexture* texture)
|
2012-03-26 16:46:23 +08:00
|
|
|
{
|
2013-07-12 06:24:23 +08:00
|
|
|
Size size = Director::getInstance()->getWinSize();
|
2012-04-19 14:35:52 +08:00
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
ProgressTimer* pNode = ProgressTimer::create(texture->getSprite());
|
2012-04-19 14:35:52 +08:00
|
|
|
|
|
|
|
// but it is flipped upside down so we flip the sprite
|
2013-09-16 20:38:03 +08:00
|
|
|
pNode->getSprite()->setFlippedY(true);
|
2013-07-26 17:28:18 +08:00
|
|
|
pNode->setType( ProgressTimer::Type::RADIAL );
|
2012-04-19 14:35:52 +08:00
|
|
|
|
|
|
|
// Return the radial type that we want to use
|
2012-06-15 15:10:40 +08:00
|
|
|
pNode->setReverseDirection(true);
|
2012-04-19 14:35:52 +08:00
|
|
|
pNode->setPercentage(100);
|
2013-07-12 14:11:55 +08:00
|
|
|
pNode->setPosition(Point(size.width/2, size.height/2));
|
|
|
|
pNode->setAnchorPoint(Point(0.5f,0.5f));
|
2012-04-19 14:35:52 +08:00
|
|
|
|
|
|
|
return pNode;
|
2012-03-26 16:46:23 +08:00
|
|
|
}
|
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
// TransitionProgressHorizontal
|
|
|
|
TransitionProgressHorizontal* TransitionProgressHorizontal::create(float t, Scene* scene)
|
2012-11-01 22:12:13 +08:00
|
|
|
{
|
2013-06-20 14:13:12 +08:00
|
|
|
TransitionProgressHorizontal* pScene = new TransitionProgressHorizontal();
|
2012-11-01 22:12:13 +08:00
|
|
|
if(pScene && pScene->initWithDuration(t, scene))
|
|
|
|
{
|
|
|
|
pScene->autorelease();
|
|
|
|
return pScene;
|
|
|
|
}
|
|
|
|
CC_SAFE_DELETE(pScene);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
ProgressTimer* TransitionProgressHorizontal::progressTimerNodeWithRenderTexture(RenderTexture* texture)
|
2012-04-19 14:35:52 +08:00
|
|
|
{
|
2013-07-12 06:24:23 +08:00
|
|
|
Size size = Director::getInstance()->getWinSize();
|
2012-04-19 14:35:52 +08:00
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
ProgressTimer* pNode = ProgressTimer::create(texture->getSprite());
|
2012-04-19 14:35:52 +08:00
|
|
|
|
|
|
|
// but it is flipped upside down so we flip the sprite
|
2013-09-16 20:38:03 +08:00
|
|
|
pNode->getSprite()->setFlippedY(true);
|
2013-07-26 17:28:18 +08:00
|
|
|
pNode->setType( ProgressTimer::Type::BAR);
|
2012-04-19 14:35:52 +08:00
|
|
|
|
2013-07-12 14:11:55 +08:00
|
|
|
pNode->setMidpoint(Point(1, 0));
|
|
|
|
pNode->setBarChangeRate(Point(1,0));
|
2012-04-19 14:35:52 +08:00
|
|
|
|
|
|
|
pNode->setPercentage(100);
|
2013-07-12 14:11:55 +08:00
|
|
|
pNode->setPosition(Point(size.width/2, size.height/2));
|
|
|
|
pNode->setAnchorPoint(Point(0.5f,0.5f));
|
2012-04-19 14:35:52 +08:00
|
|
|
|
|
|
|
return pNode;
|
2012-03-26 16:46:23 +08:00
|
|
|
}
|
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
// TransitionProgressVertical
|
|
|
|
TransitionProgressVertical* TransitionProgressVertical::create(float t, Scene* scene)
|
2012-11-01 22:12:13 +08:00
|
|
|
{
|
2013-06-20 14:13:12 +08:00
|
|
|
TransitionProgressVertical* pScene = new TransitionProgressVertical();
|
2012-11-01 22:12:13 +08:00
|
|
|
if(pScene && pScene->initWithDuration(t, scene))
|
|
|
|
{
|
|
|
|
pScene->autorelease();
|
|
|
|
return pScene;
|
|
|
|
}
|
|
|
|
CC_SAFE_DELETE(pScene);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
ProgressTimer* TransitionProgressVertical::progressTimerNodeWithRenderTexture(RenderTexture* texture)
|
2012-04-19 14:35:52 +08:00
|
|
|
{
|
2013-07-12 06:24:23 +08:00
|
|
|
Size size = Director::getInstance()->getWinSize();
|
2012-04-19 14:35:52 +08:00
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
ProgressTimer* pNode = ProgressTimer::create(texture->getSprite());
|
2012-04-19 14:35:52 +08:00
|
|
|
|
|
|
|
// but it is flipped upside down so we flip the sprite
|
2013-09-16 20:38:03 +08:00
|
|
|
pNode->getSprite()->setFlippedY(true);
|
2013-07-26 17:28:18 +08:00
|
|
|
pNode->setType(ProgressTimer::Type::BAR);
|
2012-04-19 14:35:52 +08:00
|
|
|
|
2013-07-12 14:11:55 +08:00
|
|
|
pNode->setMidpoint(Point(0, 0));
|
|
|
|
pNode->setBarChangeRate(Point(0,1));
|
2012-04-19 14:35:52 +08:00
|
|
|
|
|
|
|
pNode->setPercentage(100);
|
2013-07-12 14:11:55 +08:00
|
|
|
pNode->setPosition(Point(size.width/2, size.height/2));
|
|
|
|
pNode->setAnchorPoint(Point(0.5f,0.5f));
|
2012-04-19 14:35:52 +08:00
|
|
|
|
|
|
|
return pNode;
|
2012-03-26 16:46:23 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
// TransitionProgressInOut
|
|
|
|
TransitionProgressInOut* TransitionProgressInOut::create(float t, Scene* scene)
|
2012-11-01 22:12:13 +08:00
|
|
|
{
|
2013-06-20 14:13:12 +08:00
|
|
|
TransitionProgressInOut* pScene = new TransitionProgressInOut();
|
2012-11-01 22:12:13 +08:00
|
|
|
if(pScene && pScene->initWithDuration(t, scene))
|
|
|
|
{
|
|
|
|
pScene->autorelease();
|
|
|
|
return pScene;
|
|
|
|
}
|
|
|
|
CC_SAFE_DELETE(pScene);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
void TransitionProgressInOut::sceneOrder()
|
2012-03-26 16:46:23 +08:00
|
|
|
{
|
2013-06-15 14:03:30 +08:00
|
|
|
_isInSceneOnTop = false;
|
2012-03-26 16:46:23 +08:00
|
|
|
}
|
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
void TransitionProgressInOut::setupTransition()
|
2012-03-26 16:46:23 +08:00
|
|
|
{
|
2013-06-15 14:03:30 +08:00
|
|
|
_sceneToBeModified = _inScene;
|
|
|
|
_from = 0;
|
|
|
|
_to = 100;
|
2012-03-26 16:46:23 +08:00
|
|
|
}
|
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
ProgressTimer* TransitionProgressInOut::progressTimerNodeWithRenderTexture(RenderTexture* texture)
|
2012-04-19 14:35:52 +08:00
|
|
|
{
|
2013-07-12 06:24:23 +08:00
|
|
|
Size size = Director::getInstance()->getWinSize();
|
2012-04-19 14:35:52 +08:00
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
ProgressTimer* pNode = ProgressTimer::create(texture->getSprite());
|
2012-04-19 14:35:52 +08:00
|
|
|
|
|
|
|
// but it is flipped upside down so we flip the sprite
|
2013-09-16 20:38:03 +08:00
|
|
|
pNode->getSprite()->setFlippedY(true);
|
2013-07-26 17:28:18 +08:00
|
|
|
pNode->setType( ProgressTimer::Type::BAR);
|
2012-04-19 14:35:52 +08:00
|
|
|
|
2013-07-12 14:11:55 +08:00
|
|
|
pNode->setMidpoint(Point(0.5f, 0.5f));
|
|
|
|
pNode->setBarChangeRate(Point(1, 1));
|
2012-04-19 14:35:52 +08:00
|
|
|
|
|
|
|
pNode->setPercentage(0);
|
2013-07-12 14:11:55 +08:00
|
|
|
pNode->setPosition(Point(size.width/2, size.height/2));
|
|
|
|
pNode->setAnchorPoint(Point(0.5f,0.5f));
|
2012-04-19 14:35:52 +08:00
|
|
|
|
|
|
|
return pNode;
|
2012-03-26 16:46:23 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
// TransitionProgressOutIn
|
|
|
|
TransitionProgressOutIn* TransitionProgressOutIn::create(float t, Scene* scene)
|
2012-11-01 22:12:13 +08:00
|
|
|
{
|
2013-06-20 14:13:12 +08:00
|
|
|
TransitionProgressOutIn* pScene = new TransitionProgressOutIn();
|
2012-11-01 22:12:13 +08:00
|
|
|
if(pScene && pScene->initWithDuration(t, scene))
|
|
|
|
{
|
|
|
|
pScene->autorelease();
|
|
|
|
return pScene;
|
|
|
|
}
|
|
|
|
CC_SAFE_DELETE(pScene);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
ProgressTimer* TransitionProgressOutIn::progressTimerNodeWithRenderTexture(RenderTexture* texture)
|
2012-04-19 14:35:52 +08:00
|
|
|
{
|
2013-07-12 06:24:23 +08:00
|
|
|
Size size = Director::getInstance()->getWinSize();
|
2012-04-19 14:35:52 +08:00
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
ProgressTimer* pNode = ProgressTimer::create(texture->getSprite());
|
2012-04-19 14:35:52 +08:00
|
|
|
|
|
|
|
// but it is flipped upside down so we flip the sprite
|
2013-09-16 20:38:03 +08:00
|
|
|
pNode->getSprite()->setFlippedY(true);
|
2013-07-26 17:28:18 +08:00
|
|
|
pNode->setType( ProgressTimer::Type::BAR );
|
2012-04-19 14:35:52 +08:00
|
|
|
|
2013-07-12 14:11:55 +08:00
|
|
|
pNode->setMidpoint(Point(0.5f, 0.5f));
|
|
|
|
pNode->setBarChangeRate(Point(1, 1));
|
2012-04-19 14:35:52 +08:00
|
|
|
|
|
|
|
pNode->setPercentage(100);
|
2013-07-12 14:11:55 +08:00
|
|
|
pNode->setPosition(Point(size.width/2, size.height/2));
|
|
|
|
pNode->setAnchorPoint(Point(0.5f,0.5f));
|
2012-04-19 14:35:52 +08:00
|
|
|
|
|
|
|
return pNode;
|
2012-03-26 16:46:23 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
NS_CC_END
|
|
|
|
|